338501d656
This PR updates our end to end tests so that they check every route in our examples to ensure that it loads (skipping any routes that don't features a canvas). ### Change Type - [x] `tests` — Changes to any test code only[^2] ### Test Plan - [x] End to end tests
17 lines
608 B
TypeScript
17 lines
608 B
TypeScript
import test from '@playwright/test'
|
|
import * as fs from 'fs'
|
|
import path from 'path'
|
|
|
|
// get all routes from examples/src/examples folder
|
|
const examplesFolderList = fs.readdirSync(path.join(__dirname, '../../src/examples'))
|
|
const examplesWithoutCanvas = ['image-component', 'yjs']
|
|
const exampelsToTest = examplesFolderList.filter((route) => !examplesWithoutCanvas.includes(route))
|
|
|
|
test.describe('Routes', () => {
|
|
for (const example of exampelsToTest) {
|
|
test(example, async ({ page }) => {
|
|
await page.goto(`http://localhost:5420/${example}/full`)
|
|
await page.waitForSelector('.tl-canvas')
|
|
})
|
|
}
|
|
})
|