Simon Clematide
Make screencast recorder optional and disabled by default
be1f71a
|
Raw History Blame Contribute Delete
3.87 kB

A newer version of the Gradio SDK is available: 6.32.0

Upgrade

Browser Regression Checks

These checks exercise the real pinned CDN conllu.js, not a local parser copy. Use Python 3.13 with the dependencies in requirements.txt. Network access to jsDelivr is required. The Playwright CLI requires Node/npm and a browser.

Generate the deterministic preview and serve it from the repository root:

python tests/browser/build_preview.py
python -m http.server 8765 --bind 127.0.0.1

In another terminal, run the Gradio app with fixture UDPipe responses:

GRADIO_ANALYTICS_ENABLED=False python tests/browser/run_app.py
# Or to include the screencast panel for check_recorder.js:
# ENABLE_SCREENCAST=true GRADIO_ANALYTICS_ENABLED=False python tests/browser/run_app.py

In a third terminal, run the browser checks:

npx --package @playwright/cli playwright-cli open about:blank
npx --package @playwright/cli playwright-cli run-code --filename=tests/browser/check_preview.js
npx --package @playwright/cli playwright-cli run-code --filename=tests/browser/check_app.js
npx --package @playwright/cli playwright-cli run-code --filename=tests/browser/check_export.js

check_preview.js checks the browser parser API, token counts/spans, dependency relations, Unicode, HTML-like input, multiword tokens, optional empty nodes, sentence labels, custom arc color, white backgrounds, original tree fonts, rendered dimensions, hidden view controls, initial/reset zoom at 140%, zoom in/out, fullscreen, downloads, and visible errors when parser or renderer requests are blocked. Negative tests deliberately produce failed-request console messages. Screenshots and downloads are saved in the ignored output/playwright/ directory.

The preview checks also cover drag/keyboard panel resizing, retention of manual height after zoom, independent comparison frames, and double-click fit reset.

check_export.js checks the Annotate & Export tab: CoNLL-U output, the three download files, and rendering of edited CoNLL-U. It needs Playwright's Chromium for the Python server (python -m playwright install chromium).

check_app.js uses the real UI and callbacks, replacing only UDPipe responses. It checks English comparison, single mode, German model updates/comparison, repeated analysis, sample selection, and clearing stale trees after empty input. It also verifies that both single-line Sentence inputs retain the intentional 24px font and 36px line height; changing Gradio's input element must not reduce their visual prominence. The fixture server runs on port 7871; the static fixture server uses port 8765.

For live service verification, run python app.py and exercise the same modes with actual UDPipe responses. Check the hosted app through both its direct hf.space URL and its enclosing Hugging Face Space page. Verify downloads in both contexts; a local fixture pass does not establish hosted success.

The browser adapter exposes window.visualizerDiagnostics inside each tree frame for testing: pinned parser URL, stage, parser messages, and converted data. The main application does not expose these diagnostics as teaching controls.

The pinned parser flags standard output ending in two newlines as an empty sentence. The adapter normalizes trailing newlines to one terminator, preserving the raw CoNLL-U output and all internal sentence boundaries. This workaround should be revisited when updating the parser revision.

Open a local or hosted app and run the real-service checks:

npx --package @playwright/cli playwright-cli goto https://simon-clmtd-universal-dependencies-visualizer.hf.space
npx --package @playwright/cli playwright-cli run-code --filename=tests/browser/check_live.js

Repeat with the enclosing Space URL. This checks actual UDPipe responses, both languages, changing input, downloads, white tree backgrounds, original tree fonts, and Source Sans Pro for the UI.