Skip to content

Commit 5975f1b

Browse files
committed
Save auth state
1 parent 57f3d52 commit 5975f1b

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ site/build-storybook.log
2424
site/coverage/
2525
site/storybook-static/
2626
site/test-results/
27+
site/e2e/storageState.json
2728

2829
# Make target for updating golden files.
2930
cli/testdata/.gen-golden

site/e2e/playwright.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const config: PlaywrightTestConfig = {
1515
use: {
1616
baseURL: `http://localhost:${basePort}`,
1717
video: "retain-on-failure",
18+
// use stored login after first test
19+
storageState: "e2e/storageState.json"
1820
},
1921

2022
// `webServer` tells Playwright to launch a test server - more details here:

site/e2e/tests/login.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ test("Login takes user to /workspaces", async ({ baseURL, page }) => {
99
const signInPage = new SignInPage(baseURL, page)
1010
await signInPage.submitBuiltInAuthentication(email, password)
1111

12+
// Save login state so we don't have to log in for other tests
13+
await page.context().storageState({ path: 'e2e/storageState.json' })
14+
1215
await page.waitForSelector("text=Workspaces")
1316
})

0 commit comments

Comments
 (0)