Skip to content

Conversation

DDDDDanica
Copy link
Contributor

@DDDDDanica DDDDDanica commented Jan 25, 2024

Description

Following the suggestion divided from this thread to refactor all selectors for modal in e2e tests. They are now referred by data-testid in selector.
More specifically speaking, when the modal has been adapted to new component, a data-testid will be appended directly to <Modal > component and selected; when the component is using deprecated modal component, this data-testid will be appended to as a property passing to FadeModal component

Related issues

Fixes: #22552

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@DDDDDanica DDDDDanica added the team-extension-platform Extension Platform team label Jan 25, 2024
@DDDDDanica DDDDDanica self-assigned this Jan 25, 2024
@DDDDDanica DDDDDanica requested a review from a team as a code owner January 25, 2024 23:45
@github-actions
Copy link
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.

@DDDDDanica DDDDDanica force-pushed the fix/22552 branch 2 times, most recently from ec9557c to cecee6e Compare January 25, 2024 23:47
@DDDDDanica DDDDDanica changed the title fix(22552): refactor modal selector in e2e tests chore(22552): refactor modal selector in e2e tests Jan 26, 2024
@HowardBraham
Copy link
Contributor

You have a few instances of ('[data-testid="account-details-modal"') with unbalanced square brackets

@DDDDDanica DDDDDanica force-pushed the fix/22552 branch 4 times, most recently from e767672 to 27ef82b Compare January 26, 2024 15:28
@DDDDDanica
Copy link
Contributor Author

@HowardBraham Thanks a lot, that's a good catch. 👍🏻

@DDDDDanica DDDDDanica force-pushed the fix/22552 branch 2 times, most recently from 0f896ae to 0ba64b0 Compare January 29, 2024 01:40
@metamaskbot
Copy link
Collaborator

Builds ready [ed5ae09]
Page Load Metrics (835 ± 26 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint93144119136
domContentLoaded10371784
load7089198355426
domInteractive10371784
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: -508 Bytes (-0.01%)
  • common: 0 Bytes (0.00%)

if (e.message.includes('<div class="modal__backdrop">')) {
// Wait for the modal to disappear and try again
await driver.wait(
until.elementIsNotPresent(By.css('.modal__backdrop')),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Similar methodology as #22672, we would wait for modal to be completed removed and then perform clicking actions.

PS: Once we completely migrated modal component, we can remove this await.

Copy link
Contributor

@chloeYue chloeYue left a comment

Choose a reason for hiding this comment

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

LGTM!

@HowardBraham HowardBraham merged commit cd38cdb into develop Jan 30, 2024
@HowardBraham HowardBraham deleted the fix/22552 branch January 30, 2024 00:17
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2024
@metamaskbot metamaskbot added the release-11.11.0 Issue or pull request that will be included in release 11.11.0 label Jan 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-11.11.0 Issue or pull request that will be included in release 11.11.0 team-extension-platform Extension Platform team

Projects

None yet

4 participants