-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
0 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 0 additions & 31 deletions
31
apps/laboratory/tests/shared/validators/WalletValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,16 @@ | ||
import { expect } from '@playwright/test' | ||
import type { Locator, Page } from '@playwright/test' | ||
import { WALLET_URL } from '../constants' | ||
|
||
export class WalletValidator { | ||
private readonly baseURL = WALLET_URL | ||
|
||
private readonly gotoAccounts: Locator | ||
|
||
private readonly gotoSessions: Locator | ||
|
||
private readonly gotoHome: Locator | ||
|
||
private readonly gotoPairings: Locator | ||
|
||
private readonly gotoSettings: Locator | ||
|
||
constructor(public readonly page: Page) { | ||
this.gotoAccounts = this.page.getByTestId('accounts') | ||
this.gotoSessions = this.page.getByTestId('sessions') | ||
this.gotoHome = this.page.getByTestId('wc-connect') | ||
this.gotoPairings = this.page.getByTestId('pairings') | ||
this.gotoSettings = this.page.getByTestId('settings') | ||
} | ||
|
||
async expectConnected() { | ||
await this.page.reload() | ||
await this.gotoSessions.click() | ||
await expect(this.page.getByTestId('session-card')).toBeVisible() | ||
} | ||
|
||
async expectDisconnected() { | ||
await this.page.reload() | ||
await this.gotoSessions.click() | ||
await expect(this.page.getByTestId('session-card')).not.toBeVisible() | ||
} | ||
|
||
async expectRecievedSign({ chainName = 'Ethereum' }) { | ||
await expect(this.page.getByText('Sign Message')).toBeVisible() | ||
await expect(this.page.getByTestId('request-details-chain')).toHaveText(chainName) | ||
} | ||
|
||
async expectRecievedSignTyped({ chainName = 'Ethereum' }) { | ||
await expect(this.page.getByText('Sign Typed Data')).toBeVisible() | ||
await expect(this.page.getByTestId('request-details-chain')).toHaveText(chainName) | ||
} | ||
} |