Skip to content

BaseTestCase route helpers: web root paths, optional placeholders, no-app error - #720

Merged
lmajano merged 2 commits into
developmentfrom
claude/bx-playwright-research-plan-ddfqpm
Oct 10, 2026
Merged

lmajano merged 2 commits into
developmentfrom
claude/bx-playwright-research-plan-ddfqpm

Conversation

@lmajano

@lmajano lmajano commented Oct 10, 2026

Copy link
Copy Markdown
Member

Description

Follow-up to #708 from the release review of the browser testing route helpers.

  • Web root paths. routeURL(), visitRoute() and assertRouteIs() included the app mapping (/root/users/5/) once a request had run, because the routing base URL uses appMapping when webMapping is empty. The appMapping is a mapping, not a web path, so the helpers now drop it. When an app is served from a sub folder, webMapping keeps the base path.
  • Optional placeholders. With params, /posts/:id? resolved to the base route (findRouteByName keeps the last one) and dropped the param. The helpers now pick the longest variant the params fill. A root route gives /, not //.
  • No app loaded. The helpers throw BaseTestCase.NoColdBoxApp with a clear message. A module that is not loaded throws InvalidArgumentException.
  • assertRouteIs() rethrows unexpected errors unchanged and reports an invalid page URL as is. The docblocks are corrected.

Jira Issues

Follow-up to the bx-playwright browser testing ticket shipped with #708.

Type of change

Checklist

  • My code follows the style guidelines of this project cfformat
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Tests, BoxLang 1.17 test server:

  • tests.specs.browser: 20/20, including the in-browser specs. Before the fix, 4 of the new specs fail and 1 errors.
  • tests.specs.integration: 97/97.
  • tests.specs.web.routing: 168/168.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UU9aLossoYUkQNwubnitBi


Generated by Claude Code

…-app error

- routeURL(), visitRoute() and assertRouteIs() build paths from the web
  root: the appMapping is a mapping, not a web path, so it is no longer
  part of them. A webMapping keeps the base path for apps served from a
  sub folder.
- With params, a route with optional placeholders resolves to the
  longest variant the params fill, instead of the base route. A root
  route gives "/", not "//".
- The helpers throw BaseTestCase.NoColdBoxApp when no ColdBox app is
  loaded, and InvalidArgumentException for a module that is not loaded.
- assertRouteIs() rethrows unexpected errors as they are and reports the
  page URL as is when it is not a valid URI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UU9aLossoYUkQNwubnitBi
@github-actions

Copy link
Copy Markdown

Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit 9b80c26. ± Comparison against base commit 8dbc946.

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit 14b35b0. ± Comparison against base commit 8dbc946.

♻️ This comment has been updated with latest results.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UU9aLossoYUkQNwubnitBi

lmajano commented Oct 10, 2026 •

Copy link
Copy Markdown
Member Author

CI notes:

  • Checks Source Code Formatting: fixed in 14b35b0 (wrapping of the new route helper calls and @throws alignment). It is green now.

  • Adobe 2023 / 2025 test suites: they fail on one spec, ModuleServiceTest "Module Lifecycle: Still resolves a handler-only URL for a module with only a mandatory-action route" (test-module-conventions is not loaded). This is not this PR's:

    • this PR does not touch module loading;
    • development (8dbc946) fails the same way on Adobe 2023 (907 tests, 1 failed);
    • on 9b80c26, one workflow run passed both Adobe suites while the other failed.

    No fix exists yet; it is the known intermittent Module Lifecycle spec.


Generated by Claude Code

@lmajano
lmajano merged commit 7fcd6f2 into development Oct 10, 2026
26 of 28 checks passed
@lmajano
lmajano deleted the claude/bx-playwright-research-plan-ddfqpm branch October 10, 2026 14:17
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