I'm new in the area of software developing, and want to extend my knowledge over automation testing. I read a lot for Geb and Spock testing frameworks, but did not come to the conclusion for what purpose are they.
Am I correct:
Geb is for Page Objects (static covering the UI pages selectors, elements, etc.)
Spock is for writing the test order (Cases/Steps for test) (also is able to run API tests as well, mock data, parameterised endpoints, values and etc.)
--> What other differences they have? I already checked both documentations, but cannot understand.
I will appreciate every practical advice or example, differences between both as well, because I covered a lot of things, but there are only theoretical examples, but the main catch I did not get it.
Thank you in advance!
Geb is a browser/web automation solution. You can use it to test the functionality of your web pages. Geb can automatically launch a web page, fill out form fields and click buttons on a web page. From the official website:
"It can be used for scripting, scraping and general automation — or equally as a functional/web/acceptance testing solution via integration with testing frameworks such as Spock, JUnit & TestNG."
The catch for Geb is web automation.
The catch for Spock is that it is testing and specification framework.
Examples
You can Geb to check the following:
When one opens mywebsite.com/login and enters a wrong username or password an error message should be displayed, say in a div.
When one opens mywebsite.com/submitData, fills in item name and price and clicks on the submit button, expect a message to show like "Thank you, the total number of items is now 5"