tldraw/apps/examples/e2e/tests/fixtures/menus/NavigationPanel.ts
Taha 5db4e9a491
Adding a single E2E test per menu (#2954)
A basic test for each of the menu areas

fixes TLD-2251

- [x] `tests` — Changes to any test code only[^2]

### Release Notes

- Add a brief release note for your PR here.

---------

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2024-02-29 13:21:10 +00:00

21 lines
840 B
TypeScript

import { Locator, Page } from '@playwright/test'
export class NavigationPanel {
readonly minimap: Locator
readonly zoomMenuButton: Locator
readonly toggleButton: Locator
readonly zoomMenuItems: { [key: string]: Locator }
constructor(private readonly page: Page) {
this.page = page
this.minimap = page.getByLabel('minimap')
this.zoomMenuButton = page.getByTestId('minimap.zoom-menu-button')
this.toggleButton = page.getByTestId('minimap.toggle-button')
this.zoomMenuItems = {
zoomIn: page.getByRole('menuitem').getByText('Zoom in'),
zoomOut: page.getByRole('menuitem').getByText('Zoom out'),
zoomToHundred: page.getByRole('menuitem').getByText('Zoom to 100%'),
zoomToFit: page.getByRole('menuitem').getByText('Zoom to fit'),
zoomToSelection: page.getByRole('menuitem').getByText('Zoom to selection'),
}
}
}