File tree 3 files changed +20
-23
lines changed
3 files changed +20
-23
lines changed Original file line number Diff line number Diff line change @@ -3,19 +3,9 @@ set -euo pipefail
3
3
4
4
main () {
5
5
cd " $( dirname " $0 " ) /../.."
6
- # We must keep jest in a sub-directory. See ../../test/package.json for more
7
- # information. We must also run it from the root otherwise coverage will not
8
- # include our source files.
9
- if [[ -z ${PASSWORD-} ]] || [[ -z ${CODE_SERVER_ADDRESS-} ]]; then
10
- echo " The end-to-end testing suites rely on your local environment"
11
- echo -e " \n"
12
- echo " Please set the following environment variables locally:"
13
- echo " \$ PASSWORD"
14
- echo " \$ CODE_SERVER_ADDRESS"
15
- echo -e " \n"
16
- exit 1
17
- fi
18
- CS_DISABLE_PLUGINS=true ./test/node_modules/.bin/jest " $@ " --config ./test/jest.e2e.config.ts --runInBand
6
+ cd test
7
+ # TODO@jsjoeio remove the test-match
8
+ PASSWORD=e45432jklfdsab CODE_SERVER_ADDRESS=http://localhost:8080 yarn folio --config=config.ts --test-match login.test.ts --reporter=list
19
9
}
20
10
21
11
main " $@ "
Original file line number Diff line number Diff line change @@ -2,12 +2,16 @@ import { test, expect } from "@playwright/test"
2
2
import { CODE_SERVER_ADDRESS } from "../utils/constants"
3
3
4
4
test . describe ( "login page" , ( ) => {
5
- test . beforeEach ( async ( { page } ) => {
6
- // TODO@jsjoeio reset context somehow
7
- await page . goto ( CODE_SERVER_ADDRESS , { waitUntil : "networkidle" } )
8
- } )
5
+ // Reset the browser so no cookies are persisted
6
+ // by emptying the storageState
7
+ const options = {
8
+ contextOptions : {
9
+ storageState : { } ,
10
+ } ,
11
+ }
9
12
10
- test ( "should see the login page" , async ( { page } ) => {
13
+ test ( "should see the login page" , options , async ( { page } ) => {
14
+ await page . goto ( CODE_SERVER_ADDRESS , { waitUntil : "networkidle" } )
11
15
// It should send us to the login page
12
16
expect ( await page . title ( ) ) . toBe ( "code-server login" )
13
17
} )
Original file line number Diff line number Diff line change @@ -2,12 +2,15 @@ import { test, expect } from "@playwright/test"
2
2
import { CODE_SERVER_ADDRESS , PASSWORD } from "../utils/constants"
3
3
4
4
test . describe ( "logout" , ( ) => {
5
- test . beforeEach ( async ( { page } ) => {
6
- // TODO@jsjoeio reset context
5
+ // Reset the browser so no cookies are persisted
6
+ // by emptying the storageState
7
+ const options = {
8
+ contextOptions : {
9
+ storageState : { } ,
10
+ } ,
11
+ }
12
+ test ( "should be able login and logout" , options , async ( { page } ) => {
7
13
await page . goto ( CODE_SERVER_ADDRESS , { waitUntil : "networkidle" } )
8
- } )
9
-
10
- test ( "should be able login and logout" , async ( { page } ) => {
11
14
// Type in password
12
15
await page . fill ( ".password" , PASSWORD )
13
16
// Click the submit button and login
You can’t perform that action at this time.
0 commit comments