tldraw/apps/examples/e2e/tests/fixtures/fixtures.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

51 lines
1.3 KiB
TypeScript

import { test as base } from '@playwright/test'
import { ActionsMenu } from './menus/ActionsMenu'
import { HelpMenu } from './menus/HelpMenu'
import { MainMenu } from './menus/MainMenu'
import { NavigationPanel } from './menus/NavigationPanel'
import { PageMenu } from './menus/PageMenu'
import { StylePanel } from './menus/StylePanel'
import { Toolbar } from './menus/Toolbar'
type Fixtures = {
toolbar: Toolbar
stylePanel: StylePanel
actionsMenu: ActionsMenu
helpMenu: HelpMenu
mainMenu: MainMenu
pageMenu: PageMenu
navigationPanel: NavigationPanel
}
const test = base.extend<Fixtures>({
toolbar: async ({ page }, use) => {
const toolbar = new Toolbar(page)
await use(toolbar)
},
stylePanel: async ({ page }, use) => {
const stylePanel = new StylePanel(page)
await use(stylePanel)
},
actionsMenu: async ({ page }, use) => {
const actionsMenu = new ActionsMenu(page)
await use(actionsMenu)
},
helpMenu: async ({ page }, use) => {
const helpMenu = new HelpMenu(page)
await use(helpMenu)
},
mainMenu: async ({ page }, use) => {
const mainMenu = new MainMenu(page)
await use(mainMenu)
},
pageMenu: async ({ page }, use) => {
const pagemenu = new PageMenu(page)
await use(pagemenu)
},
navigationPanel: async ({ page }, use) => {
const navigationPanel = new NavigationPanel(page)
await use(navigationPanel)
},
})
export default test