Nested Spreewald patiently blocks are now patient
In Spreewald 1.10.4+, nested
patiently blocks are now patient.
Here is an example:
patiently do outer_code patiently do inner_code end end
On spreewald 1.11.2+ the inner block will wait for the full configured wait time (by default 5 seconds). The outer
patiently block would now be out of time, but it will always be retried at least a second time. This behavior allows
with_scope to be patient, and it must be patient, as explained below.
In versions 1.10.4 - 1.11.1, inner blocks would keep giving the outer block additional time to finish, which solves the same issues, but as a downside can cause the whole step to take extremely long if it was actually supposed to fail.
In even earlier versions of Spreewald the outer
patiently would wait for 5 seconds and all inner
patientlys would not wait at all.
Since 90% of the time you will have nested
patiently block is when using
... within ...), here is some information about this issue:
patiently will sometimes break:
Unfortunately we cannot fix this by making sure that the element exists before we enter
The only way to make this work is wrap it in
patiently do with_scope('.container') do page.find('.child') end end
This used to be an issue with how nested patiently blocks worked in the past.
In Spreewald 1.10.4+ the
... within ... step is patient again.