diff --git a/test/e2e/login.test.ts b/test/e2e/login.test.ts index 14bec49d..21fcbffc 100644 --- a/test/e2e/login.test.ts +++ b/test/e2e/login.test.ts @@ -2,12 +2,16 @@ import { test, expect } from "@playwright/test" import { CODE_SERVER_ADDRESS, PASSWORD } from "../utils/constants" test.describe("login", () => { - test.beforeEach(async ({ page }) => { - // TODO@jsjoeio reset the browser - await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" }) - }) + // Reset the browser so no cookies are persisted + // by emptying the storageState + const options = { + contextOptions: { + storageState: {}, + }, + } - test("should be able to login", async ({ page }) => { + test("should be able to login", options, async ({ page }) => { + await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" }) // Type in password await page.fill(".password", PASSWORD) // Click the submit button and login diff --git a/test/package.json b/test/package.json index 747f72f0..2c389c19 100644 --- a/test/package.json +++ b/test/package.json @@ -10,8 +10,11 @@ "jest": "^26.6.3", "jsdom": "^16.4.0", "node-fetch": "^2.6.1", - "playwright": "^1.8.0", + "playwright": "^1.11.0-next-alpha-apr-13-2021", "supertest": "^6.1.1", "ts-jest": "^26.4.4" + }, + "resolutions": { + "@playwright/test/playwright": "^1.11.0-next-alpha-apr-13-2021" } } diff --git a/test/yarn.lock b/test/yarn.lock index ffeda36a..d7e69732 100644 --- a/test/yarn.lock +++ b/test/yarn.lock @@ -3889,10 +3889,10 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -playwright@=1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.10.0.tgz#a14d295f1ad886caf4cc5e674afe03ac832066bc" - integrity sha512-b7SGBcCPq4W3pb4ImEDmNXtO0ZkJbZMuWiShsaNJd+rGfY/6fqwgllsAojmxGSgFmijYw7WxCoPiAIEDIH16Kw== +playwright@=1.10.0, playwright@^1.11.0-next-alpha-apr-13-2021: + version "1.11.0-next-alpha-apr-13-2021" + resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.11.0-next-alpha-apr-13-2021.tgz#f8398f3521cfe044389e3fc9bf48f14784789225" + integrity sha512-0aMrEvCUQ+W6f1zUyRts2dXl+rm1ICD57y9duwvibhV3gqiSxH3owQB0EGODOpTMPCP3c2W6FcQiJ9hElBbuig== dependencies: commander "^6.1.0" debug "^4.1.1" @@ -3908,24 +3908,6 @@ playwright@=1.10.0: stack-utils "^2.0.3" ws "^7.3.1" -playwright@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.8.0.tgz#8eca2250967ee892b9fdfec44e2358455ab0f8e3" - integrity sha512-urMJDLX92KawbkWKrt3chVVBPQsuuNwlS5St7I5YQENXAEItoyUqX7FjiYaoPgXifKqe1+BKC+7pBAq1QUkgSw== - dependencies: - commander "^6.1.0" - debug "^4.1.1" - extract-zip "^2.0.1" - https-proxy-agent "^5.0.0" - jpeg-js "^0.4.2" - mime "^2.4.6" - pngjs "^5.0.0" - progress "^2.0.3" - proper-lockfile "^4.1.1" - proxy-from-env "^1.1.0" - rimraf "^3.0.2" - ws "^7.3.1" - pngjs@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-4.0.1.tgz#f803869bb2fc1bfe1bf99aa4ec21c108117cfdbe"