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

Update test to support new frontend UI #3188

Open
rgaiacs opened this issue Jan 23, 2025 · 1 comment
Open

Update test to support new frontend UI #3188

rgaiacs opened this issue Jan 23, 2025 · 1 comment

Comments

@rgaiacs
Copy link
Collaborator

rgaiacs commented Jan 23, 2025

BinderHub frontend UI migrated to vanilla HTML to React based app in jupyterhub/binderhub#1856. Because of this, the test

def test_proxy_page(helm_config, federation_url):
r = requests.get(federation_url)
r.raise_for_status()
assert "How it works" in r.text
requires re-design.

The "simplest" solution is to replace assert to check for

<div id="root"></div>

from https://github.com/jupyterhub/binderhub/blob/65f807c12c61aed2179293d1bd0f72d117e92793/binderhub/templates/page.html#L24. In this simplest solution will don't need to run the JavaScript. We only check that the React based app has a HTML anchor.

Alternatively, the assert can be replaced with a solution powered by an automation library for browser testing like

rgaiacs added a commit to rgaiacs/mybinder.org-deploy that referenced this issue Jan 23, 2025
@rgaiacs
Copy link
Collaborator Author

rgaiacs commented Jan 24, 2025

In #3189 (comment), @minrk suggested to use Playwright.

The continuous deployment run the test at

# Action Repo: https://github.com/nick-invision/retry
- name: "Stage 4: Verify staging works"
uses: nick-invision/retry@7152eba30c6575329ac0576536151aca5a72780e
with:
timeout_minutes: 10
max_attempts: 3
command: pytest -vx --color=yes --numprocesses=2 --release=${{ matrix.federation_member }} tests/

A couple of more steps documented at https://playwright.dev/python/docs/ci#github-actions will need to be added before the tests start.

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

No branches or pull requests

1 participant