-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial install of playwright visual tests * Close to working. * who knows... * after updates * Extend devcontainer docker compose file for playwright (#3192) * Extend devcontainer docker compose file for playwright Create another docker compose file for playwright. That new one extends the existing docker compose Should be able to run: `npm run pwtests` * adjust gh action * adjust gh action * remove volumes * add timeout * fix volumes * Fix docker compose environment * ignore stuff and volume mounting * Attempting to login reliably * Auto cleanups. * Finally starting to work * Thought it was getting better, but maybe not * Seems reliable now * Higher success rate * Add test of entering feature name. Remove new feature page content test. * Add playwright-report dir to Dockerfile. * Comment out mkdir -p /work/playwright-report line. * Update screenshots. * Increasing timeout for entering feature name * try running as user (#3248) * try running as user * again * try * change volume ownership * tidy up * Adjust login process to be more reliable. * Add 5 second delay before first test runs. * Wait longer for first login. * Add auto-logout during login if already logged in * Screenshot after login click * Add testName to screenshots. Upload artifacts. Fix form method="POST". * Add doc to README for Updating the test_html_rendering files. * Maybe increase chance of login. * Add a couple more delays. * Repeat auto-logout during login until no longer logged in, before logging in again. * Add some more delays. * Use loginButton.click(). Add delay before after-click screenshot. * Add console info an errors to login process. * Capture console messages, relay to terminal. * Capture console messages properly. * Add some more console messages during login. * Ignore error on jsonValue. * Reduce most delays. Add more logs. Add top-level playwright call. * More logging to figure out why login fails * More logging to detect if ever logged in. * Add more logging to each stage of testing * Use history.replaceState before changing location. * Use location.reload() after a timeout. * After login, just load home page. * Add playwright-report to artifacts. * Turn off playwright-report during CI * Log response after login * Only log first response after request that should log in. * Look for 'currentuser/permissions' request/response. * Delay after mock_login and before reload of home page * Comment out header and cookie logs. * Act like logged when in DEV_MODE and login attempted. * Fix mock mock login. * Undo fake mock_login. * rearrange docker (#3265) * Updates after changes by James. * Fix previous updates. * Remove pwtests-shutdown from "stop" command. * Remove pwtest from client-src/elements. (moved to packages/playwright/tests) * update paths for run.sh * Add pwtests-shutdown to top-level stop command. * Remove "playwright" from ./wait-for-app.sh * Add logging of user login status. * add playwright_display for debugging * add server debugging * Remove extra "/__screenshots__" in path. * Update the path for test-results artifacts in the playwright.yml * add health checks * fix action * fix run.sh * Add beforeAll method, disabled. * add dsadmin * Add top level pwtests command, not working yet. * cleanup and undo changes * use transactions * always reuse server * temp: limit the workers * Partial cleanup. Reduce timeouts and delays a bit. * More cleanup. Reduce timeout/delay. * Update the correct README file. Update html rendering tests. * Remove unnecessary changes. * set script-shell to fix source not found and call npm run setup (#3292) * set script-shell to fix source not found and call npm run setup There has always been `source: not found` in the previous CI jobs The tests previously worked because npm run deps installs the requirements into the default environment and not the virtual environment. And since we actually did not call `source` correctly, it was okay because the default environment had the packages installed. The problem started to arise because we started to call `source` correctly in some places but not all places. This fixes by setting the shell consistently whenever we call `source` More info: https://morgan.cugerone.com/blog/troubleshooting-source-not-found-when-in-the-context-of-package-json-scripts/ * do each separately * Revert "do each separately" This reverts commit 4fc75f7. * do ci job * consistent to the right datastore mode * verbose * kill the emulator * remove verbose * Reenable Google login * Finish reenabling Google signin button. Add margin for Firefox. * Only show Google signin if playwright is not active * Preserve url on login. Use default num of workers. Retry tests in CI * Some updates after comments * optimize docker changes * Rename account-indicator. Shorten some delays. * revert the workers * Make playwright.yml push and pull_request triggers be like others. * Use getByTestId instead of locator with data-testid. --------- Co-authored-by: James C Scott III <[email protected]> Co-authored-by: James Scott <[email protected]>
- Loading branch information
1 parent
0ac2427
commit 0baad0b
Showing
48 changed files
with
1,076 additions
and
93 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: '3.8' | ||
|
||
services: | ||
db: | ||
image: google/cloud-sdk:402.0.0-emulators | ||
restart: unless-stopped | ||
command: gcloud beta emulators datastore start --project=cr-status-staging --host-port 0.0.0.0:15606 --no-store-on-disk --use-firestore-in-datastore-mode | ||
|
||
dsadmin: | ||
image: ghcr.io/remko/dsadmin:v0.18.1 | ||
entrypoint: /ko-app/dsadmin -port 8888 | ||
depends_on: | ||
- db | ||
network_mode: service:db | ||
environment: | ||
DATASTORE_PROJECT_ID: cr-status-staging | ||
DATASTORE_EMULATOR_HOST: "db:15606" |
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,10 @@ | ||
cs-env | ||
node_modules | ||
test-results | ||
playwright-report/ | ||
playwright/.cache/ | ||
|
||
# Web test runner coverage report | ||
coverage | ||
|
||
__pycache__ |
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,27 @@ | ||
name: Playwright Tests | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
playwright: | ||
name: 'Playwright Tests' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
# Steps for Playwright testing with container | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Run your tests | ||
timeout-minutes: 15 | ||
run: npm run pwtests-shutdown --workspace=playwright; npm run test --workspace=playwright | ||
- uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: test-results | ||
path: packages/playwright/test-results/ | ||
retention-days: 30 |
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,24 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python: Remote Attach", | ||
"type": "python", | ||
"request": "attach", | ||
"connect": { | ||
"host": "localhost", | ||
"port": 5678 | ||
}, | ||
"pathMappings": [ | ||
{ | ||
"localRoot": "${workspaceFolder}", | ||
"remoteRoot": "/workspace" | ||
} | ||
], | ||
"justMyCode": false | ||
} | ||
] | ||
} |
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,37 @@ | ||
ARG PYTHON_VARIANT=3.11-bullseye | ||
FROM python:${PYTHON_VARIANT} as app | ||
|
||
RUN groupadd -g 1001 appuser && \ | ||
useradd appuser -u 1001 -g 1001 -m -d /home/appuser -s /bin/bash | ||
|
||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
# openapi-generator-cli dependencies | ||
&& apt-get install -y openjdk-17-jre | ||
|
||
USER appuser | ||
|
||
# Install node | ||
ENV NVM_DIR=/home/appuser/.nvm \ | ||
# Need the full major.minor.patch version for NODE_VERISON | ||
# https://nodejs.org/en/download/releases | ||
NODE_VERSION=18.17.1 | ||
|
||
RUN mkdir /home/appuser/.nvm && \ | ||
curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash \ | ||
&& . $NVM_DIR/nvm.sh \ | ||
&& nvm install $NODE_VERSION \ | ||
&& nvm alias default $NODE_VERSION \ | ||
&& nvm use default \ | ||
&& npm config set script-shell bash | ||
|
||
ENV NODE_PATH=$NVM_DIR/v$NODE_VERSION/lib/node_modules \ | ||
PATH="${PATH}:$NVM_DIR/versions/node/v$NODE_VERSION/bin" | ||
|
||
WORKDIR /workspace | ||
# Cache the infrequent but time consuming changes early | ||
COPY --chown=appuser:appuser requirements.txt requirements.dev.txt package.json package-lock.json /workspace/ | ||
COPY --chown=appuser:appuser openapi /workspace/openapi/ | ||
COPY --chown=appuser:appuser gen /workspace/gen/ | ||
RUN npm install -g gulp-cli && npm run setup && cs-env/bin/python -m pip install debugpy==1.6.7.post1 | ||
# Copy the rest | ||
COPY --chown=appuser:appuser . /workspace |
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.