You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of the XCUITest waitFor, waitForExistence, and waitForValueToContain which use the NSPredicate/Expectation strategy are long-running and expensive, taking on average about 1.5s up to 3s to run.
We need to optimize our wait strategy to save time on each wait, of which there are nearly 1000, allowing us to see a test execution performance of 1000 seconds or more.
I'm proposing a simple while-loop, which takes on average about 0.059s to assert an element exists.
The trade-off and risk with this is any strategies that wait or an element container, but then act on an element within the container will result in a race condition, causing some element assertions to fail.
Ultimately, we need to address the use of this strategy to avoid test flakiness in the future, but may, in the short term, see some additional 'flakiness', which is really an opportunity to implement a more stable element wait/assert strategy anyway.
This issue has been automatically marked as stale. Has the issue been fixed, or does it still require the community's attention? Please leave any comment to keep this issue opened. It will be closed automatically if no further update occurs in the next 30 days. Thank you for your contributions!
The current implementation of the XCUITest
waitFor
,waitForExistence
, andwaitForValueToContain
which use theNSPredicate/Expectation
strategy are long-running and expensive, taking on average about1.5s
up to3s
to run.We need to optimize our wait strategy to save time on each
wait
, of which there are nearly 1000, allowing us to see a test execution performance of 1000 seconds or more.I'm proposing a simple
while-loop
, which takes on average about0.059s
to assert an element exists.The trade-off and risk with this is any strategies that wait or an element container, but then act on an element within the container will result in a race condition, causing some element assertions to fail.
Ultimately, we need to address the use of this strategy to avoid test flakiness in the future, but may, in the short term, see some additional 'flakiness', which is really an opportunity to implement a more stable element wait/assert strategy anyway.
┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: