cypress-helper-history
A Cypress command for navigating via the History API during tests; an alternative to cy.visit
for manually navigating within single page applications.
Uses window.history.pushState
by default, but you can make the helper use a history
instance as well.
Setup
1. Install package
npm install --save-dev cypress-helper-history
2. Import Cypress command
// E.g. in cypress/support/index.js;
history
(optional)
3. Expose your // E.g. in src/history.js // Create your history instance, for example like this:; const history = ;; // Then expose it to the helper like this:if 'Cypress' in window window__chh__history__ = history;
Usage
;