Skip to content

first prototype for electron based testsuite#14

Open
SimonDanisch wants to merge 6 commits into
mainfrom
sd/testsuite
Open

first prototype for electron based testsuite#14
SimonDanisch wants to merge 6 commits into
mainfrom
sd/testsuite

Conversation

@SimonDanisch

Copy link
Copy Markdown
Collaborator

Still need to decide on where to put it.
Would also be nice to have this with the bonito js"..." string macro.
Still has some code in it I would like to clean up.
Lets you record videos like this:
https://github.com/user-attachments/assets/4818f987-a038-4d02-ad41-41db7453a086

Code: https://github.com/SimonDanisch/BonitoWidgets.jl/blob/main/examples/walkthrough.jl

@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0.83682% with 237 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.51%. Comparing base (c57c6c8) to head (049ba04).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/testing.jl 0.82% 120 Missing ⚠️
src/recording.jl 0.00% 117 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #14       +/-   ##
===========================================
- Coverage   81.38%   55.51%   -25.88%     
===========================================
  Files           7        9        +2     
  Lines         505      744      +239     
===========================================
+ Hits          411      413        +2     
- Misses         94      331      +237     
Flag Coverage Δ
unittests 55.51% <0.83%> (-25.88%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Click the first visible match repeatedly until a JS predicate holds. For clicks
whose handler is wired asynchronously (a framework attaches onclick after the
element mounts), a lone synthetic click() can race ahead of the handler and be
dropped, so click + wait_for hangs forever. click_until re-clicks until the
awaited state appears.
Closing the IPC pipe is the graceful exit request, but a wedged headless
Electron (CI/xvfb, no dbus) can ignore it and keep running — orphaning its
process and libuv handle so the Julia process itself can't exit (manifested as
a test that passes then hangs until the job timeout). Kill it if still alive.
`Window` merges kwargs as TOP-LEVEL BrowserWindow options, so calling it as
`Window(app, url; options = Dict("show"=>false, …))` nested the dict under an
"options" key — `show` never reached `new BrowserWindow(opts)` and Electron's
default `show:true` won. Every "headless" (`show=false`) test window was
therefore actually visible and stole focus on the user's desktop. Pass
show/width/height/webPreferences as kwargs instead. Verified live via
`BrowserWindow.isVisible()`: nested → true (shows), kwargs → false (hidden).
A plain hidden (show=false) window has no on-screen surface, so Chromium
composites lazily (~1.5fps measured) — which starves requestAnimationFrame
even though timers and the main thread run full speed. That makes the
BonitoAgents scroll/animation e2e tests (momentum, follow-restore) run rAF
~40x slower than a real browser. offscreen=true switches to OSR, which drives
its own BeginFrame source at 60fps regardless of visibility. Opt-in (default
false) so screenshot-based suites keep the existing render path.
This Testing module exists to drive headless UI tests, where faithful rAF
timing matters: a plain hidden window starves requestAnimationFrame (~1.5fps),
OSR drives 60fps. So OSR is the correct default — consumers (e.g. BonitoAgents'
e2e harness) inherit it automatically; pass offscreen=false to opt out.
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.

1 participant