Remove a few E2E workflows for test setup that have proven flaky on Windows (#4135)
* Remove a few E2E workflows for test setup that have proven flaky on Windows * fix lint
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
import { test, expect, Page } from '@playwright/test'
|
import { test, expect } from '@playwright/test'
|
||||||
import {
|
import {
|
||||||
doExport,
|
doExport,
|
||||||
executorInputPath,
|
executorInputPath,
|
||||||
@ -618,31 +618,30 @@ test(
|
|||||||
'Deleting projects, can delete individual project, can still create projects after deleting all',
|
'Deleting projects, can delete individual project, can still create projects after deleting all',
|
||||||
{ tag: '@electron' },
|
{ tag: '@electron' },
|
||||||
async ({ browserName }, testInfo) => {
|
async ({ browserName }, testInfo) => {
|
||||||
|
const projectData = [
|
||||||
|
['router-template-slate', 'cylinder.kcl'],
|
||||||
|
['bracket', 'focusrite_scarlett_mounting_braket.kcl'],
|
||||||
|
['lego', 'lego.kcl'],
|
||||||
|
]
|
||||||
|
|
||||||
const { electronApp, page } = await setupElectron({
|
const { electronApp, page } = await setupElectron({
|
||||||
testInfo,
|
testInfo,
|
||||||
|
folderSetupFn: async (dir) => {
|
||||||
|
// Do these serially to ensure the order is correct
|
||||||
|
for (const [name, file] of projectData) {
|
||||||
|
await fsp.mkdir(join(dir, name), { recursive: true })
|
||||||
|
await fsp.copyFile(
|
||||||
|
executorInputPath(file),
|
||||||
|
join(dir, name, `main.kcl`)
|
||||||
|
)
|
||||||
|
// Wait 1s between each project to ensure the order is correct
|
||||||
|
await new Promise((r) => setTimeout(r, 1_000))
|
||||||
|
}
|
||||||
|
},
|
||||||
})
|
})
|
||||||
await page.setViewportSize({ width: 1200, height: 500 })
|
await page.setViewportSize({ width: 1200, height: 500 })
|
||||||
|
|
||||||
page.on('console', console.log)
|
page.on('console', console.log)
|
||||||
|
|
||||||
const createProjectAndRenameItTest = async ({
|
|
||||||
name,
|
|
||||||
page,
|
|
||||||
}: {
|
|
||||||
name: string
|
|
||||||
page: Page
|
|
||||||
}) => {
|
|
||||||
await test.step(`Create and rename project ${name}`, async () => {
|
|
||||||
await createProjectAndRenameIt({ name, page })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// we need to create the folders so that the order is correct
|
|
||||||
// creating them ahead of time with fs tools means they all have the same timestamp
|
|
||||||
await createProjectAndRenameItTest({ name: 'router-template-slate', page })
|
|
||||||
await createProjectAndRenameItTest({ name: 'bracket', page })
|
|
||||||
await createProjectAndRenameItTest({ name: 'lego', page })
|
|
||||||
|
|
||||||
await test.step('delete the middle project, i.e. the bracket project', async () => {
|
await test.step('delete the middle project, i.e. the bracket project', async () => {
|
||||||
const project = page.getByText('bracket')
|
const project = page.getByText('bracket')
|
||||||
|
|
||||||
@ -744,8 +743,26 @@ test(
|
|||||||
'Can sort projects on home page',
|
'Can sort projects on home page',
|
||||||
{ tag: '@electron' },
|
{ tag: '@electron' },
|
||||||
async ({ browserName }, testInfo) => {
|
async ({ browserName }, testInfo) => {
|
||||||
|
const projectData = [
|
||||||
|
['router-template-slate', 'cylinder.kcl'],
|
||||||
|
['bracket', 'focusrite_scarlett_mounting_braket.kcl'],
|
||||||
|
['lego', 'lego.kcl'],
|
||||||
|
]
|
||||||
|
|
||||||
const { electronApp, page } = await setupElectron({
|
const { electronApp, page } = await setupElectron({
|
||||||
testInfo,
|
testInfo,
|
||||||
|
folderSetupFn: async (dir) => {
|
||||||
|
// Do these serially to ensure the order is correct
|
||||||
|
for (const [name, file] of projectData) {
|
||||||
|
await fsp.mkdir(join(dir, name), { recursive: true })
|
||||||
|
await fsp.copyFile(
|
||||||
|
executorInputPath(file),
|
||||||
|
join(dir, name, `main.kcl`)
|
||||||
|
)
|
||||||
|
// Wait 1s between each project to ensure the order is correct
|
||||||
|
await new Promise((r) => setTimeout(r, 1_000))
|
||||||
|
}
|
||||||
|
},
|
||||||
})
|
})
|
||||||
await page.setViewportSize({ width: 1200, height: 500 })
|
await page.setViewportSize({ width: 1200, height: 500 })
|
||||||
|
|
||||||
@ -753,24 +770,6 @@ test(
|
|||||||
|
|
||||||
page.on('console', console.log)
|
page.on('console', console.log)
|
||||||
|
|
||||||
const createProjectAndRenameItTest = async ({
|
|
||||||
name,
|
|
||||||
page,
|
|
||||||
}: {
|
|
||||||
name: string
|
|
||||||
page: Page
|
|
||||||
}) => {
|
|
||||||
await test.step(`Create and rename project ${name}`, async () => {
|
|
||||||
await createProjectAndRenameIt({ name, page })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// we need to create the folders so that the order is correct
|
|
||||||
// creating them ahead of time with fs tools means they all have the same timestamp
|
|
||||||
await createProjectAndRenameItTest({ name: 'router-template-slate', page })
|
|
||||||
await createProjectAndRenameItTest({ name: 'bracket', page })
|
|
||||||
await createProjectAndRenameItTest({ name: 'lego', page })
|
|
||||||
|
|
||||||
await test.step('should be shorted by modified initially', async () => {
|
await test.step('should be shorted by modified initially', async () => {
|
||||||
const lastModifiedButton = page.getByRole('button', {
|
const lastModifiedButton = page.getByRole('button', {
|
||||||
name: 'Last Modified',
|
name: 'Last Modified',
|
||||||
|
|||||||
Reference in New Issue
Block a user