Skip to content

Commit

Permalink
feat(lab): add UI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arein committed Dec 17, 2023
1 parent 070f992 commit db950da
Showing 1 changed file with 1 addition and 40 deletions.
41 changes: 1 addition & 40 deletions apps/laboratory/tests/shared/pages/ModalPage.ts
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()
}
}

0 comments on commit db950da

Please sign in to comment.