Comments (3)
Excellent! Glad you got it working. Thanks for sharing your insights.
from observable-store.
Hi Jason. It's challenging to say what the issue may be here without being able to run any type of sample and see everything. But, here are my initial thoughts.
Has the store you're trying to access to trigger the event been initialized in the application at that point of the overall flow (when you call setStatusJobUpdate()
from Cypress code)? I'm wondering, if a component or service where the store is being injected hasn't been called yet so that store isn't yet initialized and available. The store won't be initialized until it's injected (not sure if you're using Angular or another option) of course. When you call setup()
it sounds like that is triggering it to be initialized. The fact that you're seeing 13 when calling allStoreServices
in the app versus 0 in Cypress makes me wonder about the life cycle timing and if the stores haven't yet been initialized when you run the Cypress code.
As far as accessing it through the window object, it's not put into the global scope so currently doesn't support that type of access.
Normally for these types of scenarios I'll try to create a minimum viable sample to narrow down the issue. Makes it a lot easier to debug versus trying to run the entire app. But, I realize for more complex apps that can be challenging to do.
from observable-store.
Hi thanks for the answer and I figured it out!
So Cypress works with IFrames which indeed separates what you run in a test, from what is actually running on the app. And my initial question went at it from the wrong way, during an E2E test in Cypress I'm not supposed to mess with the internal state, I should only mimic/mock the input from what a user can do.
What happens is, Websocket message comes in (SignalR) => Observable store gets updated => Triggers change on the page. I figured I could skip the first step and mock the trigger inside the Observable store. But that was a bad idea for the above reasons, so I developed the Cypress-SignalR-Mock plugin to do this.
Leaving it here for others so my pain is not in vain :D
from observable-store.
Related Issues (20)
- Replay Subject for edge cases HOT 4
- Why won't a getter from a service/state work after any store changes? HOT 6
- Missing properties after setting state HOT 8
- Weird store structure when using stateSliceSelector HOT 2
- Store structure: Flat vs Complex + stateWithPropertyChanges returns function if that's what was passed in the setState HOT 1
- This lib can be performance problems HOT 1
- It would help so much if you included a fully working react example HOT 2
- Using state in synchronous manner HOT 1
- SetState method is not working HOT 9
- Rx.js 7.2 migration and compatibility? HOT 4
- Using JSONPath and Observable store HOT 4
- Setting State via SetState for one property HOT 4
- CommonJS or AMD dependencies can cause optimization bailouts. HOT 3
- Is it necessary to deep clone the state when dispatching? HOT 7
- Problem with ReduxDevToolsExtension under electron environment HOT 5
- Losing Class (getters/setters) when returning object from store HOT 1
- setState() does not update property when setting to undefined HOT 1
- How to store n number of propertes (making the state properties dynamic) HOT 1
- is it possible to filter by Action? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from observable-store.