Skip to content

fix: Restore responsive e2e driver option#25932

Merged
HowardBraham merged 4 commits intodevelopfrom
pnf/revert-responsive-e2e-driver-option
Aug 16, 2024
Merged

fix: Restore responsive e2e driver option#25932
HowardBraham merged 4 commits intodevelopfrom
pnf/revert-responsive-e2e-driver-option

Conversation

@pedronfigueiredo
Copy link
Copy Markdown
Contributor

@pedronfigueiredo pedronfigueiredo commented Jul 18, 2024

Description

In #18347, we changed the driver option responsive to openDevToolsForTabs. This was because we had a new test suite that intended to test browser behaviour related to Service Worker restart on manifest v3 builds. Later changes to chrome's mv3 implementation meant that service worker no longer restarted, and those e2e tests no longer exist (test/e2e/mv3/service-worker-restart.spec.js).

However, this change had an unwanted side effect on another test suite (test/e2e/tests/metamask-responsive-ui.spec.js). As @Gudahtt puts it in a slack message:

It looks like in this PR, the responsive option in the Chrome webdriver was replaced with openDevToolsForTabs. This is functionally what that option did, but this doesn't match the semantic purpose for why the browser opened the dev tools.

Browser driver options are shared between the Firefox and Chrome drivers, so now they don't match. The test suite meant to test our UI in a small viewport is now passing in the openDevToolsForTabs option, but this doesn't work for the Firefox browser because it doesn't recognize that option. So the tests are "passing" but they aren't actually running the steps that are meant to be under test.

This PR reverts the option to its original name.

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

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.

@pedronfigueiredo pedronfigueiredo added the team-confirmations Push issues to confirmations team label Jul 18, 2024
@pedronfigueiredo pedronfigueiredo self-assigned this Jul 18, 2024
@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.

@pedronfigueiredo pedronfigueiredo marked this pull request as ready for review July 18, 2024 08:44
@pedronfigueiredo pedronfigueiredo requested a review from a team as a code owner July 18, 2024 08:44
@pedronfigueiredo pedronfigueiredo changed the title fix: Revert e2e driver option fix: Restore responsive e2e driver option Jul 18, 2024
@pedronfigueiredo pedronfigueiredo force-pushed the pnf/revert-responsive-e2e-driver-option branch from a5abc63 to ef39d0d Compare July 18, 2024 09:12
DDDDDanica
DDDDDanica previously approved these changes Jul 18, 2024
@DDDDDanica
Copy link
Copy Markdown
Contributor

LGTm !

@pedronfigueiredo pedronfigueiredo force-pushed the pnf/revert-responsive-e2e-driver-option branch from ef39d0d to f860a3f Compare July 18, 2024 11:55
@pedronfigueiredo pedronfigueiredo force-pushed the pnf/revert-responsive-e2e-driver-option branch 4 times, most recently from 49c50e4 to 6907ab6 Compare July 18, 2024 14:33
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.17%. Comparing base (7916145) to head (ef00684).
Report is 5 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #25932   +/-   ##
========================================
  Coverage    70.17%   70.17%           
========================================
  Files         1423     1423           
  Lines        49844    49844           
  Branches     13851    13851           
========================================
  Hits         34975    34975           
  Misses       14869    14869           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

@micaelae @BZahory I noticed that this option was added in #25044

Could you clarify what this option was used for? I am wondering whether responsive or openDevToolsForTabs is what you want here, or whether this is needed at all.

