Geb+spock: let your functional tests live long and prosper

10
Geb+Spock: let your functional tests live long and prosper Esther Lozano @esloh o

Transcript of Geb+spock: let your functional tests live long and prosper

Page 1: Geb+spock: let your functional tests live long and prosper

Geb+Spock: let your functional tests live long and prosper

Esther Lozano@esloh

o

Page 2: Geb+spock: let your functional tests live long and prosper

Hello! I’m Esther2009

2015

@esloho

[email protected]

https://github.com/esloho

Page 3: Geb+spock: let your functional tests live long and prosper

Functional tests

Page 4: Geb+spock: let your functional tests live long and prosper

SpockTesting and specification framework for Java and Groovy applications

Open source (Apache License 2.0)

Beautiful and highly expressive tests

Given-When-Then structure

JUnit integration (via Sputnik runner)

Page 5: Geb+spock: let your functional tests live long and prosper

GebGroovy developer tool for browser automation (on top of WebDriver)

Open source (Apache License 2.0)

jQuery-ish navigation API

Page Object Pattern

Optimized for Spock but works with JUnit, TestNG and Cucumber-JVM

(pronounced

“jeb”)

Page 6: Geb+spock: let your functional tests live long and prosper

Page ObjectModels and encapsulates web content

Popularized by WebDriver

Reduces amount of duplicated code

Improves reusability and maintainability

First class support in Geb via Page and Module constructs

Page 7: Geb+spock: let your functional tests live long and prosper

Demo time!

Page 8: Geb+spock: let your functional tests live long and prosper

And more!JavaScript interface (js object to access methods and global variables)

JQuery adapter gives you the jQuery object (useful for simulating

events)

Interaction DSL (on top of WebDriver’s Actions)

Remote browser (since it’s supported by Selenium)

Page 9: Geb+spock: let your functional tests live long and prosper

ReferencesOfficial Spock documentation http://spockframework.github.io/spock/docs/1.0/

Official Geb documentation (awesome!) http://www.gebish.org/manual/current/

Taming Functional Web Testing https://www.youtube.com/watch?v=SNMgf6ndoeU

Tutorial (in spanish) http://www.adictosaltrabajo.com/tutoriales/tests-funcionales-con-spock-y-geb-para-una-aplicacion-spring-boot/

Demo code https://github.com/esloho/functional-testing-with-spock

Page 10: Geb+spock: let your functional tests live long and prosper

@esloho

[email protected]

https://github.com/esloho

Questions?