Repository navigation
BaseTestCase route helpers: web root paths, optional placeholders, no-app error - #720
Merged
Merged
Conversation
…-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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UU9aLossoYUkQNwubnitBi
Member
Author
|
CI notes:
Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up to #708 from the release review of the browser testing route helpers.
routeURL(),visitRoute()andassertRouteIs()included the app mapping (/root/users/5/) once a request had run, because the routing base URL usesappMappingwhenwebMappingis empty. TheappMappingis a mapping, not a web path, so the helpers now drop it. When an app is served from a sub folder,webMappingkeeps the base path./posts/:id?resolved to the base route (findRouteByNamekeeps the last one) and dropped the param. The helpers now pick the longest variant the params fill. A root route gives/, not//.BaseTestCase.NoColdBoxAppwith a clear message. A module that is not loaded throwsInvalidArgumentException.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
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