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 playwright based UI integration tests for existing UI #1891

Merged
merged 5 commits into from
Dec 9, 2024

Conversation

yuvipanda
Copy link
Collaborator

@yuvipanda yuvipanda commented Dec 7, 2024

Primarily written to make UI testing easier in #1856, and
steals code from there

  • Add a new 'integration-tests' directory that does white box
    UI testing
  • Install dockerspawner in dev-requirements, as the playwright
    integration tests now need it
  • Move loading and about page tests to use playwright
  • Add some tests for the home page
  • Use a single instance of local-binder-local-hub for doing thes
    integration tests
  • Upload playwright traces (https://playwright.dev/python/docs/trace-viewer)
    on failure as a github artifact so we can debug things better
  • Split some more tests out of test_main.py, so we can get rid of it as part of Rewrite the frontend #1856

@yuvipanda yuvipanda requested review from manics and minrk December 7, 2024 03:46
@yuvipanda yuvipanda changed the title Dynamically determine port binderhub listens on Add playwright based UI integration tests for existing UI Dec 7, 2024
@yuvipanda yuvipanda force-pushed the binderhub-local branch 11 times, most recently from 8a5e565 to 9a5f4f3 Compare December 7, 2024 08:08
@yuvipanda yuvipanda mentioned this pull request Dec 7, 2024
32 tasks
yuvipanda and others added 3 commits December 7, 2024 10:42
Allows using this in integration tests
- Add a new 'integration-tests' directory that does white box
  UI testing
- Install dockerspawner in dev-requirements, as the playwright
  integration tests now need it
- Move loading and about page tests to use playwright
- Add some tests for the home page
- Use a single instance of local-binder-local-hub for doing thes
  integration tests
- Upload playwright traces (https://playwright.dev/python/docs/trace-viewer)
  on failure so we can debug things better

Co-authored-by: Oliver Roick <[email protected]>


def pytest_configure(config):
# Required for playwright to be run from within pytest
Copy link
Member

Choose a reason for hiding this comment

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

The alternative to this is to use async tests with the playwright async API. That's what we use in the jupyterhub tests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@minrk oooh, this led me down a hole and I ended up opening #1894 to not derail this PR.

Copy link
Member

@minrk minrk left a comment

Choose a reason for hiding this comment

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

Nice! I won't merge myself because I don't know how this will interact with #1856, but feel free to go ahead.

@yuvipanda
Copy link
Collaborator Author

I opened #1894 to handle follow-up task around asyncio.

Ty for the review @minrk! I'm going to merge this now, and then rebase #1856 on top!

@yuvipanda yuvipanda merged commit 82d2268 into jupyterhub:main Dec 9, 2024
14 checks passed
consideRatio pushed a commit to jupyterhub/helm-chart that referenced this pull request Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants