Enable all disabled win32 tests (#3618)

* Enable all disabled win32 tests

* Skip one test
This commit is contained in:
Adam Sunderland
2024-08-23 10:50:40 -04:00
committed by GitHub
parent 9a385fb474
commit 5cd8ab3812
8 changed files with 112 additions and 155 deletions

View File

@ -1,6 +1,13 @@
import { test, expect } from '@playwright/test' import { test, expect } from '@playwright/test'
import { getUtils, setup, setupElectron, tearDown } from './test-utils' import {
getUtils,
setup,
setupElectron,
tearDown,
executorInputPath,
} from './test-utils'
import { join } from 'path'
import { bracket } from 'lib/exampleKcl' import { bracket } from 'lib/exampleKcl'
import { TEST_CODE_LONG_WITH_ERROR_OUT_OF_VIEW } from './storageStates' import { TEST_CODE_LONG_WITH_ERROR_OUT_OF_VIEW } from './storageStates'
import fsp from 'fs/promises' import fsp from 'fs/promises'
@ -223,26 +230,24 @@ test(
'Opening multiple panes persists when switching projects', 'Opening multiple panes persists when switching projects',
{ tag: '@electron' }, { tag: '@electron' },
async ({ browserName }, testInfo) => { async ({ browserName }, testInfo) => {
test.skip(
process.platform === 'win32',
'TODO: remove this skip https://github.com/KittyCAD/modeling-app/issues/3557'
)
// Setup multiple projects. // Setup multiple projects.
const { electronApp, page } = await setupElectron({ const { electronApp, page } = await setupElectron({
testInfo, testInfo,
folderSetupFn: async (dir) => { folderSetupFn: async (dir) => {
const routerTemplateDir = join(dir, 'router-template-slate')
const bracketDir = join(dir, 'bracket')
await Promise.all([ await Promise.all([
fsp.mkdir(`${dir}/router-template-slate`, { recursive: true }), fsp.mkdir(routerTemplateDir, { recursive: true }),
fsp.mkdir(`${dir}/bracket`, { recursive: true }), fsp.mkdir(bracketDir, { recursive: true }),
]) ])
await Promise.all([ await Promise.all([
fsp.copyFile( fsp.copyFile(
'src/wasm-lib/tests/executor/inputs/router-template-slate.kcl', executorInputPath('router-template-slate.kcl'),
`${dir}/router-template-slate/main.kcl` join(routerTemplateDir, 'main.kcl')
), ),
fsp.copyFile( fsp.copyFile(
'src/wasm-lib/tests/executor/inputs/focusrite_scarlett_mounting_braket.kcl', executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
`${dir}/bracket/main.kcl` join(bracketDir, 'main.kcl')
), ),
]) ])
}, },

View File

@ -1,5 +1,11 @@
import { test, expect } from '@playwright/test' import { test, expect } from '@playwright/test'
import { getUtils, setupElectron, tearDown } from './test-utils' import { join } from 'path'
import {
getUtils,
setupElectron,
tearDown,
executorInputPath,
} from './test-utils'
import fsp from 'fs/promises' import fsp from 'fs/promises'
test.afterEach(async ({ page }, testInfo) => { test.afterEach(async ({ page }, testInfo) => {
@ -10,22 +16,19 @@ test(
'export works on the first try', 'export works on the first try',
{ tag: '@electron' }, { tag: '@electron' },
async ({ browserName }, testInfo) => { async ({ browserName }, testInfo) => {
test.skip(
process.platform === 'win32',
'TODO: remove this skip https://github.com/KittyCAD/modeling-app/issues/3557'
)
const { electronApp, page } = await setupElectron({ const { electronApp, page } = await setupElectron({
testInfo, testInfo,
folderSetupFn: async (dir) => { folderSetupFn: async (dir) => {
await Promise.all([fsp.mkdir(`${dir}/bracket`, { recursive: true })]) const bracketDir = join(dir, 'bracket')
await Promise.all([fsp.mkdir(bracketDir, { recursive: true })])
await Promise.all([ await Promise.all([
fsp.copyFile( fsp.copyFile(
'src/wasm-lib/tests/executor/inputs/router-template-slate.kcl', executorInputPath('router-template-slate.kcl'),
`${dir}/bracket/other.kcl` join(bracketDir, 'other.kcl')
), ),
fsp.copyFile( fsp.copyFile(
'src/wasm-lib/tests/executor/inputs/focusrite_scarlett_mounting_braket.kcl', executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
`${dir}/bracket/main.kcl` join(bracketDir, 'main.kcl')
), ),
]) ])
}, },

View File

@ -1,5 +1,6 @@
import { test, expect } from '@playwright/test' import { test, expect } from '@playwright/test'
import { setupElectron, tearDown } from './test-utils' import { setupElectron, tearDown, executorInputPath } from './test-utils'
import { join } from 'path'
import fsp from 'fs/promises' import fsp from 'fs/promises'
test.afterEach(async ({ page }, testInfo) => { test.afterEach(async ({ page }, testInfo) => {
@ -10,17 +11,14 @@ test(
'When machine-api server not found butt is disabled and shows the reason', 'When machine-api server not found butt is disabled and shows the reason',
{ tag: '@electron' }, { tag: '@electron' },
async ({ browserName }, testInfo) => { async ({ browserName }, testInfo) => {
test.skip(
process.platform === 'win32',
'TODO: remove this skip https://github.com/KittyCAD/modeling-app/issues/3557'
)
const { electronApp, page } = await setupElectron({ const { electronApp, page } = await setupElectron({
testInfo, testInfo,
folderSetupFn: async (dir) => { folderSetupFn: async (dir) => {
await fsp.mkdir(`${dir}/bracket`, { recursive: true }) const bracketDir = join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
'src/wasm-lib/tests/executor/inputs/focusrite_scarlett_mounting_braket.kcl', executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
`${dir}/bracket/main.kcl` join(bracketDir, 'main.kcl')
) )
}, },
}) })
@ -58,17 +56,14 @@ test(
'When machine-api server not found home screen & project status shows the reason', 'When machine-api server not found home screen & project status shows the reason',
{ tag: '@electron' }, { tag: '@electron' },
async ({ browserName }, testInfo) => { async ({ browserName }, testInfo) => {
test.skip(
process.platform === 'win32',
'TODO: remove this skip https://github.com/KittyCAD/modeling-app/issues/3557'
)
const { electronApp, page } = await setupElectron({ const { electronApp, page } = await setupElectron({
testInfo, testInfo,
folderSetupFn: async (dir) => { folderSetupFn: async (dir) => {
await fsp.mkdir(`${dir}/bracket`, { recursive: true }) const bracketDir = join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
'src/wasm-lib/tests/executor/inputs/focusrite_scarlett_mounting_braket.kcl', executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
`${dir}/bracket/main.kcl` join(bracketDir, 'main.kcl')
) )
}, },
}) })

View File

@ -1,6 +1,13 @@
import { test, expect } from '@playwright/test' import { test, expect } from '@playwright/test'
import { join } from 'path'
import fsp from 'fs/promises' import fsp from 'fs/promises'
import { getUtils, setup, setupElectron, tearDown } from './test-utils' import {
getUtils,
setup,
setupElectron,
tearDown,
executorInputPath,
} from './test-utils'
import { bracket } from 'lib/exampleKcl' import { bracket } from 'lib/exampleKcl'
import { onboardingPaths } from 'routes/Onboarding/paths' import { onboardingPaths } from 'routes/Onboarding/paths'
import { import {
@ -347,17 +354,14 @@ test(
'Restarting onboarding on desktop takes one attempt', 'Restarting onboarding on desktop takes one attempt',
{ tag: '@electron' }, { tag: '@electron' },
async ({ browser: _ }, testInfo) => { async ({ browser: _ }, testInfo) => {
test.skip(
process.platform === 'win32',
'TODO: remove this skip https://github.com/KittyCAD/modeling-app/issues/3557'
)
const { electronApp, page } = await setupElectron({ const { electronApp, page } = await setupElectron({
testInfo, testInfo,
folderSetupFn: async (dir) => { folderSetupFn: async (dir) => {
await fsp.mkdir(`${dir}/router-template-slate`, { recursive: true }) const routerTemplateDir = join(dir, 'router-template-slate')
await fsp.mkdir(routerTemplateDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
'src/wasm-lib/tests/executor/inputs/router-template-slate.kcl', executorInputPath('router-template-slate.kcl'),
`${dir}/router-template-slate/main.kcl` join(routerTemplateDir, 'main.kcl')
) )
}, },
}) })

View File

@ -1,6 +1,7 @@
import { test, expect, Page } from '@playwright/test' import { test, expect, Page } from '@playwright/test'
import { import {
doExport, doExport,
executorInputPath,
getUtils, getUtils,
isOutOfViewInScrollContainer, isOutOfViewInScrollContainer,
Paths, Paths,
@ -49,17 +50,11 @@ test(
const { electronApp, page } = await setupElectron({ const { electronApp, page } = await setupElectron({
testInfo, testInfo,
folderSetupFn: async (dir) => { folderSetupFn: async (dir) => {
await fsp.mkdir(join(dir, 'bracket'), { recursive: true }) const bracketDir = join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
join( executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
'src', join(bracketDir, 'main.kcl')
'wasm-lib',
'tests',
'executor',
'inputs',
'focusrite_scarlett_mounting_braket.kcl'
),
join(dir, 'bracket', 'main.kcl')
) )
}, },
}) })
@ -99,14 +94,7 @@ test(
folderSetupFn: async (dir) => { folderSetupFn: async (dir) => {
await fsp.mkdir(join(dir, 'broken-code'), { recursive: true }) await fsp.mkdir(join(dir, 'broken-code'), { recursive: true })
await fsp.copyFile( await fsp.copyFile(
join( executorInputPath('broken-code-test.kcl'),
'src',
'wasm-lib',
'tests',
'executor',
'inputs',
'broken-code-test.kcl'
),
join(dir, 'broken-code', 'main.kcl') join(dir, 'broken-code', 'main.kcl')
) )
}, },
@ -143,17 +131,14 @@ test.describe('Can export from electron app', () => {
`Can export using ${method}`, `Can export using ${method}`,
{ tag: '@electron' }, { tag: '@electron' },
async ({ browserName }, testInfo) => { async ({ browserName }, testInfo) => {
test.skip(
process.platform === 'win32',
'TODO: remove this skip https://github.com/KittyCAD/modeling-app/issues/3557'
)
const { electronApp, page } = await setupElectron({ const { electronApp, page } = await setupElectron({
testInfo, testInfo,
folderSetupFn: async (dir) => { folderSetupFn: async (dir) => {
await fsp.mkdir(`${dir}/bracket`, { recursive: true }) const bracketDir = join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
'src/wasm-lib/tests/executor/inputs/focusrite_scarlett_mounting_braket.kcl', executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
`${dir}/bracket/main.kcl` join(bracketDir, 'main.kcl')
) )
}, },
}) })
@ -1032,10 +1017,6 @@ test(
'Search projects on desktop home', 'Search projects on desktop home',
{ tag: '@electron' }, { tag: '@electron' },
async ({ browserName: _ }, testInfo) => { async ({ browserName: _ }, testInfo) => {
test.skip(
process.platform === 'win32',
'TODO: remove this skip https://github.com/KittyCAD/modeling-app/issues/3557'
)
const projectData = [ const projectData = [
['basic bracket', 'focusrite_scarlett_mounting_braket.kcl'], ['basic bracket', 'focusrite_scarlett_mounting_braket.kcl'],
['basic-cube', 'basic_fillet_cube_end.kcl'], ['basic-cube', 'basic_fillet_cube_end.kcl'],
@ -1050,7 +1031,7 @@ test(
for (const [name, file] of projectData) { for (const [name, file] of projectData) {
await fsp.mkdir(join(dir, name), { recursive: true }) await fsp.mkdir(join(dir, name), { recursive: true })
await fsp.copyFile( await fsp.copyFile(
join('src', 'wasm-lib', 'tests', 'executor', 'inputs', file), executorInputPath(file),
join(dir, name, `main.kcl`) join(dir, name, `main.kcl`)
) )
} }
@ -1097,14 +1078,11 @@ test(
'file pane is scrollable when there are many files', 'file pane is scrollable when there are many files',
{ tag: '@electron' }, { tag: '@electron' },
async ({ browserName }, testInfo) => { async ({ browserName }, testInfo) => {
test.skip(
process.platform === 'win32',
'TODO: remove this skip https://github.com/KittyCAD/modeling-app/issues/3557'
)
const { electronApp, page } = await setupElectron({ const { electronApp, page } = await setupElectron({
testInfo, testInfo,
folderSetupFn: async (dir) => { folderSetupFn: async (dir) => {
await fsp.mkdir(`${dir}/testProject`, { recursive: true }) const testDir = join(dir, 'testProject')
await fsp.mkdir(testDir, { recursive: true })
const fileNames = [ const fileNames = [
'angled_line.kcl', 'angled_line.kcl',
'basic_fillet_cube_close_opposite.kcl', 'basic_fillet_cube_close_opposite.kcl',
@ -1168,8 +1146,8 @@ test(
] ]
for (const fileName of fileNames) { for (const fileName of fileNames) {
await fsp.copyFile( await fsp.copyFile(
`src/wasm-lib/tests/executor/inputs/${fileName}`, executorInputPath(fileName),
`${dir}/testProject/${fileName}` join(testDir, fileName)
) )
} }
}, },
@ -1210,19 +1188,16 @@ test(
'select all in code editor does not actually select all, just what is visible (regression)', 'select all in code editor does not actually select all, just what is visible (regression)',
{ tag: '@electron' }, { tag: '@electron' },
async ({ browserName }, testInfo) => { async ({ browserName }, testInfo) => {
test.skip(
process.platform === 'win32',
'TODO: remove this skip https://github.com/KittyCAD/modeling-app/issues/3557'
)
const { electronApp, page } = await setupElectron({ const { electronApp, page } = await setupElectron({
testInfo, testInfo,
folderSetupFn: async (dir) => { folderSetupFn: async (dir) => {
// src/wasm-lib/tests/executor/inputs/mike_stress_test.kcl // src/wasm-lib/tests/executor/inputs/mike_stress_test.kcl
const name = 'mike_stress_test' const name = 'mike_stress_test'
await fsp.mkdir(`${dir}/${name}`, { recursive: true }) const testDir = join(dir, name)
await fsp.mkdir(testDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
`src/wasm-lib/tests/executor/inputs/${name}.kcl`, executorInputPath(`${name}.kcl`),
`${dir}/${name}/main.kcl` join(testDir, 'main.kcl')
) )
}, },
}) })
@ -1320,27 +1295,16 @@ test.describe('Renaming in the file tree', () => {
'A file you have open', 'A file you have open',
{ tag: '@electron' }, { tag: '@electron' },
async ({ browser: _ }, testInfo) => { async ({ browser: _ }, testInfo) => {
test.skip(
process.platform === 'win32',
'TODO: remove this skip https://github.com/KittyCAD/modeling-app/issues/3557'
)
const { electronApp, page, dir } = await setupElectron({ const { electronApp, page, dir } = await setupElectron({
testInfo, testInfo,
folderSetupFn: async (dir) => { folderSetupFn: async (dir) => {
await fsp.mkdir(join(dir, 'Test Project'), { recursive: true }) await fsp.mkdir(join(dir, 'Test Project'), { recursive: true })
const exampleDir = join(
'src',
'wasm-lib',
'tests',
'executor',
'inputs'
)
await fsp.copyFile( await fsp.copyFile(
join(exampleDir, 'basic_fillet_cube_end.kcl'), executorInputPath('basic_fillet_cube_end.kcl'),
join(dir, 'Test Project', 'main.kcl') join(dir, 'Test Project', 'main.kcl')
) )
await fsp.copyFile( await fsp.copyFile(
join(exampleDir, 'cylinder.kcl'), executorInputPath('cylinder.kcl'),
join(dir, 'Test Project', 'fileToRename.kcl') join(dir, 'Test Project', 'fileToRename.kcl')
) )
}, },
@ -1425,27 +1389,16 @@ test.describe('Renaming in the file tree', () => {
'A file you do not have open', 'A file you do not have open',
{ tag: '@electron' }, { tag: '@electron' },
async ({ browser: _ }, testInfo) => { async ({ browser: _ }, testInfo) => {
test.skip(
process.platform === 'win32',
'TODO: remove this skip https://github.com/KittyCAD/modeling-app/issues/3557'
)
const { electronApp, page, dir } = await setupElectron({ const { electronApp, page, dir } = await setupElectron({
testInfo, testInfo,
folderSetupFn: async (dir) => { folderSetupFn: async (dir) => {
await fsp.mkdir(join(dir, 'Test Project'), { recursive: true }) await fsp.mkdir(join(dir, 'Test Project'), { recursive: true })
const exampleDir = join(
'src',
'wasm-lib',
'tests',
'executor',
'inputs'
)
await fsp.copyFile( await fsp.copyFile(
join(exampleDir, 'basic_fillet_cube_end.kcl'), executorInputPath('basic_fillet_cube_end.kcl'),
join(dir, 'Test Project', 'main.kcl') join(dir, 'Test Project', 'main.kcl')
) )
await fsp.copyFile( await fsp.copyFile(
join(exampleDir, 'cylinder.kcl'), executorInputPath('cylinder.kcl'),
join(dir, 'Test Project', 'fileToRename.kcl') join(dir, 'Test Project', 'fileToRename.kcl')
) )
}, },
@ -1527,10 +1480,6 @@ test.describe('Renaming in the file tree', () => {
`A folder you're not inside`, `A folder you're not inside`,
{ tag: '@electron' }, { tag: '@electron' },
async ({ browser: _ }, testInfo) => { async ({ browser: _ }, testInfo) => {
test.skip(
process.platform === 'win32',
'TODO: remove this skip https://github.com/KittyCAD/modeling-app/issues/3557'
)
const { electronApp, page, dir } = await setupElectron({ const { electronApp, page, dir } = await setupElectron({
testInfo, testInfo,
folderSetupFn: async (dir) => { folderSetupFn: async (dir) => {
@ -1538,19 +1487,12 @@ test.describe('Renaming in the file tree', () => {
await fsp.mkdir(join(dir, 'Test Project', 'folderToRename'), { await fsp.mkdir(join(dir, 'Test Project', 'folderToRename'), {
recursive: true, recursive: true,
}) })
const exampleDir = join(
'src',
'wasm-lib',
'tests',
'executor',
'inputs'
)
await fsp.copyFile( await fsp.copyFile(
join(exampleDir, 'basic_fillet_cube_end.kcl'), executorInputPath('basic_fillet_cube_end.kcl'),
join(dir, 'Test Project', 'main.kcl') join(dir, 'Test Project', 'main.kcl')
) )
await fsp.copyFile( await fsp.copyFile(
join(exampleDir, 'cylinder.kcl'), executorInputPath('cylinder.kcl'),
join(dir, 'Test Project', 'folderToRename', 'someFileWithin.kcl') join(dir, 'Test Project', 'folderToRename', 'someFileWithin.kcl')
) )
}, },
@ -1625,11 +1567,6 @@ test.describe('Renaming in the file tree', () => {
`A folder you are inside`, `A folder you are inside`,
{ tag: '@electron' }, { tag: '@electron' },
async ({ browser: _ }, testInfo) => { async ({ browser: _ }, testInfo) => {
test.skip(
process.platform === 'win32',
'TODO: remove this skip https://github.com/KittyCAD/modeling-app/issues/3557'
)
const exampleDir = join('src', 'wasm-lib', 'tests', 'executor', 'inputs')
const { electronApp, page, dir } = await setupElectron({ const { electronApp, page, dir } = await setupElectron({
testInfo, testInfo,
folderSetupFn: async (dir) => { folderSetupFn: async (dir) => {
@ -1638,11 +1575,11 @@ test.describe('Renaming in the file tree', () => {
recursive: true, recursive: true,
}) })
await fsp.copyFile( await fsp.copyFile(
join(exampleDir, 'basic_fillet_cube_end.kcl'), executorInputPath('basic_fillet_cube_end.kcl'),
join(dir, 'Test Project', 'main.kcl') join(dir, 'Test Project', 'main.kcl')
) )
await fsp.copyFile( await fsp.copyFile(
join(exampleDir, 'cylinder.kcl'), executorInputPath('cylinder.kcl'),
join(dir, 'Test Project', 'folderToRename', 'someFileWithin.kcl') join(dir, 'Test Project', 'folderToRename', 'someFileWithin.kcl')
) )
}, },
@ -1738,21 +1675,18 @@ test.describe('Deleting files from the file pane', () => {
`when main.kcl exists, navigate to main.kcl`, `when main.kcl exists, navigate to main.kcl`,
{ tag: '@electron' }, { tag: '@electron' },
async ({ browserName }, testInfo) => { async ({ browserName }, testInfo) => {
test.skip(
process.platform === 'win32',
'TODO: remove this skip https://github.com/KittyCAD/modeling-app/issues/3557'
)
const { electronApp, page } = await setupElectron({ const { electronApp, page } = await setupElectron({
testInfo, testInfo,
folderSetupFn: async (dir) => { folderSetupFn: async (dir) => {
await fsp.mkdir(`${dir}/testProject`, { recursive: true }) const testDir = join(dir, 'testProject')
await fsp.mkdir(testDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
'src/wasm-lib/tests/executor/inputs/cylinder.kcl', executorInputPath('cylinder.kcl'),
`${dir}/testProject/main.kcl` join(testDir, 'main.kcl')
) )
await fsp.copyFile( await fsp.copyFile(
'src/wasm-lib/tests/executor/inputs/basic_fillet_cube_end.kcl', executorInputPath('basic_fillet_cube_end.kcl'),
`${dir}/testProject/fileToDelete.kcl` join(testDir, 'fileToDelete.kcl')
) )
}, },
}) })

View File

@ -1,6 +1,13 @@
import { test, expect, Page } from '@playwright/test' import { test, expect, Page } from '@playwright/test'
import { join } from 'path'
import * as fsp from 'fs/promises' import * as fsp from 'fs/promises'
import { getUtils, setup, setupElectron, tearDown } from './test-utils' import {
getUtils,
setup,
setupElectron,
tearDown,
executorInputPath,
} from './test-utils'
import { TEST_CODE_TRIGGER_ENGINE_EXPORT_ERROR } from './storageStates' import { TEST_CODE_TRIGGER_ENGINE_EXPORT_ERROR } from './storageStates'
import { bracket } from 'lib/exampleKcl' import { bracket } from 'lib/exampleKcl'
@ -425,17 +432,14 @@ const sketch001 = startSketchAt([-0, -0])
`Network health indicator only appears in modeling view`, `Network health indicator only appears in modeling view`,
{ tag: '@electron' }, { tag: '@electron' },
async ({ browserName: _ }, testInfo) => { async ({ browserName: _ }, testInfo) => {
test.skip(
process.platform === 'win32',
'TODO: remove this skip https://github.com/KittyCAD/modeling-app/issues/3557'
)
const { electronApp, page } = await setupElectron({ const { electronApp, page } = await setupElectron({
testInfo, testInfo,
folderSetupFn: async (dir) => { folderSetupFn: async (dir) => {
await fsp.mkdir(`${dir}/bracket`, { recursive: true }) const bracketDir = join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
'src/wasm-lib/tests/executor/inputs/focusrite_scarlett_mounting_braket.kcl', executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
`${dir}/bracket/main.kcl` join(bracketDir, 'main.kcl')
) )
}, },
}) })

View File

@ -912,3 +912,7 @@ export async function createProjectAndRenameIt({
await page.getByLabel('checkmark').last().click() await page.getByLabel('checkmark').last().click()
} }
export function executorInputPath(fileName: string): string {
return join('src', 'wasm-lib', 'tests', 'executor', 'inputs', fileName)
}

View File

@ -1,6 +1,13 @@
import { test, expect } from '@playwright/test' import { test, expect } from '@playwright/test'
import * as fsp from 'fs/promises' import * as fsp from 'fs/promises'
import { getUtils, setup, setupElectron, tearDown } from './test-utils' import { join } from 'path'
import {
getUtils,
setup,
setupElectron,
tearDown,
executorInputPath,
} from './test-utils'
import { SaveSettingsPayload } from 'lib/settings/settingsTypes' import { SaveSettingsPayload } from 'lib/settings/settingsTypes'
import { TEST_SETTINGS_KEY, TEST_SETTINGS_CORRUPTED } from './storageStates' import { TEST_SETTINGS_KEY, TEST_SETTINGS_CORRUPTED } from './storageStates'
import * as TOML from '@iarna/toml' import * as TOML from '@iarna/toml'
@ -203,10 +210,11 @@ test.describe('Testing settings', () => {
const { electronApp, page } = await setupElectron({ const { electronApp, page } = await setupElectron({
testInfo, testInfo,
folderSetupFn: async (dir) => { folderSetupFn: async (dir) => {
await fsp.mkdir(`${dir}/bracket`, { recursive: true }) const bracketDir = join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
'src/wasm-lib/tests/executor/inputs/focusrite_scarlett_mounting_braket.kcl', executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
`${dir}/bracket/main.kcl` join(bracketDir, 'main.kcl')
) )
}, },
}) })