Hard wait setting

32 views
Skip to first unread message

Ben Frey

unread,
Oct 9, 2019, 3:53:46 PM10/9/19
to Geb User Mailing List
We have a React page that loads, then an interstitial is displayed over it. For whatever reason the interstitial isn't shown right away, so Geb can interact with the page beforehand. Once the interstitial is gone, anything that Geb has set has been reset. Is there any way to tell Geb "wait for x seconds always"?

Jeremy Cattau

unread,
Oct 9, 2019, 4:04:54 PM10/9/19
to geb-...@googlegroups.com
Does sleep() not do what you are asking?

On Wed, Oct 9, 2019, 2:53 PM Ben Frey <sparta...@gmail.com> wrote:
We have a React page that loads, then an interstitial is displayed over it. For whatever reason the interstitial isn't shown right away, so Geb can interact with the page beforehand. Once the interstitial is gone, anything that Geb has set has been reset. Is there any way to tell Geb "wait for x seconds always"?

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/d97c57ff-88a3-4949-942b-b64fbc20cff5%40googlegroups.com.

Ben Frey

unread,
Oct 9, 2019, 4:09:26 PM10/9/19
to Geb User Mailing List
Yup, it sure will. Sometimes one forgets stuff built into the language :)


On Wednesday, October 9, 2019 at 3:04:54 PM UTC-5, jc wrote:
Does sleep() not do what you are asking?

On Wed, Oct 9, 2019, 2:53 PM Ben Frey <sparta...@gmail.com> wrote:
We have a React page that loads, then an interstitial is displayed over it. For whatever reason the interstitial isn't shown right away, so Geb can interact with the page beforehand. Once the interstitial is gone, anything that Geb has set has been reset. Is there any way to tell Geb "wait for x seconds always"?

--
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-...@googlegroups.com.

Jeremy Cattau

unread,
Oct 9, 2019, 4:23:06 PM10/9/19
to geb-...@googlegroups.com
I would recommend against hard waits if at all possible.  Is there action that needs to be taken to remove the modal or whatever pops up?  If it takes about 3 second to show an another 3 seconds to go away on its own you could just say to fluently wait for the element and the fluently wait for not the element....just an idea 

To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/0cc1a414-c42b-4e56-9bfd-6c5a9e4b9cfa%40googlegroups.com.

Ben Frey

unread,
Oct 9, 2019, 4:36:44 PM10/9/19
to Geb User Mailing List
Yeah, it just goes away on its own. I'm pretty sure I can wait for the interstitial to appear with
waitFor {$(css-class)}

but how do I wait for something to disappear?


On Wednesday, October 9, 2019 at 3:23:06 PM UTC-5, jc wrote:
I would recommend against hard waits if at all possible.  Is there action that needs to be taken to remove the modal or whatever pops up?  If it takes about 3 second to show an another 3 seconds to go away on its own you could just say to fluently wait for the element and the fluently wait for not the element....just an idea 

On Wed, Oct 9, 2019, 3:09 PM Ben Frey <sparta...@gmail.com> wrote:
Yup, it sure will. Sometimes one forgets stuff built into the language :)

On Wednesday, October 9, 2019 at 3:04:54 PM UTC-5, jc wrote:
Does sleep() not do what you are asking?

On Wed, Oct 9, 2019, 2:53 PM Ben Frey <sparta...@gmail.com> wrote:
We have a React page that loads, then an interstitial is displayed over it. For whatever reason the interstitial isn't shown right away, so Geb can interact with the page beforehand. Once the interstitial is gone, anything that Geb has set has been reset. Is there any way to tell Geb "wait for x seconds always"?

--
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-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/d97c57ff-88a3-4949-942b-b64fbc20cff5%40googlegroups.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-...@googlegroups.com.

Jeremy Cattau

unread,
Oct 9, 2019, 4:38:33 PM10/9/19
to geb-...@googlegroups.com
waitFor {!$(css-class)}


To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/d052663a-fa62-41da-ab7a-e3999ada2af0%40googlegroups.com.

Ben Frey

unread,
Oct 9, 2019, 4:58:08 PM10/9/19
to Geb User Mailing List
Worked like a charm, thanks!
waitFor {!$(css-class)}


Martin de laat

unread,
Oct 10, 2019, 2:24:50 AM10/10/19
to Geb User Mailing List
If you made a gebmodule foo out of the component, you could use waitFor { !foo.displayed }

Problem is, assuming things are dynamically loaded, when declaring this foo module, you don't want to have the option: waitFor set to true, as it will wait then for your max waiting time inside the waitFor statement and it'll yime out and not behave like you would expect.

To address this we use a foo with waiting enabled, and a fooNoWait with waiting disabled. If someone has a better idea Im all ears.

Reply all
Reply to author
Forward
0 new messages