The website on which I want to test has a landing page asking you to select a language. You can skip this question by adding an extra parameter to the URL. I want to test this behavior using Geband Spockas a testing environment.
So, I have a landing page with a choice of language:
class LanguageSelectionPage extends Page {
static url = "http://localhost:8080/registration/"
static at = { $("form#languageForm") }
}
The second page to which it redirects:
class InsertCardReaderPage extends Page {
static at = { welcomeTitle1 }
static content = {
welcomeTitle1(wait: true, cache: false) { $("#eidWelcomeTitle1") }
welcomeTitle2(wait: true, cache: false) { $("#eidWelcomeTitle2") }
}
}
(I removed some methods from the inserted code)
So this is my test:
given:
to LanguageSelectionPage, "09";
expect:
at InsertCardReaderPage;
"09" URL-, , ( http, ) InsertCardReaderPage. , to at. , .
? ? Geb , , , .