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: Refactor EditAccountNameView for E2E tests #11765

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@ on:
types: [checks_requested]

jobs:
add-smoke-label:
runs-on: ubuntu-latest
steps:
- name: Apply "Run Smoke E2E" label
run: |
curl -X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
-d '{"labels":["Run Smoke E2E"]}'
# run-e2e-check:
# uses: metamask/github-tools/github/workflows/run-bitrise-e2e-check.yml
# with:
# E2E_LABEL: 'Run Smoke E2E'
# E2E_PIPELINE: 'pr_smoke_e2e_pipeline'
# secrets:
# BITRISE_BUILD_TRIGGER_TOKEN: ${{ secrets.BITRISE_BUILD_TRIGGER_TOKEN }}
# BITRISE_APP_ID: ${{ secrets.BITRISE_APP_ID }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

check-diff:
runs-on: macos-latest
steps:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/run-bitrise-e2e-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
types: [edited, deleted]
pull_request:
types: [opened, reopened, labeled, unlabeled, synchronize]

env:
E2E_LABEL: 'Run Smoke E2E'
E2E_PIPELINE: 'pr_smoke_e2e_pipeline'
Expand Down Expand Up @@ -56,4 +55,4 @@ jobs:
# The status check created under this workflow may be bucketed under another check suite in Github actions. This is a result of workflows with the same triggers.
# For example, the status check may show as `CLA Signature Bot / Bitrise E2E Status`. This is a bug on Github's UI. https://github.com/orgs/community/discussions/24616
run: yarn run run-bitrise-e2e-check
working-directory: '.github/scripts'
working-directory: '.github/scripts'
24 changes: 13 additions & 11 deletions e2e/pages/EditAccountNameView.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@ import Matchers from '../utils/Matchers';
import Gestures from '../utils/Gestures';
import EditAccountNameSelectorIDs from '../selectors/EditAccountName.selectors';

export default class EditAccountNameView {
static async saveButton() {
return await Matchers.getElementByID(
EditAccountNameSelectorIDs.EDIT_ACCOUNT_NAME_SAVE,
);
class EditAccountNameView {
get saveButton() {
return Matchers.getElementByID(EditAccountNameSelectorIDs.EDIT_ACCOUNT_NAME_SAVE);
}

static async tapSave() {
await Gestures.waitAndTap(this.saveButton());
async tapSave() {
await Gestures.waitAndTap(this.saveButton);
}

static async accountNameInput() {
return await Matchers.getElementByID(
EditAccountNameSelectorIDs.ACCOUNT_NAME_INPUT,
);
get accountNameInput() {
return Matchers.getElementByID(EditAccountNameSelectorIDs.ACCOUNT_NAME_INPUT);
}

async typeAccountName(name) {
await Gestures.typeText(this.accountNameInput, name);
}
}

export default new EditAccountNameView();
2 changes: 1 addition & 1 deletion e2e/specs/accounts/change-account-name.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe(Regression('Change Account Name'), () => {
// Open account actions and edit account name
await WalletView.tapMainWalletAccountActions();
await AccountActionsModal.tapEditAccount();
await Gestures.clearField(EditAccountNameView.accountNameInput());
await Gestures.clearField(EditAccountNameView.accountNameInput);
await TestHelpers.typeTextAndHideKeyboard(
EditAccountNameSelectorIDs.ACCOUNT_NAME_INPUT,
NEW_ACCOUNT_NAME,
Expand Down
Loading