Skip to content

Commit 0f16773

Browse files
committed
refactor: update password for login test
1 parent 177036b commit 0f16773

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- uses: microsoft/playwright-github-action@v1
3838
- name: Install dependencies and run tests
3939
run: |
40-
node code-server*-linux-amd64 &
40+
PASSWORD=e45432jklfdsab node code-server*-linux-amd64 &
4141
yarn
4242
yarn test
4343
pkill node

test/login.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { chromium, Page, Browser, BrowserContext } from "playwright"
22

3+
// NOTE: this is hard-coded and passed as an environment variable
4+
// See the test job in ci.yml
5+
const PASSWORD = "e45432jklfdsab"
6+
37
describe("login", () => {
48
let browser: Browser
59
let page: Page
@@ -20,6 +24,7 @@ describe("login", () => {
2024

2125
afterEach(async () => {
2226
await page.close()
27+
// Remove password from local storage
2328
await context.clearCookies()
2429
})
2530

@@ -31,15 +36,12 @@ describe("login", () => {
3136

3237
it("should be able to login with the password from config.yml", async () => {
3338
await page.goto("http://localhost:8080")
34-
// Get password
35-
const password = "helloworld"
3639
// Type in password
37-
await page.fill(".password", password)
40+
await page.fill(".password", PASSWORD)
3841
// Click the submit button and login
3942
await page.click(".submit")
4043
// See the editor
4144
const codeServerEditor = await page.isVisible(".monaco-workbench")
4245
expect(codeServerEditor).toBeTruthy()
43-
// Remove password from local storage
4446
})
4547
})

0 commit comments

Comments
 (0)