coder/site/e2e
Michael Smith 3f21cb8a2f
fix: update API code to use Axios instances (#13029)
* fix: update API code to use Axios instance

* docs: fix typo

* fix: update all global axios imports to use Coder instance

* fix: remove needless import

* fix: update import order

* refactor: rename coderAxiosInstance to axiosInstance

* docs: update variable reference in FE contributing docs
2024-04-24 17:01:23 +00:00
..
tests test(site): add e2e tests for workspace proxies (#13009) 2024-04-19 14:45:52 +02:00
README.md test: add an e2e audit logs test (#12868) 2024-04-12 14:01:54 -06:00
api.ts test(site): add e2e tests for observability 2024-04-18 12:50:34 +02:00
constants.ts test(site): add e2e tests for workspace proxies (#13009) 2024-04-19 14:45:52 +02:00
expectUrl.ts test: fix url checks in e2e tests (#12881) 2024-04-11 15:48:53 -06:00
global.setup.ts test: fix url checks in e2e tests (#12881) 2024-04-11 15:48:53 -06:00
helpers.ts fix: update API code to use Axios instances (#13029) 2024-04-24 17:01:23 +00:00
hooks.ts chore: add e2e test against an external auth provider during workspace creation (#12985) 2024-04-18 19:43:10 +02:00
parameters.ts chore: sort imports in our typescript code (#12417) 2024-03-05 16:31:22 -07:00
playwright.config.ts chore: add e2e test against an external auth provider during workspace creation (#12985) 2024-04-18 19:43:10 +02:00
provisionerGenerated.ts feat: add owner groups to workspace data (#12841) 2024-04-05 15:06:17 -04:00
proxy.ts test(site): add e2e tests for workspace proxies (#13009) 2024-04-19 14:45:52 +02:00
reporter.ts fix: update API code to use Axios instances (#13029) 2024-04-24 17:01:23 +00:00

README.md

e2e

The structure of the end-to-end tests is optimized for speed and reliability. Not all tests require setting up a new PostgreSQL instance or using the Terraform provisioner. Deciding when to trade time for robustness rests with the developers; the framework's role is to facilitate this process.

Take a look at prior art in tests/ for inspiration. To run a test:

cd site
# Build the frontend assets. If you are actively changing
# the site to debug an issue, add `--watch`.
pnpm build
# Alternatively, build with debug info and source maps:
NODE_ENV=development pnpm vite build --mode=development
# Install the browsers to `~/.cache/ms-playwright`.
pnpm playwright:install
# Run E2E tests. You can see the configuration of the server
# in `playwright.config.ts`. This uses `go run -tags embed ...`.
pnpm playwright:test
# Run a specific test (`-g` stands for grep. It accepts regex).
pnpm playwright:test -g '<your test here>'

Using nix

If this breaks, it is likely because the flake chromium version and playwright are no longer compatible. To fix this, update the flake to get the latest chromium version, and adjust the playwright version in the package.json.

You can see the playwright version here: https://search.nixos.org/packages?channel=unstable&show=playwright-driver&from=0&size=50&sort=relevance&type=packages&query=playwright-driver

# Optionally add '--command zsh' to choose your shell.
nix develop
cd site
pnpm install
pnpm build
pnpm playwright:test

Enterprise tests

Enterprise tests require a license key to run.

export CODER_E2E_ENTERPRISE_LICENSE=<license key>

Debugging tests

To debug a test, it is more helpful to run it in ui mode.

pnpm playwright:test-ui