mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-21 10:41:04 +03:00
868556471d
Signed-off-by: Jasmin <jasmin@hardcoreeng.com>
32 lines
910 B
TypeScript
32 lines
910 B
TypeScript
import { type Locator, type Page } from '@playwright/test'
|
|
|
|
export class LeftSideMenuPage {
|
|
readonly page: Page
|
|
readonly buttonPlanning: Locator
|
|
readonly buttonTeam: Locator
|
|
readonly buttonDocuments: Locator
|
|
|
|
constructor (page: Page) {
|
|
this.page = page
|
|
this.buttonPlanning = page.locator('button[id$="Planning"]')
|
|
this.buttonTeam = page.locator('button[id$="Team"]')
|
|
this.buttonDocuments = page.locator('[id$="app-documents\\:string\\:DocumentApplication"]')
|
|
}
|
|
|
|
async clickButtonOnTheLeft (buttonName: 'Planning' | 'Team' | 'Documents'): Promise<void> {
|
|
switch (buttonName) {
|
|
case 'Planning':
|
|
await this.buttonPlanning.click()
|
|
break
|
|
case 'Team':
|
|
await this.buttonTeam.click()
|
|
break
|
|
case 'Documents':
|
|
await this.buttonDocuments.click()
|
|
break
|
|
default:
|
|
throw new Error('Unknown button')
|
|
}
|
|
}
|
|
}
|