Skip to content

E2e appium token request flow 198#5432

Closed
Andepande wants to merge 3 commits into
mainfrom
e2e-appium-token-request-flow-198
Closed

E2e appium token request flow 198#5432
Andepande wants to merge 3 commits into
mainfrom
e2e-appium-token-request-flow-198

Conversation

@Andepande

Copy link
Copy Markdown
Contributor

Development & PR Process

  1. Follow MetaMask Mobile Coding Standards
  2. Add release-xx label to identify the PR slated for a upcoming release (will be used in release discussion)
  3. Add needs-dev-review label when work is completed
  4. Add needs-qa label when dev review is completed
  5. Add QA Passed label when QA has signed off

Description

Appium test coverage.

Screenshots/Recordings

If applicable, add screenshots and/or recordings to visualize the before and after of your change

Issue

Progresses #???

Checklist

  • There is a related GitHub issue
  • Tests are included if applicable
  • Any added code is fully documented

@Andepande Andepande requested a review from a team as a code owner December 23, 2022 09:33

@cortisiko cortisiko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

left a couple comments! Also, please run detox to ensure nothing broke.

Feature: Request Token
This feature goes through the request token flow

Scenario: Import account and navigate to Request

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We have already have step for this guy.

Given I have imported my wallet

use it instead. But this would mean you would need to update the Given step in the networks.feature file as well.

import SendScreen from '../../features/screen-objects/SendScreen';
import Gestures from '../../features/helpers/Gestures';

Given(/^I import wallet using seed phrase "([^"]*)?"/, async (phrase) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

instead of putting this in a common step. Can you put https://github.com/MetaMask/metamask-mobile/blob/main/wdio/features/step-definitions/start-exploring.js#L11 in there instead?

Then(/^I tap on button with text "([^"]*)?"/, async (text) => {
const timeout = 1000;
await driver.pause(timeout);
await SendScreen.tapOnText(text);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hmmm might need a generic class for this action. I can see confusion when trying to use this step. For example, If I am on the privacy and security page and I tap on "Delete wallet". Having the class as SendScreen would cause confusion when debugging.

await driver.pause(timeout);
await Gestures.tapTextByXpath(button);
// eslint-disable-next-line no-console
console.log('On screen ' + type + ' ' + screen);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

left this in by mistake?

await driver.pause(timeout);
await Gestures.tapTextByXpath(button);
// eslint-disable-next-line no-console
console.log('On screen ' + screen);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

left this in by mistake?

await Gestures.setValueWithoutTap(this.requestAmount, amount);
}

async isTextElementDisplayed(text) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

keep the assertions to the bottom of test actions.

await expect(Selectors.getXpathElementByText(text)).toBeDisplayed();
}

async isTextElementNotDisplayed(text) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

keep the assertions to the bottom of test actions.

import MetaMetricsScreen from '../screen-objects/Onboarding/MetaMetricsScreen.js';
import OnboardingScreen from '../screen-objects/Onboarding/OnboardingScreen.js';
import WelcomeScreen from '../screen-objects/Onboarding/OnboardingCarousel.js';
import OnboardingWizardModal from '../screen-objects/Modals/OnboardingWizardModal.js';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

small nitpicking. Can you put the imports together? For example, all imports that come from the Modals folder should be together, all imports that come from the screens folder should be together.

import { isTestNet } from '../../../util/networks';
import { isTokenDetectionSupportedForNetwork } from '@metamask/controllers/dist/util';
import generateTestId from '../../../../wdio/utils/generateTestId';
import {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

since you adding constants for the testID strings, can you have detox import the testID's from the constants file as well? I am speaking about https://github.com/MetaMask/metamask-mobile/blob/main/e2e/pages/RequestPaymentView.js#L3

@@ -0,0 +1,9 @@
// eslint-disable-next-line import/prefer-default-export

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In this file name, the I in testids should be uppercase.

@Andepande Andepande self-assigned this Jan 23, 2023
@Andepande Andepande closed this Jan 31, 2023
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants