-
-
Notifications
You must be signed in to change notification settings - Fork 426
Problem with 3rd party javascript #783
Comments
Could you try using :webkit_debug as a driver and pasting the output? Also if possible, can you please extract a test case where this spec is failing? |
@nritholtz , thanks for your reply, below is the example code:
html
javascript
When user visits this page, the text "Content displayed after Google Chart is loaded" is supposed to be displayed in the DOM after Chart API has been loaded , and this works fine in Development mode and in Test mode using Chrome driver But when i switch to Webkit driver, the var
So i suspect that somehow Webkit driver unable to load the external Javascript library. Hope it's clear |
@nqtien310 A Also, is this spec working in selenium-webdriver? However, if what I believe is the problem, it could be that the scripts are getting blacklisted due to 3804dd5. If your current Capybara Webkit version >= v1.4.0, then if the requested URL or in this case the javascript, is not local, then you need to whitelist the URL. For example in your case, you might want to add beforehand a There is a pull request 756 for creating a configuration block to set these kind of options, however for now you can include in somewhere within your spec or as a |
My Capybara webkit version is: 0.12.1
unfortunately seem like allow_url is added in the later versions of 0.12.1 , i can't do an upgrade now since it might break other specs in the test suite. I tried webkit_debug and this is the output
|
@nqtien310 that version (0.12) is a few years old, so I don't think it makes sense for us to debug issues with it. I'd give a newer version a try. If you use the latest version of Capybara, capybara-webkit, and Qt (5.x), you should run into significantly fewer issues, particularly if you're using anything interesting on the JavaScript side, like React or Google APIs. |
Am i wrong or being drunk, but seem like in Capybara Webkit , 3rd party service ( such as Google Chart ) is unable to be loaded.
The chart renders fine in development mode, but when I try to run the spec for the page that renders the chart, it returns variable "Can't find variable: google"
Any help is highly appreciated
The text was updated successfully, but these errors were encountered: