Skip to content

fix(e2e): replace SSR server with WASM static server, fix deep-link query stripping, run E2E/PageSpeed in CD#136

Merged
gfauredev merged 3 commits intomainfrom
copilot/remove-server-web-e2e-test
Apr 8, 2026
Merged

fix(e2e): replace SSR server with WASM static server, fix deep-link query stripping, run E2E/PageSpeed in CD#136
gfauredev merged 3 commits intomainfrom
copilot/remove-server-web-e2e-test

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

Removes Lighthouse and web E2E from CI. Moves them to CD, triggered after each successful Pages deploy. Fixes the web E2E test suite so all 20 Maestro flows pass locally via nix run .#webE2eTest.

Key changes

CI/CD pipeline (ci.yml, cd.yml)

  • Removed e2e-web and Lighthouse jobs from CI
  • Added pagespeed job to CD: calls PageSpeed Insights API on the live preview URL after each Pages deploy
  • Added e2e-web-preview job to CD: runs Maestro flows against the live preview URL after each Pages deploy (screenshot upload commented out)

Nix (flake.nix)

  • Commented out server and webE2eTest from the default package (not needed for plain builds)
  • Added webStaticServer package: a Python SPA server that serves the WASM web package at /LogOut/ with SPA fallback and database.example/ at /db/ — same origin, no CORS
  • webE2eTest now uses webStaticServer instead of the SSR-only server binary (which had no WASM and caused all client-side assertions to fail)
  • Added webE2eTestPreview for running flows against a deployed URL

Deep-link query param fix (src/main.rs, src/utils.rs)

Dioxus's WebHistory::new() calls history.replaceState during init, stripping ?dl_db_url=… / ?dl_session=… from window.location before DeepLinkLayout.use_hook can read them.

Fix: capture window.location.search in App() — which runs before the Router mounts — into a new InitialQuerySignal context. DeepLinkLayout reads deep-link params from this preserved string via the new parse_web_deep_link_query(query: &str) helper.

// App() body — runs before Router mounts and strips the URL
use_context_provider(|| {
    let q = web_sys::window()
        .and_then(|w| w.location().search().ok())
        .filter(|s| !s.is_empty())
        .unwrap_or_default();
    InitialQuerySignal(Signal::new(q))
});
// DeepLinkLayout.use_hook — reads preserved query instead of window.location.search
let query_str = consume_context::<InitialQuerySignal>().0.read().clone();
let Some(action) = utils::parse_web_deep_link_query(query_str.trim_start_matches('?')) else { return; };

Maestro flows (maestro/web/)

  • All 22 flow files: replaced hard-coded http://localhost:8080 with ${APP_URL} / ${APP_URL_ENCODED} and ${DB_URL} / ${DB_URL_ENCODED} env-var references
  • Fixed dl_db_urldl_db_url=${DB_URL_ENCODED} in exercise-DB deep links (separate concern from the app URL)
  • Fixed test 08 stale placeholder text to match current en.ftl: search-placeholder = Search exercises names or attributes

Engineering Principles

  • PR only contains changes strictly related to the requested feature or fix,
    scope is focused (no unrelated dependency updates or formatting)
  • This code totally respects README's Engineering Principles

CI/CD Readiness

  • Branch follows Conventional Branch: feat/…, fix/…, refactor/…, …
  • Code is formatted with dx fmt; cargo fmt
  • All checks pass, nix flake checks succeeds without warnings
    • Code compiles, dx build with necessary platform flags succeeds
    • cargo clippy -- -D warnings -W clippy::all -W clippy::pedantic
      produces zero warnings
    • All unit tests pass without warnings
      cargo llvm-cov nextest --ignore-filename-regex '(src/components/|\.cargo/registry/|nix/store)'
    • End-to-end tests pass maestro test --headless maestro/web
      maestro test --headless maestro/android

Copilot AI and others added 3 commits April 7, 2026 13:49
…TestPreview

Agent-Logs-Url: https://github.com/gfauredev/LogOut/sessions/0f6378fd-9596-4c0b-ad61-8ca333b9a78d

Co-authored-by: gfauredev <19304085+gfauredev@users.noreply.github.com>
…n test files

Agent-Logs-Url: https://github.com/gfauredev/LogOut/sessions/0f6378fd-9596-4c0b-ad61-8ca333b9a78d

Co-authored-by: gfauredev <19304085+gfauredev@users.noreply.github.com>
…ms before router strips them

Agent-Logs-Url: https://github.com/gfauredev/LogOut/sessions/8b56abd0-c183-4283-afd6-4eb71b62c82b

Co-authored-by: gfauredev <19304085+gfauredev@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

📊 Coverage Report

Lines: 3754/5005 (75.004995004995%)

⏱️ Tests: 255 tests in 0.568s

FilenameFunction CoverageLine CoverageRegion CoverageBranch Coverage
main.rs
  22.00% (11/50)
  58.94% (155/263)
  60.56% (218/360)
- (0/0)
models/analytics.rs
   0.00% (0/6)
   0.00% (0/34)
   0.00% (0/46)
- (0/0)
models/enums.rs
 100.00% (28/28)
 100.00% (147/147)
 100.00% (337/337)
- (0/0)
models/exercise.rs
  92.00% (46/50)
  92.10% (548/595)
  91.01% (749/823)
- (0/0)
models/log.rs
 100.00% (12/12)
 100.00% (118/118)
 100.00% (144/144)
- (0/0)
models/mod.rs
 100.00% (11/11)
 100.00% (68/68)
 100.00% (98/98)
- (0/0)
models/session.rs
  72.22% (13/18)
  84.36% (151/179)
  83.33% (210/252)
- (0/0)
models/units.rs
 100.00% (28/28)
 100.00% (167/167)
  98.88% (353/357)
- (0/0)
services/app_state.rs
   1.89% (1/53)
   2.54% (11/433)
   2.32% (15/646)
- (0/0)
services/exercise_db.rs
  88.81% (127/143)
  90.30% (1210/1340)
  89.61% (1924/2147)
- (0/0)
services/exercise_loader.rs
   0.00% (0/14)
   0.00% (0/100)
   0.00% (0/135)
- (0/0)
services/native_queue.rs
   0.00% (0/15)
   0.00% (0/145)
   0.00% (0/197)
- (0/0)
services/notifications.rs
   0.00% (0/3)
   0.00% (0/9)
   0.00% (0/10)
- (0/0)
services/service_worker.rs
 100.00% (2/2)
 100.00% (6/6)
 100.00% (6/6)
- (0/0)
services/storage.rs
  63.77% (88/138)
  80.97% (766/946)
  83.53% (1187/1421)
- (0/0)
services/wake_lock.rs
 100.00% (2/2)
 100.00% (5/5)
 100.00% (5/5)
- (0/0)
utils.rs
  89.61% (69/77)
  89.33% (402/450)
  90.14% (640/710)
- (0/0)
Totals
  67.38% (438/650)
  75.00% (3754/5005)
  76.50% (5886/7694)
- (0/0)

@gfauredev gfauredev merged commit 8a3cbc6 into main Apr 8, 2026
8 checks passed
@gfauredev gfauredev deleted the copilot/remove-server-web-e2e-test branch April 8, 2026 06:52
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