I do not understand why if you set MySpec.setup() to call 'to Index', test1
hangs until the test fails, only loading parts of the Index page. I would
expect doing 'to Index' in setup() to resolve your issue. Can you please
explain why only part of your index page is loaded in that case?

On Mon, 11 Sep 2017 at 07:00, Samuel Rossinovic <[email protected]>
wrote:

> The webpage I'm testing has an index page, which is the first page the
> user lands-on, after signing in.
>
> I wish to set Index as an initial page for multiple test methods, so that:
>
>    1. tests can refer to that initial page
>    2. tests don't have to explicitly navigate to that page at the start
>    of the test.
>
>
> So, I tried pulling this impl to a base class:
>
> class MyPage extends Page {//...}
> class Index extends MyPage {//...}
>
> class MySpec extends GebReportingSpec {
>
>  @Shared
>  Index index
>
>     def setupSpec() {
>         to LoginPage
>         login username, password
>     }
>
>     def setup() {
>         index = at Index // begin each test method at Index
>     }
> }
>
> class FooSpec extends MySpec {
>
>  def test1() {
>      //assume we're at Index, pointed-to by index
>      // test..
>  }
>
>
>  def test1() {
>      //assume we're at Index, pointed-to by index
>      // test..
>  }
> }
>
>
> But...
> * When MySpec.setup() calls 'at Index',on test1 is successful (as
> LoginPage.login() will land it on Index), but test2 fails, because test1
> doesn't finish at Index.
> * If I set MySpec.setup() to call 'to Index', test1 hangs until the test
> fails, only loading parts of the Index page (and thus failing Index's at()
> check).
>
> When test1 & test2 call 'at Index'/'to Index' respectively, all's well.
>
> How can I fix my Base spec?
>
> Thanks!
>
>
>
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/geb-user/d0eb5726-7171-41b4-860d-549ba8356202%40googlegroups.com
> <https://groups.google.com/d/msgid/geb-user/d0eb5726-7171-41b4-860d-549ba8356202%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/geb-user/CA%2B52dQT7i-5HyaQsiQ2UR5pJa82GV2So2wO99G_v6uSt0QCUrA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to