-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditor.fixture.ts
More file actions
33 lines (28 loc) · 981 Bytes
/
editor.fixture.ts
File metadata and controls
33 lines (28 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { test as base } from '@playwright/test'
import { EditorModel } from '../models/editor.model'
import { ShapeModel } from '../models/shape.model'
import { CanvasModel } from '../models/canvas.model'
import { bypassCertificateWarning } from '../helpers/certificate.helper'
import { injectEditorBrowserHelpers } from '../helpers/editor-browser-helpers.helper'
interface EditorFixtures {
editorModel: EditorModel
shapes: ShapeModel
canvas: CanvasModel
}
export const test = base.extend<EditorFixtures>({
editorModel: async({ page }, use) => {
const model = new EditorModel(page)
await injectEditorBrowserHelpers({ page })
await page.goto('/')
await bypassCertificateWarning({ page })
await model.waitForReady()
await use(model)
},
shapes: async({ editorModel }, use) => {
await use(editorModel.shapes)
},
canvas: async({ editorModel }, use) => {
await use(editorModel.canvas)
}
})
export { expect } from '@playwright/test'