Skip to content

Commit

Permalink
test: Remove delays from onboarding tests (#27961)
Browse files Browse the repository at this point in the history
## **Description**

.delay() calls were errantly left in the onboarding tests. Apologies to
@seaona for not having addressed these sooner!


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

## **Related issues**

Fixes:

## **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/develop/.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/develop/.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
darkwing authored Oct 18, 2024
1 parent e8bc6a5 commit a9df78b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
8 changes: 0 additions & 8 deletions test/e2e/tests/onboarding/onboarding.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ const {
onboardingCompleteWalletCreation,
regularDelayMs,
unlockWallet,
tinyDelayMs,
largeDelayMs,
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');
const {
Expand Down Expand Up @@ -287,7 +285,6 @@ describe('MetaMask onboarding @no-mmi', function () {
await driver.clickElement({
text: 'General',
});
await driver.delay(largeDelayMs);
await driver.clickElement({ text: 'Add a network' });

await driver.waitForSelector(
Expand All @@ -311,9 +308,7 @@ describe('MetaMask onboarding @no-mmi', function () {
const rpcUrlInputDropDown = await driver.waitForSelector(
'[data-testid="test-add-rpc-drop-down"]',
);
await driver.delay(tinyDelayMs);
await rpcUrlInputDropDown.click();
await driver.delay(tinyDelayMs);
await driver.clickElement({
text: 'Add RPC URL',
tag: 'button',
Expand Down Expand Up @@ -371,7 +366,6 @@ describe('MetaMask onboarding @no-mmi', function () {
await driver.clickElement(
`[data-rbd-draggable-id="${toHex(chainId)}"]`,
);
await driver.delay(largeDelayMs);
// Check localhost 8546 is selected and its balance value is correct
await driver.findElement({
css: '[data-testid="network-display"]',
Expand Down Expand Up @@ -530,8 +524,6 @@ describe('MetaMask onboarding @no-mmi', function () {
// pin extension walkthrough screen
await driver.clickElement('[data-testid="pin-extension-next"]');

await driver.delay(regularDelayMs);

for (let i = 0; i < mockedEndpoints.length; i += 1) {
const mockedEndpoint = await mockedEndpoints[i];
const isPending = await mockedEndpoint.isPending();
Expand Down
21 changes: 10 additions & 11 deletions test/e2e/tests/privacy/basic-functionality.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ const {
withFixtures,
importSRPOnboardingFlow,
WALLET_PASSWORD,
tinyDelayMs,
regularDelayMs,
largeDelayMs,
defaultGanacheOptions,
} = require('../../helpers');
const { METAMASK_STALELIST_URL } = require('../phishing-controller/helpers');
Expand Down Expand Up @@ -65,18 +62,14 @@ describe('MetaMask onboarding @no-mmi', function () {
});
await driver.clickElement('[data-testid="category-item-General"]');

await driver.delay(regularDelayMs);

await driver.clickElement(
'[data-testid="basic-functionality-toggle"] .toggle-button',
);

await driver.clickElement('[id="basic-configuration-checkbox"]');
await driver.clickElement({ text: 'Turn off', tag: 'button' });
await driver.clickElement('[data-testid="category-back-button"]');
await driver.delay(regularDelayMs);
await driver.clickElement('[data-testid="category-item-Assets"]');
await driver.delay(regularDelayMs);
await driver.clickElement(
'[data-testid="currency-rate-check-toggle"] .toggle-button',
);
Expand Down Expand Up @@ -114,7 +107,6 @@ describe('MetaMask onboarding @no-mmi', function () {
await driver.clickElement('[data-testid="network-display"]');

await driver.clickElement({ text: 'Ethereum Mainnet', tag: 'p' });
await driver.delay(tinyDelayMs);

// Wait until network is fully switched and refresh tokens before asserting to mitigate flakiness
await driver.assertElementNotPresent('.loading-overlay');
Expand Down Expand Up @@ -154,13 +146,20 @@ describe('MetaMask onboarding @no-mmi', function () {
tag: 'button',
});
await driver.clickElement('[data-testid="category-item-General"]');
await driver.delay(largeDelayMs);
// Wait until the onboarding carousel has stopped moving
// otherwise the click has no effect.
await driver.waitForElementToStopMoving(
'[data-testid="category-back-button"]',
);
await driver.clickElement('[data-testid="category-back-button"]');
await driver.delay(largeDelayMs);
// Wait until the onboarding carousel has stopped moving
// otherwise the click has no effect.
await driver.waitForElementToStopMoving(
'[data-testid="privacy-settings-back-button"]',
);
await driver.clickElement(
'[data-testid="privacy-settings-back-button"]',
);
await driver.delay(largeDelayMs);
await driver.clickElement({ text: 'Done', tag: 'button' });
await driver.clickElement('[data-testid="pin-extension-next"]');
await driver.clickElement({ text: 'Done', tag: 'button' });
Expand Down

0 comments on commit a9df78b

Please sign in to comment.