And the same question foes for the usage in test/e2e/tests/swap-send/swap-send-test-utils.ts (added here: #23703)

Gudahtt
Gudahtt previously approved these changes Jul 18, 2024
Copy link
Copy Markdown
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM! Just one non-blocking question (we can adjust this option in those test suites later if we need to)

@pedronfigueiredo pedronfigueiredo force-pushed the pnf/revert-responsive-e2e-driver-option branch from 6907ab6 to cd9a318 Compare July 19, 2024 08:50
DDDDDanica
DDDDDanica previously approved these changes Jul 19, 2024
@pedronfigueiredo pedronfigueiredo force-pushed the pnf/revert-responsive-e2e-driver-option branch 4 times, most recently from 1146e27 to f5506c5 Compare July 22, 2024 09:32
@zone-live zone-live dismissed stale reviews from DDDDDanica and Gudahtt via 5715ce8 July 23, 2024 08:56
Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Reverted the responsive e2e driver option to address issues with Firefox compatibility and ensure correct test execution for responsive UI.

  • test/e2e/tests/account/metamask-responsive-ui.spec.js: Reverted openDevToolsForTabs to responsive to fix Firefox test execution.
  • test/e2e/tests/bridge/bridge-test-utils.ts: Updated driverOptions to revert to responsive, ensuring correct semantic purpose.
  • test/e2e/tests/swap-send/swap-send-test-utils.ts: Reverted driverOptions to responsive for proper responsive UI testing.
  • test/e2e/webdriver/chrome.js: Reintroduced responsive option to force smaller viewport for UI tests.
  • test/e2e/webdriver/index.js: Re-added responsive option to buildWebDriver function for correct test simulation.

5 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@pedronfigueiredo pedronfigueiredo force-pushed the pnf/revert-responsive-e2e-driver-option branch from 5715ce8 to 4b72b3c Compare July 23, 2024 11:32
Gudahtt
Gudahtt previously approved these changes Aug 12, 2024
@pedronfigueiredo pedronfigueiredo force-pushed the pnf/revert-responsive-e2e-driver-option branch 7 times, most recently from 1627f5d to d740d79 Compare August 14, 2024 10:38
@pedronfigueiredo pedronfigueiredo dismissed stale reviews from DDDDDanica and Gudahtt via 28e1ba1 August 15, 2024 13:29
@pedronfigueiredo pedronfigueiredo force-pushed the pnf/revert-responsive-e2e-driver-option branch from d740d79 to 28e1ba1 Compare August 15, 2024 13:29
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [28e1ba1]
Page Load Metrics (251 ± 241 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint86155117199
domContentLoaded125837136
load501778251503241
domInteractive125837136
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@pedronfigueiredo pedronfigueiredo force-pushed the pnf/revert-responsive-e2e-driver-option branch from 28e1ba1 to d8d79fe Compare August 15, 2024 15:31
@pedronfigueiredo pedronfigueiredo force-pushed the pnf/revert-responsive-e2e-driver-option branch from d8d79fe to 253f6c3 Compare August 16, 2024 10:37
@pedronfigueiredo pedronfigueiredo force-pushed the pnf/revert-responsive-e2e-driver-option branch from 253f6c3 to ef00684 Compare August 16, 2024 15:45
@sonarqubecloud
Copy link
Copy Markdown

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [ef00684]
Page Load Metrics (162 ± 190 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint752621064019
domContentLoaded127527178
load461878162395190
domInteractive127527178
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [ef00684]
Page Load Metrics (172 ± 232 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint65203973115
domContentLoaded97322157
load392281172484232
domInteractive97322157
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@HowardBraham HowardBraham merged commit 0562f18 into develop Aug 16, 2024
@HowardBraham HowardBraham deleted the pnf/revert-responsive-e2e-driver-option branch August 16, 2024 20:36
@github-actions github-actions bot locked and limited conversation to collaborators Aug 16, 2024
@metamaskbot metamaskbot added the release-12.5.0 Issue or pull request that will be included in release 12.5.0 label Aug 16, 2024
@gauthierpetetin gauthierpetetin added release-12.4.0 Issue or pull request that will be included in release 12.4.0 and removed release-12.5.0 Issue or pull request that will be included in release 12.5.0 labels Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-12.4.0 Issue or pull request that will be included in release 12.4.0 team-confirmations Push issues to confirmations team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants