From b46859787208c3d2ff108976031172d5a5a88c5b Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Tue, 9 Mar 2021 16:33:01 -0700 Subject: [PATCH] refactor: move e2e tests to test/e2e --- test/{ => e2e}/e2e.test.ts | 2 +- test/{ => e2e}/goHome.test.ts | 8 ++++---- test/{ => e2e}/login.test.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) rename test/{ => e2e}/e2e.test.ts (89%) rename test/{ => e2e}/goHome.test.ts (92%) rename test/{ => e2e}/login.test.ts (93%) diff --git a/test/e2e.test.ts b/test/e2e/e2e.test.ts similarity index 89% rename from test/e2e.test.ts rename to test/e2e/e2e.test.ts index 21df386b..4e60c6eb 100644 --- a/test/e2e.test.ts +++ b/test/e2e/e2e.test.ts @@ -1,5 +1,5 @@ import { chromium, Page, Browser } from "playwright" -import { CODE_SERVER_ADDRESS } from "./constants" +import { CODE_SERVER_ADDRESS } from "../utils/constants" let browser: Browser let page: Page diff --git a/test/goHome.test.ts b/test/e2e/goHome.test.ts similarity index 92% rename from test/goHome.test.ts rename to test/e2e/goHome.test.ts index 40d6a838..b57b2a19 100644 --- a/test/goHome.test.ts +++ b/test/e2e/goHome.test.ts @@ -1,7 +1,7 @@ import { chromium, Page, Browser, BrowserContext, Cookie } from "playwright" -import { hash } from "../src/node/util" -import { CODE_SERVER_ADDRESS, PASSWORD, STORAGE } from "./constants" -import { createCookieIfDoesntExist } from "./helpers" +import { hash } from "../../src/node/util" +import { CODE_SERVER_ADDRESS, PASSWORD, STORAGE, E2E_VIDEO_DIR } from "../utils/constants" +import { createCookieIfDoesntExist } from "../utils/helpers" describe("go home", () => { let browser: Browser @@ -45,7 +45,7 @@ describe("go home", () => { context = await browser.newContext({ storageState: { cookies: maybeUpdatedCookies }, - recordVideo: { dir: "./test/videos/" }, + recordVideo: { dir: E2E_VIDEO_DIR }, }) }) diff --git a/test/login.test.ts b/test/e2e/login.test.ts similarity index 93% rename from test/login.test.ts rename to test/e2e/login.test.ts index b269acbd..ca098904 100644 --- a/test/login.test.ts +++ b/test/e2e/login.test.ts @@ -1,5 +1,5 @@ import { chromium, Page, Browser, BrowserContext } from "playwright" -import { CODE_SERVER_ADDRESS, PASSWORD } from "./constants" +import { CODE_SERVER_ADDRESS, PASSWORD } from "../utils/constants" describe("login", () => { let browser: Browser