Skip to content

Commit 38b16c6

Browse files
committed
CR
1 parent d234075 commit 38b16c6

File tree

9 files changed

+64
-32
lines changed

9 files changed

+64
-32
lines changed

Makefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,11 +1103,6 @@ test-sh:
11031103
fi; \
11041104
bats $(BATSFLAGS) ./assets/aws/files/tests
11051105

1106-
1107-
.PHONY: test-e2e
1108-
test-e2e:
1109-
make -C e2e test
1110-
11111106
.PHONY: run-etcd
11121107
run-etcd:
11131108
docker build -f .github/services/Dockerfile.etcd -t etcdbox --build-arg=ETCD_VERSION=3.5.9 .
@@ -1906,4 +1901,4 @@ dump-preset-roles:
19061901

19071902
.PHONY: test-web-e2e
19081903
test-web-e2e: ensure-webassets
1909-
$(CGOFLAG) go test -tags=webassets_embed ./e2e/web-e2e_test.go
1904+
(cd e2e && pnpm install) && $(CGOFLAG) go test -tags=webassets_embed ./e2e/web-e2e_test.go

e2e/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ This directory contains the configuration and tests for end-to-end testing again
55
E2E tests should be run by a corresponding Go test in `web-e2e_test.go` and run
66
using `make test-web-e2e`. To run only the Playwright test directly, you'll need a Teleport instance running locally.
77

8+
Any test that involves an authenticated user should be run with a `START_URL` env variable that contains an invite link for the test user, this should be generated and provided by the corresponding Go test.
9+
810
### Setup
911

1012
Before being able to run any tests, you'll need to install the playwright package and the chromium browser.

e2e/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
"name": "playwright-e2e-testing",
33
"version": "1.0.0",
44
"description": "Playwright tests for e2e testing.",
5-
"main": "index.js",
65
"scripts": {
76
"test": "playwright test --project=chromium",
87
"report": "playwright show-report"
98
},
10-
"author": "",
11-
"license": "ISC",
9+
"license": "Apache-2.0",
1210
"devDependencies": {
1311
"@playwright/test": "^1.51.1"
1412
}

e2e/pnpm-lock.yaml

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/pnpm-workspace.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sharedWorkspaceLockfile: false

e2e/web-e2e_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@ import (
1717

1818
// TestSignup sets up a test instance of Teleport and runs a playwright test against it to test the signup flow.
1919
func TestSignup(t *testing.T) {
20-
setupAndRunBasicTest(t, "signup.spec.ts")
20+
makeBasicSetupAndRunTest(t, "signup.spec.ts")
2121
}
2222

2323
// TestCreateNewRole sets up a test instance of Teleport and a user to test role management in the UI.
2424
func TestRoleManagement(t *testing.T) {
25-
setupAndRunBasicTest(t, "roles.spec.ts")
25+
makeBasicSetupAndRunTest(t, "roles.spec.ts")
2626
}
2727

2828
// TestAuthConnectorManagement sets up a test instance of Teleport and a user to test auth connector management in the UI.
2929
func TestAuthConnectorManagement(t *testing.T) {
30-
setupAndRunBasicTest(t, "authconnectors.spec.ts")
30+
makeBasicSetupAndRunTest(t, "authconnectors.spec.ts")
3131
}
3232

33-
// setupAndRunBasicTest sets up a test instance of Teleport and a user with the access and editor roles and runs a playwright test.
33+
// makeBasicSetupAndRunTest sets up a test instance of Teleport and a user with the access and editor roles and runs a playwright test.
3434
// This is a helper function in cases where there is no additional backend setup required beyond creating an invite link.
35-
func setupAndRunBasicTest(t *testing.T, playwrightTest string) {
35+
func makeBasicSetupAndRunTest(t *testing.T, playwrightTest string) {
3636
rc, ctx := helpers.CreateTeleportTestInstance(t)
3737

3838
as := rc.Process.GetAuthServer()

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"test": "jest",
1818
"test-coverage": "jest --coverage && web/scripts/print-coverage-link.sh",
1919
"test-update-snapshot": "pnpm run test --updateSnapshot",
20-
"test-e2e": "pnpm --dir=./e2e test",
2120
"tdd": "jest --watch",
2221
"lint": "pnpm eslint && pnpm prettier-check",
2322
"lint-fix": "pnpm eslint --fix && pnpm prettier-write",
@@ -113,4 +112,4 @@
113112
"engines": {
114113
"node": "^22"
115114
}
116-
}
115+
}

pnpm-lock.yaml

Lines changed: 0 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ coverage
55
dist
66
**/dist
77
*DS_store
8-
certs
8+
certs

0 commit comments

Comments
 (0)