No it wouldn't, but that statement would take your standard waiting timeout
time to complete right?
Unless you specify
button1{wait:false}
so you end up with
button1{wait: true}
button1_no_wait{wait: false}
or something similar if you also want to use button1 for anything that
requires waiting
Or am I missing something?
On Monday, May 6, 2019 at 1:57:43 PM UTC+2, Alexander Kriegisch wrote:
>
> Would it be asking too much to write
>
> button1.displayed && !button2.displayed
> --
> Alexander Kriegisch
>
>
> -------- Ursprüngliche Nachricht --------
> Von: [email protected] <javascript:>
> Datum: 06.05.19 18:26 (GMT+07:00)
> An: Geb User Mailing List <[email protected] <javascript:>>
> Betreff: [geb-user] Verifying some elements are not displayed
>
> Hi all,
>
> I'm wondering how other people deal with the following scenario / what the
> best way for it is in Geb.
> Perhaps there exists some functionality already that I don't know of,
> perhaps more people run into this issue and we can add some functionality
> to geb.
>
> tldr: how do you optimally deal with* !element_x.displayed* cases.
>> Especially when you prefer a wait:true for every action other than
>> !displayed on that element/content
>
>
> Sample scenario
> - I have a button
> - For some tests I want to click that button, in general, it's nice to
> define 'wait: true' so that it waits for that button to appear before
> pressing it.
> (because I won't want to describe everything in my POM or because the
> button is dynamically loaded)
> - For some tests, I want to make sure that button is not displayed
>
> Problem:
> - I don't want to wait the full default timeout duration to assess that
> the button in fact, did not show up. But I also don't want to put an
> arbitrary '2 seconds' on it either, it's also too slow and maybe on some CI
> tooling it can actually take those 2 seconds to load causing tests that
> randomly succeed or fail
> - I want to make the tests as fast as possible. To do this, generally, I
> wait for some other element that should be displayed at the same time as
> the element in question, then I usually do: !*element_x.displayed *with
> wait time 0.
> But: I don't want to define that (geb) content twice, once with wait:
> true, once with wait: false (or wait: 2)
>
>
> Possible solutions I've thought of:
> - Would be nice to be able to manually specify a specific wait time inside
> the tests when using a geb module's content.
> So f.e.: for that element, when declaring it in its geb module's content,
> the (default) wait time is set to true. But when calling that content from
> inside the test, I can set a specific wait time of 0
>
> - Instead of 'wait: true', I could f.e. mention an other piece of content
> as an element to wait for (instead of a time duration). I can do this when
> I know that an element is loaded at the same time as that other piece of
> content.
>
> Example: Let's say I have button1 and button2, they're both dynamically
> loaded at the same time but button 2 should only display when the user
> .f.e. has admin rights, then I can link button2's 'waiting time' to button1.
> When I do f.e. in my test: *!button2.displayed* it can automatically
> wait for button1 to appear, then it can verify whether button2 is displayed
> as well, and, if not, automatically throw an exception
>
> --
> 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/a219b54d-6feb-449f-b75a-ae07e5b7f7fa%40googlegroups.com
>
> <https://groups.google.com/d/msgid/geb-user/a219b54d-6feb-449f-b75a-ae07e5b7f7fa%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/7da8d5e3-9845-4d7e-bbea-ed816db54e92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.