Description
The Cypress command cy.go('back') does not trigger a hash-based back navigation when using useHashRouting: true. The URL remains unchanged and the test hangs indefinitely.
Manually calling window.history.back() in the browser works as expected — the hashchange event fires and Luigi processes the route change correctly.
Steps to Reproduce
- Configure Luigi with the config below
- Visit the app via
cy.visit('http://localhost:4900/#/')
- Navigate programmatically:
Luigi.navigation().navigate('/projects/pr1/dps')
- URL resolves to
/#/projects/pr1/dps/dps2 (via defaultChildNode)
- Call
cy.go('back')
- Expected: URL changes to
/#/home
- Actual: URL does not change, test hangs
Luigi Config
{
navigation: {
nodes: [
{
pathSegment: 'home',
label: 'Home',
icon: 'home',
viewUrl: '/multipurpose.html',
},
{
pathSegment: 'projects',
label: 'Projects',
icon: 'folder',
viewUrl: '/multipurpose.html',
children: [
{
pathSegment: 'pr1',
label: 'Project One',
viewUrl: '/multipurpose.html',
children: [
{
pathSegment: 'dps',
label: 'Default Child node Example',
defaultChildNode: 'dps2',
children: [
{
pathSegment: 'dps1',
label: 'First Child',
viewUrl: '/multipurpose.html',
},
{
pathSegment: 'dps2',
label: 'Second Child',
viewUrl: '/multipurpose.html',
}
]
}
]
}
]
}
]
},
routing: {
useHashRouting: true
}
}
Environment
- Cypress 15.x
- Luigi core-modular with
useHashRouting: true
- Browser: Chrome
Analysis
cy.go('back') internally calls history.go(-1) but then waits for a page load event. With hash routing, only a hashchange event fires (no full page load), so Cypress never resolves.
Using win.history.back() directly causes Cypress to detect a navigation and show "waiting for new page to load" — also incorrect for hash changes.
Description
The Cypress command
cy.go('back')does not trigger a hash-based back navigation when usinguseHashRouting: true. The URL remains unchanged and the test hangs indefinitely.Manually calling
window.history.back()in the browser works as expected — the hashchange event fires and Luigi processes the route change correctly.Steps to Reproduce
cy.visit('http://localhost:4900/#/')Luigi.navigation().navigate('/projects/pr1/dps')/#/projects/pr1/dps/dps2(via defaultChildNode)cy.go('back')/#/homeLuigi Config
Environment
useHashRouting: trueAnalysis
cy.go('back')internally callshistory.go(-1)but then waits for a pageloadevent. With hash routing, only ahashchangeevent fires (no full page load), so Cypress never resolves.Using
win.history.back()directly causes Cypress to detect a navigation and show "waiting for new page to load" — also incorrect for hash changes.