Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test:stablize swaps e2e #11559

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

test:stablize swaps e2e #11559

wants to merge 4 commits into from

Conversation

cortisiko
Copy link
Member

Description

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@@ -34,12 +33,27 @@ class SwapView {
return title;
}

async scrollToBottomOfView(tokenName) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One source of flakiness: The price warning pushes the swaps slider out of the detox view port. This method just scrolls to the bottom of the swaps confirmations view

await Gestures.swipe(token, 'up', 'fast', 0.8);
}
// Function to check if the button is enabled
async isButtonEnabled(element) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second source of flakiness: In some instances, while on the swaps confirmation view, the app is fetching quotes. Because of this, detox sometimes waits until the swipe-to-swap slider is enabled. In some instances, detox times out because the slider is not enabled. This method checks to see if the slider element is enabled.

const delay = 500; // Delay in milliseconds

// Wait until the button is enabled before performing swipe actions
while (!(await this.isButtonEnabled(swapsSliderElement))) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this loops until the slider becomes enabled. Once enabled the test proceeds to the next step

@@ -14,6 +14,7 @@
".*phishing-detection.cx.metamask.io/.*",
".*eth.llamarpc.com/.*",
".*token-api.metaswap.codefi.network/.*",
".*gas.api.cx.metamask.io/networks/*"
".*gas.api.cx.metamask.io/networks/*",
".*rpc.vnet.tenderly.co/.*"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blacklist tenderly endpoints to prevent the app from waiting for requests to complete before proceeding.

Copy link

sonarcloud bot commented Oct 1, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant