|
5 | 5 | RSpec.describe 'Chrome' do
|
6 | 6 | describe 'Driver Options' do
|
7 | 7 | let(:chrome_location) { driver_finder && ENV.fetch('CHROME_BIN', nil) }
|
| 8 | + let(:url) { 'https://www.selenium.dev/selenium/web/' } |
8 | 9 |
|
9 | 10 | it 'page load strategy normal' do
|
10 | 11 | options = Selenium::WebDriver::Options.chrome
|
11 | 12 | options.page_load_strategy = :normal
|
12 | 13 |
|
13 | 14 | driver = Selenium::WebDriver.for :chrome, options: options
|
14 |
| - driver.get('https://www.google.com') |
| 15 | + driver.get(url) |
15 | 16 | driver.quit
|
16 | 17 | end
|
17 | 18 |
|
|
20 | 21 | options.page_load_strategy = :eager
|
21 | 22 |
|
22 | 23 | driver = Selenium::WebDriver.for :chrome, options: options
|
23 |
| - driver.get('https://www.google.com') |
| 24 | + driver.get(url) |
24 | 25 | driver.quit
|
25 | 26 | end
|
26 | 27 |
|
|
29 | 30 | options.page_load_strategy = :none
|
30 | 31 |
|
31 | 32 | driver = Selenium::WebDriver.for :chrome, options: options
|
32 |
| - driver.get('https://www.google.com') |
| 33 | + driver.get(url) |
33 | 34 | driver.quit
|
34 | 35 | end
|
35 | 36 |
|
|
42 | 43 | cloud_options[:name] = my_test_name
|
43 | 44 | options.add_option('cloud:options', cloud_options)
|
44 | 45 | driver = Selenium::WebDriver.for :remote, capabilities: options
|
45 |
| - driver.get('https://www.google.com') |
| 46 | + driver.get(url) |
46 | 47 | driver.quit
|
47 | 48 | end
|
48 | 49 |
|
|
51 | 52 | options.accept_insecure_certs = true
|
52 | 53 |
|
53 | 54 | driver = Selenium::WebDriver.for :chrome, options: options
|
54 |
| - driver.get('https://expired.badssl.com/') |
| 55 | + driver.get(url) |
55 | 56 | driver.quit
|
56 | 57 | end
|
57 | 58 |
|
|
60 | 61 | options.unhandled_prompt_behavior = :accept
|
61 | 62 |
|
62 | 63 | driver = Selenium::WebDriver.for :chrome, options: options
|
63 |
| - driver.get('https://www.google.com') |
| 64 | + driver.get(url) |
64 | 65 | driver.quit
|
65 | 66 | end
|
66 | 67 |
|
|
69 | 70 | options.set_window_rect = true
|
70 | 71 |
|
71 | 72 | driver = Selenium::WebDriver.for :firefox, options: options
|
72 |
| - driver.get('https://www.google.com') |
| 73 | + driver.get(url) |
73 | 74 | driver.quit
|
74 | 75 | end
|
75 | 76 |
|
|
78 | 79 | options.strict_file_interactability = true
|
79 | 80 |
|
80 | 81 | driver = Selenium::WebDriver.for :chrome, options: options
|
81 |
| - driver.get('https://www.google.com') |
| 82 | + driver.get(url) |
82 | 83 | driver.quit
|
83 | 84 | end
|
84 | 85 |
|
|
87 | 88 | options.proxy = Selenium::WebDriver::Proxy.new(http: 'myproxy.com:8080')
|
88 | 89 |
|
89 | 90 | driver = Selenium::WebDriver.for :chrome, options: options
|
90 |
| - driver.get('https://www.google.com') |
| 91 | + driver.get(url) |
91 | 92 | driver.quit
|
92 | 93 | end
|
93 | 94 |
|
|
96 | 97 | options.timeouts = {implicit: 1}
|
97 | 98 |
|
98 | 99 | driver = Selenium::WebDriver.for :chrome, options: options
|
99 |
| - driver.get('https://www.google.com') |
| 100 | + driver.get(url) |
100 | 101 | driver.quit
|
101 | 102 | end
|
102 | 103 |
|
|
105 | 106 | options.timeouts = {page_load: 400_000}
|
106 | 107 |
|
107 | 108 | driver = Selenium::WebDriver.for :chrome, options: options
|
108 |
| - driver.get('https://www.google.com') |
| 109 | + driver.get(url) |
109 | 110 | driver.quit
|
110 | 111 | end
|
111 | 112 |
|
|
114 | 115 | options.timeouts = {script: 40_000}
|
115 | 116 |
|
116 | 117 | driver = Selenium::WebDriver.for :chrome, options: options
|
117 |
| - driver.get('https://www.google.com') |
| 118 | + driver.get(url) |
118 | 119 | driver.quit
|
119 | 120 | end
|
120 | 121 | end
|
|
0 commit comments