Geb+spock: let your functional tests live long and prosper
-
Upload
esther-lozano -
Category
Software
-
view
404 -
download
0
Transcript of Geb+spock: let your functional tests live long and prosper
![Page 1: Geb+spock: let your functional tests live long and prosper](https://reader035.fdocuments.us/reader035/viewer/2022081517/588535b01a28ab26518b5d77/html5/thumbnails/1.jpg)
Geb+Spock: let your functional tests live long and prosper
Esther Lozano@esloh
o
![Page 3: Geb+spock: let your functional tests live long and prosper](https://reader035.fdocuments.us/reader035/viewer/2022081517/588535b01a28ab26518b5d77/html5/thumbnails/3.jpg)
Functional tests
![Page 4: Geb+spock: let your functional tests live long and prosper](https://reader035.fdocuments.us/reader035/viewer/2022081517/588535b01a28ab26518b5d77/html5/thumbnails/4.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022081517/588535b01a28ab26518b5d77/html5/thumbnails/5.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022081517/588535b01a28ab26518b5d77/html5/thumbnails/6.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022081517/588535b01a28ab26518b5d77/html5/thumbnails/7.jpg)
Demo time!
![Page 8: Geb+spock: let your functional tests live long and prosper](https://reader035.fdocuments.us/reader035/viewer/2022081517/588535b01a28ab26518b5d77/html5/thumbnails/8.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022081517/588535b01a28ab26518b5d77/html5/thumbnails/9.jpg)
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