forked from jupyterlab/jupyter-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add basic e2e testing setup * adjust execute test step name * test sidebar chat icon, add testing class * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add sidebar snapshot * test chat sidepanel, extend helper class * adjust welcome message test, add snapshot * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * adjust naming * removeempty line * move ui-tests to packages/jupyter-ai/ * update e2e ci workflow for ui-tests folder move * update ui-tests folder location for yarn.lock hash * run lint locally * Add "Update Playwright Snapshots" CI workflow * change if clause * specify npm client * remove report and artifact specifiers * Update README.md to have correct commands and folders * update e2e/integration test README * Add Integration / E2E testing section to the docs * update wording of docs on snapshots * Ignore all non-linux snapshots * Update packages/jupyter-ai/ui-tests/README.md Co-authored-by: Piyush Jain <[email protected]> * remove cd command that would return users back to root * remove cd ../../../ * Remove repeating setup instructions * Add suggestion to generate snapshots before the 1st run * remove unnecessary link anchor * remove rudimentary jlpm build --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Piyush Jain <[email protected]>
- Loading branch information
1 parent
640f36c
commit 8f3bfe0
Showing
13 changed files
with
4,649 additions
and
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: E2E Tests | ||
|
||
# suppress warning raised by https://github.com/jupyter/jupyter_core/pull/292 | ||
env: | ||
JUPYTER_PLATFORM_DIRS: '1' | ||
|
||
on: | ||
push: | ||
branches: main | ||
pull_request: | ||
branches: '*' | ||
|
||
jobs: | ||
e2e-tests: | ||
name: Linux | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Base Setup | ||
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
|
||
- name: Install extension dependencies and build the extension | ||
run: ./scripts/install.sh | ||
|
||
- name: Install ui-tests dependencies | ||
working-directory: packages/jupyter-ai/ui-tests | ||
env: | ||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | ||
run: jlpm install | ||
|
||
- name: Set up browser cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
${{ github.workspace }}/pw-browsers | ||
key: ${{ runner.os }}-${{ hashFiles('packages/jupyter-ai/ui-tests/yarn.lock') }} | ||
|
||
- name: Install browser | ||
working-directory: packages/jupyter-ai/ui-tests | ||
run: jlpm install-chromium | ||
|
||
- name: Execute e2e tests | ||
working-directory: packages/jupyter-ai/ui-tests | ||
run: jlpm test | ||
|
||
- name: Upload Playwright Test report | ||
if: always() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: jupyter-ai-playwright-tests-linux | ||
path: | | ||
packages/jupyter-ai/ui-tests/test-results | ||
packages/jupyter-ai/ui-tests/playwright-report |
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,52 @@ | ||
name: Update Playwright Snapshots | ||
|
||
on: | ||
issue_comment: | ||
types: [created, edited] | ||
workflow_dispatch: | ||
inputs: | ||
number: | ||
description: 'PR number' | ||
required: true | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
update-snapshots: | ||
if: ${{ github.event.inputs || (github.event.issue.pull_request && contains(github.event.comment.body, 'please update playwright snapshots')) }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Configure git to use https | ||
run: git config --global hub.protocol https | ||
|
||
- name: Checkout the branch from the PR that triggered the job | ||
run: hub pr checkout ${{ github.event.inputs.number || github.event.issue.number }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Base Setup | ||
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
|
||
- name: Install extension dependencies and build the extension | ||
run: ./scripts/install.sh | ||
|
||
- uses: jupyterlab/maintainer-tools/.github/actions/update-snapshots@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
start_server_script: 'null' | ||
test_folder: packages/jupyter-ai/ui-tests | ||
npm_client: jlpm | ||
|
||
- name: Comment back on the PR | ||
run: | | ||
hub api repos/${{ github.repository }}/issues/${{ github.event.inputs.number || github.event.issue.number }}/comments --raw-field 'body=Playwright snapshots updated.' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
@@ -1,13 +1,16 @@ | ||
{ | ||
"name": "jupyter_ai-ui-tests", | ||
"name": "jupyter-ai-e2e-tests", | ||
"version": "1.0.0", | ||
"description": "JupyterLab jupyter_ai Integration Tests", | ||
"description": "Jupyter AI E2E tests", | ||
"private": true, | ||
"scripts": { | ||
"start": "jupyter lab --config jupyter_server_test_config.py", | ||
"test": "jlpm playwright test" | ||
"install-chromium": "jlpm playwright install chromium", | ||
"test": "jlpm playwright test", | ||
"test:update": "jlpm playwright test --update-snapshots" | ||
}, | ||
"devDependencies": { | ||
"@jupyterlab/galata": "^4.3.0" | ||
"@jupyterlab/galata": "^5.0.5", | ||
"@playwright/test": "^1.37.0" | ||
} | ||
} |
Oops, something went wrong.