Skip to content

fix(tests): unskip lock alerts and harden en.json E2E selection - #33857

Merged
cmd-ob merged 4 commits into
mainfrom
fix/unskip-lock-alert-appium-tests
Jul 27, 2026
Merged

fix(tests): unskip lock alerts and harden en.json E2E selection#33857
cmd-ob merged 4 commits into
mainfrom
fix/unskip-lock-alert-appium-tests

Conversation

@cmd-ob

@cmd-ob cmd-ob commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Description

Restores Appium smoke coverage for lock/unlock and reset-wallet flows that were skipped in #33687 after #26285 changed drawer.lock_ok / lock_cancel from YES/NO to Yes/No.

Android Material AlertDialog still renders YES/NO via textAllCaps, so case-sensitive text selectors reading en.json failed to find the confirm button. This PR switches the lock confirm locator to case-insensitive exact text/label matching on both platforms, and passes an explicit buttonLabel on the iOS mobile: alert path.

Also adds Smart E2E hard rule en-locale-change so changes to locales/languages/en.json force all E2E tags (and prompt guidance that locale copy is not cosmetic), preventing another #26285-style “no tests recommended” miss.

Changelog

CHANGELOG entry: null

Related issues

Refs: https://consensyssoftware.atlassian.net/browse/MMQA-2086

Manual testing steps

Feature: Lock alert confirmation after sentence-case locale

  Scenario: Appium smoke lock/unlock after Google onboarding
    Given a main-e2e build with this branch
    And Appium smoke is configured for Android or iOS
    When the Google login lock/unlock smoke spec runs
    Then the lock confirm alert is accepted via case-insensitive Yes/YES text matching
    And the app reaches the login screen and unlocks successfully

  Scenario: Smart E2E selection for en.json-only PRs
    Given a PR that only changes locales/languages/en.json
    When Smart E2E selection runs
    Then hard rule en-locale-change selects all E2E tags

Unit coverage already added for the hard rule:
yarn jest tests/tools/e2e-ai-analyzer/modes/select-tags/select-tags-hard-rules.test.ts

Screenshots/Recordings

N/A — test and Smart E2E selection infra only; no user-facing UI change.

Before

N/A

After

N/A

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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.

Note

Low Risk
Test-only and Smart E2E selection changes; no production app logic. Slightly increases CI E2E scope for en.json PRs by design.

Overview
Fixes Appium lock/unlock and reset-wallet smoke tests that broke when locale copy moved alert buttons to sentence case while Android still shows YES via textAllCaps.

Lock alert matching: SettingsView’s confirm control now uses a case-insensitive exact regex on both Detox and Appium. PlaywrightMatchers prefixes (?i) on regex text locators when the RegExp has ignoreCase. iOS confirmLockAlert accepts the alert with the actual button label from getButtons instead of a generic accept.

Coverage restored: Three previously skipped Appium specs (Google lock/unlock, reset wallet, account-activity resubscribe after lock) run again.

Smart E2E: New hard rule en-locale-change runs all E2E tags when locales/languages/en.json changes; prompt text clarifies locale/copy edits are not “cosmetic” for tag selection.

Reviewed by Cursor Bugbot for commit 089a0e6. Bugbot is set up for automated code reviews on this repo. Configure here.

@cmd-ob
cmd-ob requested a review from a team as a code owner July 27, 2026 14:42
@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@github-actions github-actions Bot added the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label Jul 27, 2026
@metamask-ci metamask-ci Bot added team-qa QA team INVALID-PR-TEMPLATE PR's body doesn't match template labels Jul 27, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3e1c4db. Configure here.

Comment thread tests/page-objects/Settings/SettingsView.ts Outdated
@github-actions github-actions Bot added the risk:medium AI analysis: medium risk label Jul 27, 2026
@metamask-ci metamask-ci Bot removed the INVALID-PR-TEMPLATE PR's body doesn't match template label Jul 27, 2026
@github-actions github-actions Bot added risk:high AI analysis: high risk and removed risk:medium AI analysis: medium risk labels Jul 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🧪 Flaky unit test detection

Run history flaky detection

View recent run history

Historical failure rate is a hint, not proof — review each suggestion in context. See the flaky-test-detection skill for the full pattern reference and manual audit workflow.

Failures / runs sampled per window:

File 7d 15d 30d
tests/tools/e2e-ai-analyzer/modes/select-tags/select-tags-hard-rules.test.ts 0/172 0/296 0/296

AI-detected flaky patterns

tests/tools/e2e-ai-analyzer/modes/select-tags/select-tags-hard-rules.test.ts

  • J7 — Non-deterministic data (medium)
    • process.cwd() is evaluated once at module load time and its value depends entirely on the working directory of the Jest process at the moment the module is imported. This can differ between local development, CI runners, Docker containers, and monorepo setups where Jest may be invoked from different root directories. Any test that passes BASE_DIR into checkHardRules() and then makes assertions about the result (e.g. result?.selectedTags, result?.reasoning) could behave differently across environments if checkHardRules uses the base directory to resolve file paths or perform filesystem lookups — making the test non-deterministic. Pinning BASE_DIR to a known, stable path (e.g. the repo root relative to __dirname, or a fixed mock string) removes the environmental dependency.
    • Suggested fix in tests/tools/e2e-ai-analyzer/modes/select-tags/select-tags-hard-rules.test.ts:4:
      -const BASE_DIR = process.cwd();
      +const BASE_DIR = path.resolve(__dirname, '../../../../../'); // stable repo-root relative to this file
      +// or, if checkHardRules only uses it as an opaque string for path resolution:
      +// const BASE_DIR = '/mock/base/dir';

This check is informational only and does not block merging.

@cmd-ob cmd-ob removed the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label Jul 27, 2026
@github-actions github-actions Bot added risk:low AI analysis: low risk and removed risk:high AI analysis: high risk labels Jul 27, 2026
@cmd-ob cmd-ob added the skip-smart-e2e-selection Skip Smart E2E selection, i.e. select all E2E tests to run label Jul 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - skip-smart-e2e-selection label found

All E2E tests pre-selected.

View GitHub Actions results

@cmd-ob
cmd-ob enabled auto-merge July 27, 2026 16:57
@sonarqubecloud

Copy link
Copy Markdown

@vivek-consensys vivek-consensys left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@cmd-ob
cmd-ob added this pull request to the merge queue Jul 27, 2026
Merged via the queue into main with commit 8b528c9 Jul 27, 2026
386 of 426 checks passed
@cmd-ob
cmd-ob deleted the fix/unskip-lock-alert-appium-tests branch July 27, 2026 17:41
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 27, 2026
@metamask-ci metamask-ci Bot added the release-8.6.0 Issue or pull request that will be included in release 8.6.0 label Jul 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-8.6.0 Issue or pull request that will be included in release 8.6.0 risk:low AI analysis: low risk size-S skip-smart-e2e-selection Skip Smart E2E selection, i.e. select all E2E tests to run team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants