Skip to content

Commit

Permalink
Merge branch 'V4' into chore/more-canary-logs
Browse files Browse the repository at this point in the history
  • Loading branch information
chris13524 authored Apr 1, 2024
2 parents ee6502b + 3ac38c4 commit 8f74b7c
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 8 deletions.
2 changes: 2 additions & 0 deletions apps/laboratory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
"playwright:install": "playwright install --with-deps",
"playwright:test": "playwright test",
"playwright:test:wallet": "playwright test --grep 'connect-qr.spec.ts|wallet.spec.ts'",
"playwright:test:email": "playwright test --grep 'email.spec.ts'",
"playwright:test:siwe": "playwright test --grep siwe.spec.ts",
"playwright:test:canary": "playwright test --retries=0 --grep canary.spec.ts --project='Desktop Chrome/wagmi'",
"playwright:debug": "npm run playwright:test -- --debug",
"playwright:debug:wallet": "npm run playwright:test:wallet -- --debug",
"playwright:debug:email": "npm run playwright:test:email -- --debug",
"playwright:debug:siwe": "npm run playwright:test:siwe -- --debug",
"playwright:debug:canary": "npm run playwright:test:canary -- --debug"
},
Expand Down
4 changes: 3 additions & 1 deletion apps/laboratory/tests/shared/fixtures/w3m-email-fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ export const testMEmail = base.extend<ModalFixture>({
otp = email.getOtpCodeFromBody(emailBody)
}
}
if (otp.length !== 6) {
if (otp.length !== 7) {
// eslint-disable-next-line no-console
console.log('Getting the OTP code from body', { previousOtp: otp })
otp = email.getOtpCodeFromBody(emailBody)
}
await modalPage.enterOTP(otp)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, type Page } from '@playwright/test'

const LOGIN_APPROVED_SUCCESS_TEXT = 'Login Approved'
const LOGIN_APPROVED_SUCCESS_TEXT = 'approved'

export class DeviceRegistrationPage {
constructor(
Expand Down
12 changes: 12 additions & 0 deletions apps/laboratory/tests/shared/pages/ModalPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,21 @@ export class ModalPage {
await this.page.getByTestId('wui-email-input').locator('input').focus()
await this.page.getByTestId('wui-email-input').locator('input').fill(email)
await this.page.getByTestId('wui-email-input').locator('input').press('Enter')
await expect(
this.page.getByText(email),
`Expected current email: ${email} to be visible on the notification screen`
).toBeVisible({
timeout: 10_000
})
}

async enterOTP(otp: string) {
await expect(this.page.getByText('Confirm Email')).toBeVisible({
timeout: 10_000
})
await expect(this.page.getByText('Enter the code we sent')).toBeVisible({
timeout: 10_000
})
const splitted = otp.split('')
// Remove empy space in OTP code 111 111
splitted.splice(3, 1)
Expand Down
7 changes: 1 addition & 6 deletions apps/laboratory/tests/shared/utils/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,15 @@ const customProjectProperties: CustomProjectProperties = {
'Desktop Chrome/wagmi': {
testIgnore: 'email.spec.ts'
},
'Desktop Chrome/ethers': {
testIgnore: 'email.spec.ts'
},
'Desktop Firefox/wagmi': {
testIgnore: 'email.spec.ts'
},
'Desktop Firefox/ethers': {
testIgnore: 'email.spec.ts'
},
// Exclude email.spec.ts, siwe.spec.ts, and canary.spec.ts from solana, not yet implemented
'Desktop Chrome/solana': {
grep: /^(?!.*(?:email\.spec\.ts|siwe\.spec\.ts|canary\.spec\.ts)).*$/u
},
'Desktop Brave/solana': {
useOptions: braveOptions,
grep: /^(?!.*(?:email\.spec\.ts|siwe\.spec\.ts|canary\.spec\.ts)).*$/u
},
'Desktop Firefox/solana': {
Expand Down
15 changes: 15 additions & 0 deletions dangerfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,21 @@ async function checkWallet() {
}

checkWallet()

// -- Check laboratory ------------------------------------------------------------

async function checkLaboratory() {
const lab_files = modified_files.filter(f => f.includes('/laboratory/'))
for (const f of lab_files) {
const diff = await diffForFile(f)
if (f.includes('project') && (diff?.removed.includes('spec') || diff?.added.includes('spec'))) {
warn('Testing spec changed')
}
}
}

checkLaboratory()

// -- Check left over development constants ---------------------------------------
async function checkDevelopmentConstants() {
for (const f of updated_files) {
Expand Down

0 comments on commit 8f74b7c

Please sign in to comment.