diff --git a/app/static/tests/e2e/code.etest.ts b/app/static/tests/e2e/code.etest.ts index 15e5741a..141819f9 100644 --- a/app/static/tests/e2e/code.etest.ts +++ b/app/static/tests/e2e/code.etest.ts @@ -1,6 +1,6 @@ import { expect, test, Page } from "@playwright/test"; import PlaywrightConfig from "../../playwright.config"; -import { writeCode } from "./utils"; +import {saveSessionTimeout, writeCode} from "./utils"; export const newValidCode = `## Derivatives deriv(y1) <- sigma * (y2 - y1) @@ -219,6 +219,7 @@ test.describe("Code Tab tests", () => { }); test("can reset code editor ", async ({ page }) => { + await page.waitForTimeout(saveSessionTimeout); const defaultCode = await page.innerText(".wodin-left .wodin-content .editor-container"); const invalidCode = "faker\n"; await writeCode(page, invalidCode); @@ -232,6 +233,7 @@ test.describe("Code Tab tests", () => { await expect(await page.innerText(".wodin-left .wodin-content #code-status")).toContain("Code is not valid"); await page.click("#reset-btn"); await page.waitForResponse((response) => response.url().includes("/odin")); + await page.waitForTimeout(saveSessionTimeout); expect(await page.innerText(".wodin-left .wodin-content .editor-container")).toBe(defaultCode); await expect(await page.innerText(".wodin-left .wodin-content #code-status")).toContain("Code is valid"); }); diff --git a/app/static/tests/e2e/sessions.etest.ts b/app/static/tests/e2e/sessions.etest.ts index 6fe334f2..624c2c39 100644 --- a/app/static/tests/e2e/sessions.etest.ts +++ b/app/static/tests/e2e/sessions.etest.ts @@ -11,12 +11,11 @@ import { realisticFitData, startModelFit, waitForModelFitCompletion, expectWodinPlotDataSummary, - expectCanRunMultiSensitivity + expectCanRunMultiSensitivity, saveSessionTimeout } from "./utils"; import PlaywrightConfig from "../../playwright.config"; const appUrl = "/apps/day2"; -const saveSessionTimeout = 3000; const enterSessionLabel = async (page: Page, dialogId: string, newLabel: string) => { await expect(await page.locator(`#${dialogId} #edit-session-label label`)).toBeVisible(); diff --git a/app/static/tests/e2e/utils.ts b/app/static/tests/e2e/utils.ts index fa272830..5b176fc7 100644 --- a/app/static/tests/e2e/utils.ts +++ b/app/static/tests/e2e/utils.ts @@ -1,5 +1,7 @@ import { expect, Page, Locator } from "@playwright/test"; +export const saveSessionTimeout = 3000; + export const newFitCode = `# JUST CHANGE A COMMENT initial(S) <- N - I_0 initial(E) <- 0