Skip to content

Commit bf07cfd

Browse files
committed
Change 'timeout_ms' to 'settle' (how long the browser should wait for the dust to settle).
1 parent c9730e2 commit bf07cfd

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

lib/wraith/save_images.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def capture_image_selenium(screen_sizes, url, file_name, selector, global_before
135135
new_file_name = file_name.sub('MULTI', screen_size)
136136
driver.manage.window.resize_to(width, height || 1500)
137137
driver.navigate.to url
138-
driver.manage.timeouts.implicit_wait = wraith.timeout_ms * 1000
138+
driver.manage.timeouts.implicit_wait = wraith.settle
139139
driver.execute_script(File.read(global_before_capture)) if global_before_capture
140140
driver.execute_script(File.read(path_before_capture)) if path_before_capture
141141
resize_to_fit_page(driver) unless height

lib/wraith/wraith.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ def comp_domain_label
132132
domains.keys[1]
133133
end
134134

135-
def timeout_ms
136-
@config.fetch('timeout_ms', 1000)
135+
def settle
136+
@config.fetch('settle', 10)
137137
end
138138

139139
def threads

spec/config_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@
2020
it 'returns default values for threads' do
2121
expect(wraith.threads).to eq 8
2222
end
23-
it 'returns default values for timeout_ms' do
24-
expect(wraith.timeout_ms).to eq 1000
23+
it 'returns default values for settle' do
24+
expect(wraith.settle).to eq 10
2525
end
2626

2727
context 'non-standard config values' do
28-
let(:config) { YAML.load "browser: phantomjs\nthreads: 2\ntimeout_ms: 4000"}
28+
let(:config) { YAML.load "browser: phantomjs\nthreads: 2\nsettle: 5"}
2929
let(:non_standard_wraith) { Wraith::Wraith.new( config, { yaml_passed: true }) }
3030

3131
it 'returns overridden value when threads is specified in config' do
3232
expect(non_standard_wraith.threads).to eq 2
3333
end
3434

35-
it 'returns overridden value when timeout_ms is specified in config' do
36-
expect(non_standard_wraith.timeout_ms).to eq 4000
35+
it 'returns overridden value when settle is specified in config' do
36+
expect(non_standard_wraith.settle).to eq 5
3737
end
3838
end
3939

0 commit comments

Comments
 (0)