-
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
1 changed file
with
1 addition
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,13 @@ | ||
import type { Locator, Page } from '@playwright/test' | ||
import type { Page } from '@playwright/test' | ||
import { LOCAL_LABS_URL } from '../constants' | ||
|
||
export class ModalPage { | ||
private readonly baseURL = LOCAL_LABS_URL | ||
|
||
private readonly w3modal: Locator | ||
|
||
constructor(public readonly page: Page) { | ||
this.w3modal = this.page.getByTestId('partial-core-connect-button') | ||
} | ||
|
||
async load() { | ||
await this.page.goto(this.baseURL) | ||
} | ||
|
||
async getUri() { | ||
await this.page.goto(this.baseURL) | ||
await this.w3modal.click() | ||
await this.page.getByText('Connect Wallet').click() | ||
} | ||
|
||
async disconnect() { | ||
await this.page.getByTestId('partial-account-address').click() | ||
await this.page.getByTestId('view-account-disconnect-button').click() | ||
} | ||
|
||
async sign() { | ||
await this.page.getByTestId('lab-sign').click() | ||
} | ||
|
||
async signTyped() { | ||
await this.page.getByTestId('lab-sign-typed').click() | ||
} | ||
|
||
async switchChain({ chainName }: { chainName: string }) { | ||
await this.page.getByTestId('partial-network-switch-button').click() | ||
await this.page.getByText(new RegExp(chainName, 'u')).click() | ||
} | ||
|
||
async helpModal() { | ||
await this.page.getByTestId('backcard-help').click() | ||
} | ||
|
||
async closeModal() { | ||
await this.page.getByTestId('backcard-close').click() | ||
} | ||
|
||
async closePopup() { | ||
await this.page.locator('.nextui-modal-close-icon-svg').click() | ||
} | ||
} |