Skip to content

Commit

Permalink
test: fix flaky snap signature test (#29480)
Browse files Browse the repository at this point in the history
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29480?quickstart=1)

## **Related issues**

Fixes:
[#29380](#29380)

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
  • Loading branch information
pnarayanaswamy authored Jan 9, 2025
1 parent ed0362c commit ec75a8b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/e2e/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ async function clickSignOnSignatureConfirmation({
if (snapSigInsights) {
// there is no condition we can wait for to know the snap is ready,
// so we have to add a small delay as the last alternative to avoid flakiness.
await driver.delay(regularDelayMs);
await driver.delay(largeDelayMs);
}
await driver.waitForSelector(
{ text: 'Sign', tag: 'button' },
Expand Down
14 changes: 12 additions & 2 deletions test/e2e/snaps/test-snap-siginsights.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,13 @@ describe('Test Snap Signature Insights', function () {
// switch back to MetaMask window and switch to tx insights pane
await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog);

await driver.waitForSelector(
'[data-testid="signature-request-scroll-button"]',
);
// click down arrow
await driver.clickElementSafe('.fa-arrow-down');
await driver.clickElementSafe(
'[data-testid="signature-request-scroll-button"]',
);

// wait for and click sign
await clickSignOnSignatureConfirmation({
Expand Down Expand Up @@ -223,7 +228,12 @@ describe('Test Snap Signature Insights', function () {
await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog);

// click down arrow
await driver.clickElementSafe('.fa-arrow-down');
await driver.waitForSelector(
'[data-testid="signature-request-scroll-button"]',
);
await driver.clickElementSafe(
'[data-testid="signature-request-scroll-button"]',
);

// wait for and click sign
await clickSignOnSignatureConfirmation({
Expand Down

0 comments on commit ec75a8b

Please sign in to comment.