I may have worked around the problem.
When I modify MySpec to:
class MySpec extends GebReportingSpec {
 @Shared 
 Index index

    def setupSpec() {
        to LoginPage
        login username, password
        at Index // make sure Index is fully-loaded before continuing
    }


    def setup() {
    if (!isAt(Index))
        index = to Index // begin each test method at Index
    }
}

test runs smoothly. 

Seems the page hangs when the client delivers a request (the one from 
setup()), before the the login() result page finishes loading.

Sorry for the noise,


On Tuesday, September 12, 2017 at 1:34:28 AM UTC+10, Marcin Erdmann wrote:
>
> 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] 
> <javascript:>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> 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/ca4f4265-b136-4a91-ac2e-993ceae64412%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to