Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some playwright ui tests #33

Merged
merged 11 commits into from
Nov 7, 2024
Merged

Add some playwright ui tests #33

merged 11 commits into from
Nov 7, 2024

Conversation

ianthomas23
Copy link
Member

Add some playwright ui tests, following a similar approach to that used in jupyterlite and pyodide-kernel repositories. Currently there are tests for:

  • loading and activating the extension
  • opening a new terminal
  • creating a new file
  • visual image tests for an empty terminal and one after running a few commands

Note hiding file modification times so that tests are repeatable.

More tests will be added in future.

Fixes #20.

Copy link

vercel bot commented Nov 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
jupyterlite-terminal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 7, 2024 0:55am

@ianthomas23 ianthomas23 added the enhancement New feature or request label Nov 6, 2024
@@ -106,14 +106,17 @@ jobs:
- name: Install the extension
run: |
set -eux
python -m pip install --pre jupyterlite-core
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there could be a pin on jupyterlite-core here, as new versions may bring some visual changes that would make the UI tests fail?

For example jupyterlite-core==0.5.0 will be based on JupyterLab 4.3 and Notebook 7.3, which may have some CSS changes compared to jupyterlite-core==0.4.x.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'll do that.

@ianthomas23
Copy link
Member Author

please update snapshots

@ianthomas23
Copy link
Member Author

please update snapshots

@ianthomas23
Copy link
Member Author

I've moved the deployment-related files into their own deploy directory. Without this running jupyter lite build in the top-level directory finds ui-tests/jupyter-lite.json which causes problems. So now creating a deployment needs to be preceded by cd deploy.

I have tried to modify vercel.json to deal with this extra directory but I evidently haven't done this correctly and I cannot access the vercel build logs. @jtpio Could you take a look at this when you have some time? I think it should just involve changing a couple of the build settings in vercel rather than in the local vercel.json file.

@jtpio
Copy link
Member

jtpio commented Nov 7, 2024

I've moved the deployment-related files into their own deploy directory

Great, that's something I wanted to do at some point as a follow- up to #28 👍

Without this running jupyter lite build in the top-level directory finds ui-tests/jupyter-lite.json which causes problems

Right, it looks related to this issue in JupyterLite: jupyterlite/jupyterlite#1095

jupyterlab>=4,<5
jupyterlite-core>=0.4,<0.5
jupyterlite-pyodide-kernel
.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we need to update to get the extension from the parent directory now:

Suggested change
.
..

@jtpio
Copy link
Member

jtpio commented Nov 7, 2024

I updated the project settings to the following on Vercel:

image

@ianthomas23
Copy link
Member Author

Thanks @jtpio, it is all working now.

Copy link
Member

@jtpio jtpio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ianthomas23 ianthomas23 merged commit f97824b into main Nov 7, 2024
10 checks passed
@ianthomas23 ianthomas23 deleted the ui-tests branch November 7, 2024 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add playwright image tests
2 participants