-
Notifications
You must be signed in to change notification settings - Fork 328
React.js #272
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
Comments
So after some searching around i found out that synthetic events are not supported in Chrome, but they are in the Firefox driver. Spend some numerous hours figuring out how to get this working with firefox. This included the following (mac os x):
I think this might help people if the section 'running different browsers' was explained better in the docs |
@sweet-greg I would recommend you to write a Medium blog post and submit it to https://laravel-news.com/links to get featured in the weekly newsletter. It's a good community contribution, imo. |
I tried to use firefox too but I'm getting a |
This may be a very long shot, but Dusk has a hard time testing the iframe that Stripe automatically creates for the form. Again, if that's not what you're doing, you may forget all about this :) |
React synthetic events have a known issue in Selenium and jQuery that seem to dispatch events differently, I solved interacting with React elements by dispatching actual DOM Events: on my Page object I added this method:
usage:
See this thread: facebook/react#3249 (comment) |
@sweet-greg you could use my function to dispatch a change event like this:
This would probably need some tweaking to trigger the change and select the specific value but I hope this helps anyone who comes across the same problem The change event: |
After further testing I have narrowed down the issue to a React15 behavior. React 15.x strips out any custom attributes so the The best advice is to simply upgrade to React 16 and everything will work as expected. Alternatively you could work around the problem by using a different non-standard approach I would not recommend doing so because the Dusk API might change in the future and cause your test case to break. Here is an example of the alternative workaround to make elements clickable:
|
Closing this issue because it's already solved, old or not relevant anymore. Feel free to reply if you're still experiencing this issue. |
Uh oh!
There was an error while loading. Please reload this page.
Hi there,
I'm trying to fill in a react form with dusk but it seems it does not trigger any onchange event.
Has anyone been able to make react and dusk work together in harmony?
Doing something like this does not work on a React component...
$browser->type('card_number', '4242 4242 4242 4242');
Nor this
The input just stays empty, I can see that it's focussing on the correct element though...
Thank you in advance.
Seems I was a bit hasty, the onchange event is fired correctly, it seems more like a synthentic event that is not fired. This will probably not be a dusk issue/question
The text was updated successfully, but these errors were encountered: