Can we run specific Spec (Flow) on 2 different urls?

25 views
Skip to first unread message

Pooja Kurbetti

unread,
Feb 21, 2017, 1:39:05 AM2/21/17
to Geb User Mailing List
We have specific flow which has to run on 2 different urls.

Say book a flight which has same ui components (assuming) Emirates and Lufthansa sites

Its the same test flow.

Is there any way we can do that?

TestFlow_Spec on 


Or is there any way we could call the same spec again in another spec to do the same?

Thanks,
Pooja

Marcin Erdmann

unread,
Feb 21, 2017, 6:16:25 AM2/21/17
to geb-...@googlegroups.com
You could unroll each of the features in that spec with one iteration for Lufthansa's url and another for Emirates' and set Browser's baseUrl property as the first step, i.e.

@Unroll
def "first feature for #scenario"() {
    given:
    browser.baseUrl = testedUrl

    ...

    where:
    scenario      | testedUrl
    "Lufthansa" | "http://example.com"
    ....
}



--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/48cffb0e-380e-4123-a842-cebeba89917f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages