Skip to content

Commit

Permalink
feat: improve speed
Browse files Browse the repository at this point in the history
  • Loading branch information
arein committed Jan 18, 2024
1 parent 55c9522 commit 581879e
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions tests/shared/validators/WalletValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,17 @@ import type { Locator, Page } from '@playwright/test'

export class WalletValidator {
private readonly gotoSessions: Locator
private readonly vercelPreview: Locator

constructor(public readonly page: Page) {
this.gotoSessions = this.page.getByTestId('sessions')
this.vercelPreview = this.page.locator('css=vercel-live-feedback')
}

async reload() {
await this.page.reload()
await this.page.getByTestId('wc-connect').isVisible()
await this.page.waitForTimeout(1000)
const isVercelPreview = (await this.vercelPreview.count()) > 0
if (isVercelPreview) {
await this.vercelPreview.evaluate((iframe: HTMLIFrameElement) => iframe.remove())
}
}

async expectConnected() {
await this.reload()
await this.gotoSessions.click()
await expect(this.page.getByTestId('session-card')).toBeVisible()
}

async expectDisconnected() {
await this.page.waitForTimeout(1000)
await this.reload()
await this.gotoSessions.click()
await expect(this.page.getByTestId('session-card')).not.toBeVisible()
}
Expand Down

0 comments on commit 581879e

Please sign in to comment.