test: Fix flakiness caused by the notification permission dialog which caused confirmation test flakiness #9610
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
The purpose of this PR is to address sporadic test flakiness within the confirmations workflow. The test, at times, would timeout because it was unable to log into the app. Sometimes, this would result in long-running confirmation e2e workflows in Bitrise.
What caused the failure?
The approve-custom-erc20.spec.js and approve-default-erc20.spec.js tests assert that the submitted the txn is confirmed before making the test as passed.
The notification dialog appears whenever a successful transaction is made. See below
Unfortunately, the system dialog lingers on the simulator.
Whenever new tests run on the simulator, the system dialog prevents the tests from moving forward. See the below screenshot:
Solution
The solution is to set the notifications permission to true. This will prevent the notification dialog from appearing within the tests. Detox's api allows us to set this permission whenever we launch the app for testing. For the curious minds, please read up more here.
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist