-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(frontend): add Playwright test for project creation workflow (#1700
) * feat(gitignore): dont push .auth directory to github * feat(authentication): authentication setup * feat(e2e): create project UI flow code & test logo picture add * fix(test): uncomment login step * fix(createprojectosm): add js to test * fix(files): test geojson add * feat(createproject): create project workflow test setup * fix(authSetup): remove auth setup and its config * fix(createproject): add assertions & delete project after creation * fix(createproject): removed delete project step * fix(createproject): assertions add * build: bind port 9323 for playwright report, add depends_on api * docs: info about --service-ports for ui test report in browser * build: ensure playwright report bound to 0.0.0.0 interface * test: set playwright test url to http://ui:7051 * docs: info ui container must be rebuilt prior to tests * fix(user): remove user logs generation * fix(files): remove osm logo * fix(createprojectosm): remove create project test with osm login * fix(createproject): add tsignores * fix(createproject): update UI url * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * feat(authentication): authentication setup * feat(e2e): create project UI flow code & test logo picture add * test: set playwright test url to http://ui:7051 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix(createprojectosm): remove old create project test * fix(e2e): remove authSetup & logo file * fix(auth): remove auth log storage user.json file * fix(playwrightConfig): remove setup config * build: replace API_URL_OVERRIDE --> API_URL * build: add healthcheck for local ui container, with test depends_on * build: add docker compose override & just commands for e2e playwright tests * build: add test:interactive for frontend interactive testing * fix(backend): allow override of FMTM_DEV_PORT to be unset during tests * fix(backend): also remove refresh cookie on logout * refactor: remove demo tests for playwright * build: move ui-test service to separate dockerfile * test: fix use correct url for tests fmtm.dev.test * test: fix use FMTM Public Beta org during e2e test * ci: update gh-workflow versions 1.6.0 --> 2.0.0 * ci: update renamed deploy workflow (compose) * ci: add frontend e2e test workflow during pr and deploy * docs: add comment to frontend e2e test to trigger workflow * build: update justfile for running backend without docker * build: add cmd + entrypoint override for playwright compose api * test: reduce size of aoi for e2e project creation * ci: update playwright ci workflow to upload traces zip * test: update playwright config for ci, add browserName prop * test(frontend): only run project creation test in one browser (chromium) * style: fix sql formatting in backend sql block string * test: fix ensure project name is unique for multiple test runs * build(frontend): update dependency minor versions * test: update project creation e2e test to use task splitting algo * build(frontend): lock playwright to specific version (no flexible pinning) * test: remove uuid dependency from playwright tests, use Math.random * build: install playwright dependencies prior to running tests * ci: update to latest gh-workflow syntax for playwright * test: add CI=true for playwright command running in ci env * build: add network explicitly to playwright compose file * build: add playwright test debugging option * docs: update .env.example to use same odk creds as local * build: add dependency for proxy service during tests (for odk central) * ci: update e2e test run during build and deploy * ci: update all gh-workflows --> v2.0.5 --------- Co-authored-by: spwoodcock <sam.woodcock@protonmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
7c45dc5
commit 2afc4d0
Showing
28 changed files
with
920 additions
and
1,192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Uses hostname fmtm.dev.test for api and ui on same domain | ||
# otherwise tests will not work using the cookie for auth | ||
|
||
networks: | ||
fmtm-net: | ||
name: fmtm-${GIT_BRANCH:-local} | ||
|
||
services: | ||
api: | ||
hostname: fmtm.dev.test | ||
environment: | ||
# Run via alias fmtm.dev.test | ||
FMTM_DOMAIN: "fmtm.dev.test" | ||
# Do not use dev port, use port 80 | ||
FMTM_DEV_PORT: "false" | ||
# The ci image has overrides for CMD and ENTRYPOINT, so re-apply | ||
entrypoint: ["/app-entrypoint.sh"] | ||
# API_REPLICAS can be increased via CI env vars | ||
command: | ||
[ | ||
"uvicorn", | ||
"app.main:api", | ||
"--host", | ||
"0.0.0.0", | ||
"--port", | ||
"8000", | ||
"--workers", | ||
"1", | ||
"--log-level", | ||
"critical", | ||
"--no-access-log", | ||
] | ||
|
||
ui: | ||
# This hostname is used for Playwright test internal networking | ||
hostname: fmtm.dev.test | ||
environment: | ||
VITE_API_URL: "http://fmtm.dev.test:8000" | ||
command: --port 80 | ||
healthcheck: | ||
test: timeout 5s bash -c ':> /dev/tcp/127.0.0.1/80' || exit 1 | ||
interval: 5s | ||
retries: 3 | ||
start_period: 5s | ||
timeout: 5s | ||
|
||
ui-test: | ||
image: "mcr.microsoft.com/playwright:${PLAYWRIGHT_TAG:-v1.44.1}" | ||
depends_on: | ||
# Starts the proxy and all other services | ||
proxy: | ||
condition: service_healthy | ||
api: | ||
# Override: must be healthy before tests run | ||
condition: service_healthy | ||
# Override: must be healthy before tests run | ||
ui: | ||
condition: service_healthy | ||
working_dir: /app | ||
environment: | ||
DISPLAY: :0 | ||
volumes: | ||
- ./src/frontend:/app | ||
- /tmp/.X11-unix:/tmp/.X11-unix | ||
entrypoint: /bin/sh -c | ||
command: | ||
- | | ||
npm install --legacy-peer-deps | ||
npm run test:e2e | ||
ports: | ||
- "9323:9323" | ||
networks: | ||
- fmtm-net | ||
restart: "no" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.