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

fix: remove required env var #2106

Merged
merged 5 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ui_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ jobs:
CI: true
working-directory: ./apps/laboratory/
run: npm run ${{ inputs.command }}
- name: Run canary with minimal environment config
env:
NEXT_PUBLIC_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_PROJECT_ID }}
CI: true
working-directory: ./apps/laboratory/
run: npm run playwright:test:canary
- uses: actions/upload-artifact@v3
if: always()
with:
Expand Down
2 changes: 1 addition & 1 deletion apps/laboratory/tests/shared/fixtures/w3m-email-fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const testMEmail = base.extend<ModalFixture>({
const email = new Email(mailsacApiKey)
const tempEmail = email.getEmailAddressToUse(testInfo.parallelIndex)

await modalPage.emailFlow(tempEmail, context)
await modalPage.emailFlow(tempEmail, context, mailsacApiKey)
await use(modalPage)
},
modalValidator: async ({ modalPage }, use) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const testModalSmartAccount = base.extend<ModalFixture & { slowModalPage:
const email = new Email(mailsacApiKey)
const tempEmail = email.getEmailAddressToUse(testInfo.parallelIndex)

await modalPage.emailFlow(tempEmail, context)
await modalPage.emailFlow(tempEmail, context, mailsacApiKey)
await modalPage.switchNetwork('Sepolia')
await modalPage.page.waitForTimeout(1500)
await use(modalPage)
Expand Down
11 changes: 5 additions & 6 deletions apps/laboratory/tests/shared/pages/ModalPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import { doActionAndWaitForNewPage } from '../utils/actions'
import { Email } from '../utils/email'
import { DeviceRegistrationPage } from './DeviceRegistrationPage'

const mailsacApiKey = process.env['MAILSAC_API_KEY'] || ''
if (!mailsacApiKey) {
throw new Error('MAILSAC_API_KEY is not set')
}

export type ModalFlavor = 'default' | 'siwe' | 'email' | 'wallet'

export class ModalPage {
Expand Down Expand Up @@ -59,7 +54,11 @@ export class ModalPage {
return this.assertDefined(await qrCode.getAttribute('uri'))
}

async emailFlow(emailAddress: string, context: BrowserContext): Promise<void> {
async emailFlow(
emailAddress: string,
context: BrowserContext,
mailsacApiKey: string
): Promise<void> {
await this.load()

const email = new Email(mailsacApiKey)
Expand Down
8 changes: 7 additions & 1 deletion apps/laboratory/tests/smart-account.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import type { ModalWalletPage } from './shared/pages/ModalWalletPage'
import type { ModalWalletValidator } from './shared/validators/ModalWalletValidator'

const NOT_ENABLED_SMART_ACCOUNT_INDEX = 10
const NOT_ENABLED_SMART_ACCOUNT = 'web3modal-smart-account@mailsac.com'

const mailsacApiKey = process.env['MAILSAC_API_KEY']
if (!mailsacApiKey) {
throw new Error('MAILSAC_API_KEY is not set')
}

testModalSmartAccount.beforeEach(async ({ modalValidator }) => {
await modalValidator.expectConnected()
Expand Down Expand Up @@ -63,7 +69,7 @@ testModalSmartAccount(
await walletModalPage.disconnect()
await walletModalPage.page.waitForTimeout(2500)

await walletModalPage.emailFlow('web3modal-smart-account@mailsac.com', context)
await walletModalPage.emailFlow(NOT_ENABLED_SMART_ACCOUNT, context, mailsacApiKey)
await walletModalPage.switchNetwork('Sepolia')
await walletModalPage.openSettings()

Expand Down