Run End-to-End (e2e) integration tests
mainTo run the e2e testing suite against a deployed application, you must first deploy the example application using SST, export the resulting URLs from the SST outputs, and then execute the test command from the packages/tests-e2e directory.
Note: The test suite covers three permutations:
- App Router project: located in
tests/appDirOnlyandexamples/app-router. - Pages Router project: located in
tests/pagesOnlyandexamples/pages-router. - App + Pages Router project: located in
tests/appDirAndPagesandexamples/app-pages-router.
# 1. Deploy the app
cd examples/sst
npx sst deploy --stage e2e
# 2. Export the URLs
export APP_ROUTER_URL=$(jq -r '.["e2e-example-AppRouter"].url' .sst/outputs.json)
export PAGES_ROUTER_URL=$(jq -r '.["e2e-example-PagesRouter"].url' .sst/outputs.json)
export APP_PAGES_ROUTER_URL=$(jq -r '.["e2e-example-AppPagesRouter"].url' .sst/outputs.json)
# 3. Run the test
cd ../../packages/tests-e2e
pnpm run e2e:dev