Simplify test until we can get snapshots/traces working in electron tests

This commit is contained in:
Frank Noirot
2024-08-14 02:24:17 +02:00
parent 8e5c0ed1f2
commit 8785fde3d9
3 changed files with 21 additions and 40 deletions

View File

@ -625,7 +625,13 @@ export async function setup(
})
await context.addInitScript(
async ({ token, settingsKey, settings, appSettingsFileKey, appSettingsFileContent }) => {
async ({
token,
settingsKey,
settings,
appSettingsFileKey,
appSettingsFileContent,
}) => {
localStorage.setItem('TOKEN_PERSIST_KEY', token)
localStorage.setItem('persistCode', ``)
localStorage.setItem(settingsKey, settings)
@ -635,7 +641,8 @@ export async function setup(
{
token: secrets.token,
appSettingsFileKey: TEST_SETTINGS_FILE_KEY,
appSettingsFileContent: overrideDirectory || TEST_SETTINGS.app.projectDirectory,
appSettingsFileContent:
overrideDirectory || TEST_SETTINGS.app.projectDirectory,
settingsKey: TEST_SETTINGS_KEY,
settings: TOML.stringify({
...TEST_SETTINGS,
@ -651,11 +658,7 @@ export async function setup(
await page.emulateMedia({ reducedMotion: 'reduce' })
}
export async function setupElectron({
testInfo,
}: {
testInfo: TestInfo
}) {
export async function setupElectron({ testInfo }: { testInfo: TestInfo }) {
// create or otherwise clear the folder
const projectDirName = testInfo.outputPath('electron-test-projects-dir')
try {
@ -691,4 +694,4 @@ export async function setupElectron({
await setup(context, page, projectDirName)
return { electronApp, page }
}
}