Skip to content

feat: added e2e tests for connections page#24161

Merged
NidhiKJha merged 6 commits intodevelopfrom
connections-e2e
Apr 26, 2024
Merged

feat: added e2e tests for connections page#24161
NidhiKJha merged 6 commits intodevelopfrom
connections-e2e

Conversation

@NidhiKJha
Copy link
Copy Markdown
Member

@NidhiKJha NidhiKJha commented Apr 22, 2024

This PR is to add e2e test for connections page for the following features:

  1. Disconnect Account Flow
  2. Connect More Accounts flow

Related issues

Fixes: #24166

Manual testing steps

  1. Create test build for Multichain
  2. Run the test for this file MULTICHAIN=1 yarn test:e2e:single --browser=chrome test/e2e/tests/connection-page.spec.js --leave-running

Screenshots/Recordings

NA it's a test

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've completed the PR template to the best of my ability
  • 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.

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.

@NidhiKJha NidhiKJha requested a review from a team as a code owner April 22, 2024 09:56
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Apr 22, 2024
@NidhiKJha NidhiKJha added team-core-extension-ux Core Extension UX team needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. labels Apr 22, 2024
Copy link
Copy Markdown
Contributor

@darkwing darkwing left a comment

Choose a reason for hiding this comment

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

Added ideas for improvements.

@EtherWizard33
Copy link
Copy Markdown
Contributor

EtherWizard33 commented Apr 23, 2024

nit: just an idea for improvement, maybe it could be nice to use AAA (adding three comments // Arrange // Act // Assert) to separate the part of the test which is setup from what we are actually testing and asserting.
But it's not used much, on mobile only one test over 3k tests makes use of it.

It could apply nicely to the second test in this PR.
I asked consensysgpt for a bit more detail on it.

Certainly! The Arrange-Act-Assert (AAA) pattern is a clear and structured approach for writing unit tests, ensuring they are easy to read, write, and maintain. Here's a concise explanation:

Why Use AAA?

  • Clarity: Separates the setup (Arrange), the action under test (Act), and the verification (Assert) into distinct sections, making tests easier to understand.
  • Maintainability: Makes it easier to identify which part of the test might be failing and why, simplifying debugging and maintenance.
  • Consistency: Encourages a uniform testing structure across the codebase, improving readability and collaboration among developers.

How to Implement AAA:

  1. Arrange: Initialize objects, prepare data, and set up any prerequisites necessary for the test.
  2. Act: Execute the method or function being tested with the arranged conditions.
  3. Assert: Verify the outcome of the act step matches the expected result, confirming the behavior of the tested code.

Just a nit and maybe something we could consider, otherwise I can go ahead and approve as a second reviewer following David's comments.

@EtherWizard33 EtherWizard33 self-requested a review April 23, 2024 12:41
EtherWizard33
EtherWizard33 previously approved these changes Apr 23, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [9f4979a]
Page Load Metrics (2043 ± 785 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint832941425124
domContentLoaded157532168
load53416020431636785
domInteractive157532168
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.45%. Comparing base (bf946dc) to head (9f4979a).
Report is 17 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #24161   +/-   ##
========================================
  Coverage    67.45%   67.45%           
========================================
  Files         1258     1258           
  Lines        49236    49236           
  Branches     12819    12819           
========================================
  Hits         33212    33212           
  Misses       16024    16024           

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

@EtherWizard33 EtherWizard33 self-requested a review April 25, 2024 12:33
@NidhiKJha NidhiKJha merged commit 01d6cb9 into develop Apr 26, 2024
@NidhiKJha NidhiKJha deleted the connections-e2e branch April 26, 2024 15:26
@github-actions github-actions bot locked and limited conversation to collaborators Apr 26, 2024
@gauthierpetetin gauthierpetetin added the release-12.0.0 Issue or pull request that will be included in release 12.0.0 label Jun 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. release-12.0.0 Issue or pull request that will be included in release 12.0.0 team-core-extension-ux Core Extension UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add e2e test for Connections Page

6 participants