Skip to content

Commit

Permalink
chore: gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
arein committed Dec 29, 2023
1 parent f7f8467 commit e9a8873
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 11 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ui_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ jobs:
name: playwright-report
path: ./apps/laboratory/playwright-report/
retention-days: 7
- uses: actions/upload-artifact@v3
if: always()
with:
name: videos
path: ./apps/laboratory/test-results/
retention-days: 7
- uses: actions/upload-artifact@v3
if: always()
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ lerna-debug.log
.turbo
playwright-report/
screenshots/
test-results/
8 changes: 4 additions & 4 deletions apps/laboratory/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ export default defineConfig<ModalFixture>({
testDir: './tests',

fullyParallel: true,
retries: process.env['CI'] ? 2 : 0,
workers: process.env['CI'] ? 1 : undefined,
retries: 0,
workers: 2,
reporter: [['list'], ['html']],

expect: {
timeout: (process.env['CI'] ? 60 : 15) * 1000
timeout: 30 * 1000
},
timeout: 60 * 1000,

Expand All @@ -25,7 +25,7 @@ export default defineConfig<ModalFixture>({
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',

video: process.env['CI'] ? 'off' : 'on-first-retry'
video: 'retain-on-failure'
},

/* Configure projects for major browsers */
Expand Down
18 changes: 15 additions & 3 deletions apps/laboratory/tests/shared/pages/ModalPage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Locator, Page } from '@playwright/test'
import { expect, type Locator, type Page } from '@playwright/test'
import { BASE_URL } from '../constants'

export type ModalFlavor = 'default' | 'siwe'
Expand Down Expand Up @@ -29,8 +29,20 @@ export class ModalPage {
await this.page.goto(this.url)
await this.connectButton.click()
await this.page.getByTestId('wallet-selector-walletconnect').click()
await this.page.waitForTimeout(2000)
await this.page.getByTestId('copy-wc2-uri').click()
// There is an issue in the modal where the URI might not be set
await expect
.poll(
async () => {
await this.page.getByTestId('copy-wc2-uri').click()

return await this.page.evaluate('navigator.clipboard.readText()')
},
{
message: 'Ensure WC URI is set',
timeout: 5000
}
)
.toContain('wc')
}

async disconnect() {
Expand Down
5 changes: 5 additions & 0 deletions apps/laboratory/tests/shared/pages/WalletPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ export class WalletPage {
async connect() {
await this.gotoHome.click()

await this.page.waitForTimeout(3000)

await this.page.getByTestId('uri-input').click()

// Paste clipboard
const isMac = process.platform === 'darwin'
const modifier = isMac ? 'Meta' : 'Control'
await this.page.keyboard.press(`${modifier}+KeyV`)

await this.page.waitForTimeout(2000)

await this.page.getByTestId('uri-connect-button').click()
}

Expand Down
12 changes: 8 additions & 4 deletions apps/laboratory/tests/shared/validators/WalletValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ export class WalletValidator {
}

async expectDisconnected() {
await this.page.waitForTimeout(1000)
await this.page.reload()
await this.gotoSessions.click()
await expect(this.page.getByTestId('session-card')).not.toBeVisible()
await expect.poll(async () => {
await this.page.reload()
await this.gotoSessions.click()
return await this.page.getByTestId('session-card').isVisible()
}, {
message: 'All sessions should be disconnected',
timeout: 15000,
}).toBe(false)
}

async expectReceivedSign({ chainName = 'Ethereum' }) {
Expand Down

0 comments on commit e9a8873

Please sign in to comment.