Cypress visit onBeforeLoad is not updating react redux state
See original GitHub issueCurrent behavior
Till cypress 9.7, we are able to update initial redux state, which is not updating from version 10.
Desired behavior
No response
Test code to reproduce
cy.fixture(fixture-path.json)
.as('initialState')
.then(initialState) => {
cy.visit(localhost:8080,{
onBeforeLoad: (window: any){
window.initialState = initialState
},
})
})
Cypress Version
10.1
Other
No response
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Testing Redux Store - Cypress
In this blog post I will show you how to run assertions against a React application that uses a Redux store. This blog...
Read more >React/Redux not updating the state - Stack Overflow
What I want to do is to store my login response for me to use the user details on other page. LandingPage.js import...
Read more >cypress-io/cypress - Gitter
In redux app, input box change will trigger an action to be dispatched, and be processed by the root reducer to create a...
Read more >Cypress test events from DOM elements - The Koi
In this guide, you will learn how to listen on DOM events in Cypress. You will not just see how to listen with...
Read more >How to access Redux state in Cypress - Aditya.
Accessing redux store from our react application and using it in cypress integration testing.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We are encountering the same issue on Cypress 10.0.3.
Here is a reproducible example if it helps.
Current behavior: Produces this logs:
Desired behavior:
Versions Cypress version: 10.0.3 Browser: Chrome 103 OS: macOS Monterey, Version 12.4
Unfortunately we have to close this issue due to inactivity. Right now there doesn’t seem to be enough information to reproduce the problem on our end. We’ll have to close this issue until we can reproduce it. This does not mean that your issue is not happening - it just means that we do not have a path to move forward.
Please open a new issue with a reproducible example and link to this issue. Here are some tips for providing a Short, Self Contained, Correct, Example and our own Troubleshooting Cypress guide.