-
Notifications
You must be signed in to change notification settings - Fork 242
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
Selenium Timeout with Rails 6 #577
Comments
It looks like it's actually CSP related:
I see there is a PR open for fixing CSP support, any chance that can be rebased and merged? |
I have rebased the PR #561 into a new branch would you be willing to try it on your end?
|
Oh, unfortunately I've since changed jobs and no longer have access to that code base. I'll ping a former coworker and see if they can try it out. Thank you, though! |
Thanks for the ping @kuzmik 👋 @mathieujobin I'm seeing the issue on the new branch
|
@dparpyani I'm afraid this can be a lot of things. let me know if you find out more details if you have time to debug this. |
Look what I did there 805523c hopefully this helps with your problem? |
this seems to be a selenium config problem, not teaspoon related |
Our teaspoon-jasmine was pinned to e952dbc and had the following added to our CSP config for it to work (using the secure-headers gem):
When using the pr-561 branch, it neither worked with nor without the script-src setting (and failed with the timeout error mentioned above). However, I unpinned the teaspoon-jasmine version today and let it pull the most recent versions (v2.9.1 with teaspoon v1.2.2). FWIW, now it works similarly to the previously pinned version i.e. works with the CSP config above, but not without it. |
I see, thanks for the extra troubleshooting and information. I'm not familiar with CSP or the secure-headers gem what do you suggest we do so it works for people out of the box? |
The secure-headers gem sets safe defaults for a bunch of important headers, CSP being one of them. In this case, we're modifying the CSP header during tests to allow 'unsafe-inline' for the script-src directive, which:
(from https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src) See here for more examples, but without diving into the teaspoon code, I think that it has inline elements that are being blocked by a strict CSP header. It looks like that is what #561 was trying to fix, but maybe there's a piece that was missed somewhere? |
I am attempting to run
teaspoon --driver=selenium --server-port=31337 --format=documentation spec/javascripts/vendoring/integration_form_spec.js
and for some reason theRails.env
defaults to "development." This causes a bit of a problem with other gems we use, so I throw a RAILS_ENV=test on there, and the environment is set correctly, but I am still getting timeouts.Under rails 5.2 the exact same code worked fine, so I am kind of at a loss.
Anyone have any ideas? I saw there was another issue about rails 6, but I am not running into that issue or using any of those other libraries, just teaspoon and jasmine (and selenium I guess).
The text was updated successfully, but these errors were encountered: