-
Notifications
You must be signed in to change notification settings - Fork 359
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
NEWS-6530 Chromification #578
Conversation
…sts up to 3 times; have Chrome wait 10 seconds by default but allow an override.
…w number of simultaneous threads to be altered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor tidy ups, but otherwise a good job 👍
@@ -98,10 +98,12 @@ def get_driver | |||
options = Selenium::WebDriver::Chrome::Options.new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we tidy this up? A pattern like [opt1, opt2, ...].each |opt| options.add_argument(opt)
lib/wraith/wraith.rb
Outdated
@@ -132,6 +132,14 @@ def comp_domain_label | |||
domains.keys[1] | |||
end | |||
|
|||
def timeout_ms | |||
@config['timeout_ms'] ? @config['timeout_ms'] : 1000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't this be @config['timeout_ms'] || 1000
?
spec/config_spec.rb
Outdated
end | ||
|
||
context 'non-standard config values' do | ||
let(:config) { YAML.load "browser: phantomjs\nthreads: 2\ntimeout_ms: 4000"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't quite follow the use of YAML.load to create the object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YAML.load
takes a YAML string that it parses and returns as an object. To do that from a YAML file, YAML.load_file
would be used instead.
It's just easier than creating a fixture file when the contents of that file is small.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, but there is an issue with the tests, but it may be just it needs a rerun.
… the dust to settle).
It looks like these changes aren't yet available when performing a I was banging my head against the wall since it looked like I had a race condition where some pages would simply not be captured, likely due to timeout, so I resorted to using Why I'm here (and to help future me and any other folks getting here from a Google search): The error that I was repeatedly seeing, possibly some kind of timeout or race condition, was along the lines of the following:
So, the fix (TL;DR): Running Edit: Created issue to track this here: #613 |
Quick update to anyone reading: These code updates are now available in v4.2.4 via So if you've got a ton of paths in your configuration like I do and have similar issues to above, try updating now. |
Hi @patricknelson and @bigmartyn , I tried to use the new parameter 'settle' but the same. My knowledge of ruby and selenium is very limited but if i read the documentation of implicit_wait (of which settle changes the value) it works only when we want to find a DOM element : I missed something ? |
@ajoah Exactly what errors are you seeing (if any)? I will say I haven't noticed any change in my var doneTesting = arguments[0];
setTimeout(doneTesting, 1000); Maybe there are more arguments being passed into the wrapping closure now? Since I'm directly targeting the var callback = arguments[arguments.length-1];
setTimeout(callback, 2000); Also worth noting: You've got a great point on the use of |
@patricknelson no difference with your code :/ I think it is due to the fact that The first function wait a callback, the second not : https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/JavascriptExecutor.html There is a reason of this replacement ? if not we can set back ping @staylos92 |
…gression caused by bbc#578) and just reverting to hard-coded 'invalid.jpg' from before.
We are also seeing the same behaviour (wait not working, settle not working) with Chrome and wraith 4.2.4. |
Crossposting my potential solution from #616 (comment) here in case it's helpful for any other folks that may land on this PR 😄
|
https://jira.dev.bbc.co.uk/browse/NEWS-6530
Improve how Wraith works with chrome by: