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

chore: serialize email tests and use wc uri instead of deeplink #2590

Merged
merged 42 commits into from
Jul 29, 2024

Conversation

tomiir
Copy link
Collaborator

@tomiir tomiir commented Jul 23, 2024

Description

  • Removes email based fixtures
  • Makes email tests run in serial mode, so that the login can be re-utilized, saving emails sent and inbox collisions between the workers tests
  • Unifies w3m-wallet-fixture behavior using wc uri fetching from the modal instead of a deeplink to fix a Playwright issue where it bugs out the connection when opening deeplinks in tests.

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections

Copy link

vercel bot commented Jul 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
web3modal-gallery ✅ Ready (Inspect) Visit Preview Jul 29, 2024 10:27am
web3modal-laboratory ✅ Ready (Inspect) Visit Preview Jul 29, 2024 10:27am

Comment on lines +7 to +18
/* eslint-disable init-declarations */
let page: ModalWalletPage
let validator: ModalWalletValidator
let context: BrowserContext
/* eslint-enable init-declarations */

// -- Setup --------------------------------------------------------------------
const emailTest = test.extend<{ library: string }>({
library: ['wagmi', { option: true }]
})

emailTest.describe.configure({ mode: 'serial' })
Copy link
Contributor

Choose a reason for hiding this comment

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

what if we wrap the tests with a describe?

Comment on lines +27 to +42
walletPage.page.on('console', msg => {
if (msg.text().includes('set') && msg.text().includes('core/pairing/pairing')) {
pairingCreatedTime = new Date()
}
if (msg.text().includes('resolving attestation')) {
verificationStartedTime = new Date()
}
if (msg.text().includes('session_proposal') && msg.text().includes('verifyContext')) {
// For some reason this log is emitted twice; so only recording the time once
if (verificationStartedTime) {
const verificationEndedTime = new Date()
timingRecords.push({
item: 'sessionProposalVerification',
timeMs: verificationEndedTime.getTime() - verificationStartedTime.getTime()
})
verificationStartedTime = null
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@chris13524 can you double check this?
Code seemed completely duplicated between solana and non-solana after the qr uri change so I merged it.
Only difference wat this event listener on the console that was only set on the non-solana side.

Copy link
Member

Choose a reason for hiding this comment

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

The canary doesn't run Solana tests, so if this is just in the non-Solana variant that's fine

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There are no variants now, like this runs on every wallet test. If we need to scope it so that it doesnt add the event handler on solana I can add that check

Copy link
Member

Choose a reason for hiding this comment

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

That's not a problem. This can run for Solana. It just measures time and adds to the array of time entries. The value is only read in the canary spec

Copy link
Member

@chris13524 chris13524 left a comment

Choose a reason for hiding this comment

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

LGTM

@tomiir tomiir changed the title chore: serialize email tests chore: serialize email tests and use wc uri instead of deeplink Jul 23, 2024
- uses: actions/upload-artifact@v3
if: always()
- uses: actions/upload-artifact@v4
if: failure()
Copy link
Contributor

Choose a reason for hiding this comment

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

Upload the artifacts if the tests has been failed

@@ -35,6 +35,7 @@ export class WalletValidator {
}

async expectDisconnected() {
await this.page.reload()
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove

@enesozturk enesozturk merged commit 02f227a into main Jul 29, 2024
12 checks passed
@enesozturk enesozturk deleted the rocky/email-tests-login-improvement branch July 29, 2024 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants