From 47fdbe4e5ba86a2d2ff408369a4d5025ff0def04 Mon Sep 17 00:00:00 2001 From: Priya Date: Tue, 7 Jan 2025 09:12:54 +0100 Subject: [PATCH] chore: Fix flaky snap signature insights tests (#29437) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** The sign button is sometimes not enabled after the delay, just added a better waiting condition to wait for the button to be enabled [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29437?quickstart=1) ## **Related issues** Fixes: [#29227](https://github.com/MetaMask/metamask-extension/issues/29227) ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** ### **Before** ### **After** ## **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. --- test/e2e/helpers.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/e2e/helpers.js b/test/e2e/helpers.js index 3b69d55fc122..24240d6f609a 100644 --- a/test/e2e/helpers.js +++ b/test/e2e/helpers.js @@ -724,7 +724,10 @@ async function clickSignOnSignatureConfirmation({ // so we have to add a small delay as the last alternative to avoid flakiness. await driver.delay(regularDelayMs); } - + await driver.waitForSelector( + { text: 'Sign', tag: 'button' }, + { state: 'enabled' }, + ); await driver.clickElement({ text: 'Sign', tag: 'button' }); }