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

test: [POM] Migrate contract interaction with snap account e2e tests to page object modal #27924

Merged
merged 48 commits into from
Oct 18, 2024

Conversation

devin-ai-integration[bot]
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Oct 17, 2024

Description

This PR migrates the snap account contract interaction e2e tests to Page Object Model (POM) pattern, improving test stability and maintainability.

Changes include:

  • Migrate test snap-account-contract-interaction.spec.ts to POM
  • Migrate test snap-account-signatures-and-disconnects.spec.ts to POM
  • Created related functions in TestDapp class
  • Avoid several delays in the original function implementation
  • Reduced flakiness

Open in GitHub Codespaces

Related issues

Fixes: #27933

Manual testing steps

Check code readability, make sure tests pass.

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.

devin-ai-integration bot and others added 30 commits October 8, 2024 09:03
- Moved snap-account-contract-interaction.spec.ts and snap-account-signatures-and-disconnects.spec.ts to test/e2e/tests/account/
- Created new page object files: account-menu.ts, activity-list.ts, signature-request-page.ts, snap-account-page.ts, test-dapp.ts, transaction-confirmation.ts
- Updated tsconfig.json to include esModuleInterop
- Updated package.json and yarn.lock with new dependencies
import { createBtcAccount } from '../../accounts/common';
import messages from '../../../../app/_locales/en/messages.json';

export async function createBtcAccount(driver: Driver) {
Copy link
Contributor

Choose a reason for hiding this comment

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

move this method from accounts/common file to this file

@chloeYue chloeYue changed the title test: Migrate snap account contract interaction test: [POM] Migrate contract interaction with snap account e2e tests to page object modal Oct 17, 2024
@chloeYue chloeYue marked this pull request as ready for review October 17, 2024 16:40
@metamaskbot
Copy link
Collaborator

Builds ready [fb83141]
Page Load Metrics (1920 ± 167 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint28232361839493237
domContentLoaded15692284183416479
load157832601920347167
domInteractive22102522210
backgroundConnect998989211101
firstReactRender48213943316
getState47613168
initialActions01000
loadScripts11491612137011455
setupStore1180302412
uiStartup175934182151380183
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@@ -18,6 +18,7 @@ import SnapSimpleKeyringPage from '../../page-objects/pages/snap-simple-keyring-
import TestDapp from '../../page-objects/pages/test-dapp';

describe('Snap Account Signatures @no-mmi', function (this: Suite) {
this.timeout(120000); // This test is very long, so we need an unusually high timeout
Copy link
Contributor

Choose a reason for hiding this comment

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

👍🏻

@chloeYue chloeYue added this pull request to the merge queue Oct 18, 2024
Merged via the queue into develop with commit 1648b83 Oct 18, 2024
76 checks passed
@chloeYue chloeYue deleted the migrate-snap-account-contract-interaction branch October 18, 2024 07:53
@github-actions github-actions bot locked and limited conversation to collaborators Oct 18, 2024
@metamaskbot metamaskbot added the release-12.8.0 Issue or pull request that will be included in release 12.8.0 label Oct 18, 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.8.0 Issue or pull request that will be included in release 12.8.0 labels Oct 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.6.0 Issue or pull request that will be included in release 12.6.0 team-ai AI team (for the Devin AI bot) team-extension-platform Extension Platform team
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[POM] Migrate snap account contract interaction e2e tests to page object modal
4 participants