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

fix: flaky test Permissions sets permissions and connect to Dapp #27888

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

seaona
Copy link
Contributor

@seaona seaona commented Oct 16, 2024

Description

We proceed switching to the Extension full view without waiting until the dialog is closed.

Open in GitHub Codespaces

Related issues

Fixes: #27890

Manual testing steps

  1. Check ci

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

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.

@seaona seaona self-assigned this Oct 16, 2024
@seaona seaona added flaky tests area-qa Relating to QA work (Quality Assurance) labels Oct 16, 2024
@seaona seaona changed the title fix: flaky test `Permissions sets permissions and connect to Dapp fix: flaky test Permissions sets permissions and connect to Dapp Oct 16, 2024
);
await driver.clickElement({
await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog);
await driver.clickElementAndWaitForWindowToClose({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixes race condition

assert.equal(
(await getAccountsResult.getText()).toLowerCase(),
publicAddress.toLowerCase(),
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not needed, we find the element by its text above

const extension = windowHandles[0];
await driver.switchToWindowWithTitle(
WINDOW_TITLES.Dialog,
windowHandles,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

all this extra logic is not needed. switchToWindowWithTitle already waits for the dialog and switches when its ready

Copy link

sonarcloud bot commented Oct 16, 2024

@seaona seaona marked this pull request as ready for review October 16, 2024 06:49
@seaona seaona requested a review from a team as a code owner October 16, 2024 06:49
@metamaskbot
Copy link
Collaborator

Builds ready [b7ac47b]
Page Load Metrics (2322 ± 125 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint29126832224511245
domContentLoaded173926502274275132
load176026762322261125
domInteractive13121552412
backgroundConnect7276567536
firstReactRender501971103517
getState6215365024
initialActions09121
loadScripts122620381689224107
setupStore12199574521
uiStartup194535552665372179
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

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 ! Thanks for the fix !

@seaona seaona added this pull request to the merge queue Oct 16, 2024
Merged via the queue into develop with commit ec4fb5f Oct 16, 2024
95 checks passed
@seaona seaona deleted the mmi-permissions-dapp branch October 16, 2024 11:30
@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2024
@metamaskbot metamaskbot added the release-12.7.0 Issue or pull request that will be included in release 12.7.0 label Oct 16, 2024
@gauthierpetetin gauthierpetetin added release-12.6.0 Issue or pull request that will be included in release 12.6.0 and removed release-12.7.0 Issue or pull request that will be included in release 12.7.0 labels Oct 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-qa Relating to QA work (Quality Assurance) flaky tests release-12.6.0 Issue or pull request that will be included in release 12.6.0 team-extension-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Fix "Permissions sets permissions and connect to Dapp"
5 participants