-
-
Notifications
You must be signed in to change notification settings - Fork 426
javascript code inside rails view not running #884
Comments
We have a number of test cases around |
Sorry for the late reply. Sure, I will gladly do it, but can you please give me some instructions on how to do it? |
Sure! If you can put together a running example that I have access to, such as a GitHub repo or Gist, I can run it locally and poke at it to try and debug. The fewer moving pieces there are, the easier it will be for me to determine what the issue is. A popular choice is a single repository with a Sinatra app and a single Capybara test. |
Here is the repo url, although funny thing is here with Sinatra it works. But with Rails I wasn't able to do manage this and get something else from the |
Alright, thanks for the update. |
Really sorry for delaying this. I've managed to simulate the fail. Here is the repo. It appears that capybara-webkit doesn't run the script on redirects. If I'm not clear enough you can ping me at any time. |
@ristovskiv I am unable to get that repo to run - I get a a stack level too deep error when attempting to migrate the database. If you can fix and update the repo to current gem versions and ensure it works I will take a look ASAP |
@twalpole the database is pretty simple, it only has one 1 migration file with 1 table/relation. |
@ristovskiv Now that you locked the repo to ruby 2.3.3 it works for me, not sure why it wasn't before.
Additionally, for stability reasons your path expectations should be written more along the lines of
|
This would appear to be an issue with QtWebkit, and may just have been the way webkit browsers worked back when the QtWebkit version being used was released - https://www.w3.org/TR/cuap#uri - not sure there's anything capybara-webkit can do about it |
These redirects are handled by QtWebKit itself. We hook in to the network manager in a few places but mostly such behavior is inherited from WebKit. |
I have a javascript code in a rails view which runs depending on the URI of the page. For example if it has a fragment in the URI it changes it to query string.
I need this in order to do something with the fragments on the server side. But it appears that capybara-webkit is not running this javascript, cause when I check the
current_url
is not displaying the expected behavior. For example i have a request/login#users
then i convert that to '/login?return_to=users'. This works with selenium thoughThe text was updated successfully, but these errors were encountered: