Skip to content

Commit

Permalink
Adjust e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-gordon committed Aug 12, 2024
1 parent 54042be commit c19aba2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/e2e/not-logged-in.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ test("capabilities", async ({ page }) => {
).toBeVisible();
await page.click('[data-testid="close-dialog"]');

// Expect sandbox window to show (about 1 minute wait time)
// Expect sandbox warning to show
await expect(page.getByTestId("sandbox-warning")).toBeVisible({
timeout: 60000,
timeout: 25000, // 25 seconds
});
// Click on test id sandbox-warning-learn-more
await page.getByTestId("sandbox-warning-learn-more").click();
Expand Down
2 changes: 1 addition & 1 deletion app/e2e/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const BASE_URL = process.env.E2E_START_URL ?? "http://localhost:3000";
const EMAIL_DOMAINS_LIST: string[] = [];

export async function goToPath(page: Page, path = "") {
await page.goto(`${BASE_URL}${path ? `/${path}` : ""}?skipAnimation=true`);
await page.goto(`${BASE_URL}${path ? `/${path}` : ""}?isE2E=true`);

// If we're on the root route, also wait until the .monaco-editor is present
if (path === "") {
Expand Down
4 changes: 3 additions & 1 deletion app/src/pages/Sandbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ import { useEditorStore } from "../lib/useEditorStore";
import { getDefaultText } from "../lib/getDefaultText";
import { AiToolbar } from "../components/AiToolbar";

const SANDBOX_WARNING_TIME = 3 * 60 * 1000; // 3 minutes
const isE2E =
new URLSearchParams(window.location.search).get("isE2E") === "true";
const SANDBOX_WARNING_TIME = isE2E ? 20 * 1000 : 3 * 60 * 1000; // 10 seconds for E2E, 3 minutes otherwise

const Sandbox = memo(function Edit() {
// Wait 1 minute and trigger a sandbox modal overtop of the editor
Expand Down

0 comments on commit c19aba2

Please sign in to comment.