fix: flaky test Swap Eth for another Token @no-mmi Completes a Swap between ETH and DAI after changing initial rate
#27022
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This test is fetching the swap quote to the live server, instead of using mocks. This can cause the test to be unstable, if the response takes too long.
The error appears when then the quotes timer is reset and we cannot find the 0:25 element (as we are around 0:46s)
TimeoutError: Waiting for element to be located By(xpath, .//*[./@data-testid = 'countdown-timer__timer-container'][(contains(string(.), '0:25') or contains(string(.), '0:25'))])
.Related issues
Fixes: #27023
Manual testing steps
Screenshots/Recordings
The swap request for quotes is not mocked, taking a non-deterministic time to get a response, hence making the test unstable.
See for example, this case, where the request took almost 3 seconds to resolve:
swap-quote-not-mocked.mp4
Pre-merge author checklist
Pre-merge reviewer checklist