-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Change the prop value for a selected component #21
Comments
Hi Thanks for raising the issue ans closing it. Can you share your anwser/analysis on this so that others can get benefitted. Thanks. |
Sorry, realized that this plugin doesn't have this option so I'm going to either find a way to do it or check another plugin. |
Can you raise a feature request (issue) on the same? Let me find out a possibility for this plugin. Thanks. |
@wing5822 I appreciate the ticket. Would you be able to provide some more information? Any use cases (sample codes) will help me to dig deep. |
hey @abhinaba-ghosh I'll use your example
We get the react component like so
But what I want to set the prop value to another value without touching the UI
|
@wing5822 Thanks for the details. You will get an update by upcoming Monday. |
Hi @wing5822 , after careful analysis, I found out this library can be best suited for E2E testing. Changing prop and state require re-rendering of the React components. So, your tests should have access to source code directly. Efficient component testing can be achieved using both the libraries:
You can find an existing example of using these two libraries hand-in-hand. Although I am still validating enhancing this library to handle all possible use cases. You can track here: #23 |
Its main idea is to model the entire process of user-application interaction as near to real-life as possible. A user cannot manipulate a component's props and state directly, so the cypress-react-selector is also not supposed to do this. Instead, you can emulate a user action that should lead to intended props/state modification and then check how it affects a page state after re-render. Also, direct modification of React component props in the real environment in the middle of the React lifecycle can cause unexpected side-effects, make a test unstable and lead to hard-to-locate bugs. |
That I understand. All good =) |
Hi there,
This is not an issue but was wondering if there was a way to change the prop values after selecting the component?
The text was updated successfully, but these errors were encountered: