|
65 | 65 | it 'raises ConnectionError when offline, and no binary exists' do
|
66 | 66 | allow(Net::HTTP).to receive(:get_response).and_raise(SocketError)
|
67 | 67 | allow(chromedriver).to receive(:exists?).and_return(false)
|
| 68 | + allow(Webdrivers::ChromeFinder).to receive(:version).and_return('115.0.5790.114') |
68 | 69 |
|
69 |
| - msg = %r{Can not reach https://googlechromelabs.github.io/chrome-for-testing/latest-patch-versions-per-build.json} |
| 70 | + msg = %r{Can not reach https://googlechromelabs.github.io/chrome-for-testing} |
70 | 71 | expect { chromedriver.update }.to raise_error(Webdrivers::ConnectionError, msg)
|
71 | 72 | end
|
72 | 73 | end
|
|
100 | 101 |
|
101 | 102 | it 'raises ConnectionError if offline' do
|
102 | 103 | allow(Net::HTTP).to receive(:get_response).and_raise(SocketError)
|
| 104 | + chromedriver.required_version = '115.0.5790.102' |
103 | 105 |
|
104 |
| - msg = %r{Can not reach https://googlechromelabs.github.io/chrome-for-testing/latest-patch-versions-per-build.json} |
| 106 | + msg = %r{Can not reach https://googlechromelabs.github.io/chrome-for-testing} |
105 | 107 | expect { chromedriver.update }.to raise_error(Webdrivers::ConnectionError, msg)
|
106 | 108 | end
|
107 | 109 | end
|
|
142 | 144 | allow(Webdrivers::System).to receive(:download)
|
143 | 145 | end
|
144 | 146 |
|
145 |
| - it 'uses the correct chromedriver filename suffix for Intel' do |
146 |
| - allow(Webdrivers::System).to receive(:apple_m1_architecture?).and_return(false) |
147 |
| - allow(chromedriver).to receive(:latest_version).and_return(Gem::Version.new('106.0.5249.61')) |
148 |
| - chromedriver.required_version = nil |
149 |
| - |
150 |
| - chromedriver.update |
151 |
| - expect(Webdrivers::System).to have_received(:download).with(end_with('_mac64.zip'), anything) |
152 |
| - end |
153 |
| - |
154 |
| - it 'uses the correct chromedriver filename suffix from version 106.0.5249.61 for Silicon' do |
155 |
| - allow(Webdrivers::System).to receive(:apple_m1_architecture?).and_return(true) |
156 |
| - allow(chromedriver).to receive(:latest_version).and_return(Gem::Version.new('106.0.5249.61')) |
157 |
| - chromedriver.required_version = nil |
158 |
| - |
159 |
| - chromedriver.update |
160 |
| - expect(Webdrivers::System).to have_received(:download).with(end_with('_arm64.zip'), anything) |
161 |
| - end |
| 147 | + context 'with Intel architecture' do |
| 148 | + it 'v114 uses correct suffix' do |
| 149 | + allow(Webdrivers::System).to receive(:apple_m1_architecture?).and_return(false) |
| 150 | + allow(chromedriver).to receive(:latest_version).and_return(Gem::Version.new('114.0.5735.90')) |
| 151 | + chromedriver.required_version = nil |
162 | 152 |
|
163 |
| - it 'uses the correct chromedriver filename suffix for versions less than 106.0.5249.61 for Silicon' do |
164 |
| - allow(Webdrivers::System).to receive(:apple_m1_architecture?).and_return(true) |
165 |
| - allow(chromedriver).to receive(:latest_version).and_return(Gem::Version.new('106.0.5249.21')) |
166 |
| - chromedriver.required_version = nil |
| 153 | + chromedriver.update |
| 154 | + expect(Webdrivers::System).to have_received(:download).with(end_with('_mac64.zip'), anything) |
| 155 | + end |
167 | 156 |
|
168 |
| - chromedriver.update |
169 |
| - expect(Webdrivers::System).to have_received(:download).with(end_with('_mac64_m1.zip'), anything) |
170 |
| - end |
171 |
| - |
172 |
| - it 'uses the correct chromedriver filename suffix for versions greater than 115 for Intel' do |
173 |
| - allow(Webdrivers::System).to receive(:apple_m1_architecture?).and_return(false) |
174 |
| - allow(chromedriver).to receive(:latest_version).and_return(Gem::Version.new('115.0.5790.102')) |
175 |
| - chromedriver.required_version = nil |
| 157 | + it 'v115 uses correct suffix' do |
| 158 | + allow(Webdrivers::System).to receive(:apple_m1_architecture?).and_return(false) |
| 159 | + allow(chromedriver).to receive(:latest_version).and_return(Gem::Version.new('115.0.5790.102')) |
| 160 | + chromedriver.required_version = nil |
176 | 161 |
|
177 |
| - chromedriver.update |
178 |
| - expect(Webdrivers::System).to have_received(:download).with(end_with('-mac-x64.zip'), anything) |
| 162 | + chromedriver.update |
| 163 | + expect(Webdrivers::System).to have_received(:download).with(end_with('-mac-x64.zip'), anything) |
| 164 | + end |
179 | 165 | end
|
180 | 166 |
|
181 |
| - it 'uses the correct chromedriver filename suffix for versions greater than 115 for Silicon' do |
182 |
| - allow(Webdrivers::System).to receive(:apple_m1_architecture?).and_return(true) |
183 |
| - allow(chromedriver).to receive(:latest_version).and_return(Gem::Version.new('115.0.5790.102')) |
184 |
| - chromedriver.required_version = nil |
185 |
| - |
186 |
| - chromedriver.update |
187 |
| - expect(Webdrivers::System).to have_received(:download).with(end_with('-mac-arm64.zip'), anything) |
| 167 | + context 'with Apple architecture' do |
| 168 | + it 'v106.0.5249.61 uses correct suffix' do |
| 169 | + allow(Webdrivers::System).to receive(:apple_m1_architecture?).and_return(true) |
| 170 | + allow(chromedriver).to receive(:latest_version).and_return(Gem::Version.new('106.0.5249.61')) |
| 171 | + chromedriver.required_version = nil |
| 172 | + |
| 173 | + chromedriver.update |
| 174 | + expect(Webdrivers::System).to have_received(:download).with(end_with('_arm64.zip'), anything) |
| 175 | + end |
| 176 | + |
| 177 | + it 'less than v106.0.5249.61 uses correct suffix' do |
| 178 | + allow(Webdrivers::System).to receive(:apple_m1_architecture?).and_return(true) |
| 179 | + allow(chromedriver).to receive(:latest_version).and_return(Gem::Version.new('106.0.5249.21')) |
| 180 | + chromedriver.required_version = nil |
| 181 | + |
| 182 | + chromedriver.update |
| 183 | + expect(Webdrivers::System).to have_received(:download).with(end_with('_mac64_m1.zip'), anything) |
| 184 | + end |
| 185 | + |
| 186 | + it 'v115 uses correct suffix' do |
| 187 | + allow(Webdrivers::System).to receive(:apple_m1_architecture?).and_return(true) |
| 188 | + allow(chromedriver).to receive(:latest_version).and_return(Gem::Version.new('115.0.5790.102')) |
| 189 | + chromedriver.required_version = nil |
| 190 | + |
| 191 | + chromedriver.update |
| 192 | + expect(Webdrivers::System).to have_received(:download).with(end_with('-mac-arm64.zip'), anything) |
| 193 | + end |
188 | 194 | end
|
189 | 195 | end
|
190 | 196 | end
|
|
224 | 230 | msg = 'Unable to find latest point release version for 999.0.0. '\
|
225 | 231 | 'You appear to be using a non-production version of Chrome. '\
|
226 | 232 | 'Please set `Webdrivers::Chromedriver.required_version = <desired driver version>` '\
|
227 |
| -'to a known chromedriver version: https://googlechromelabs.github.io/chrome-for-testing' |
| 233 | +'to a known chromedriver version: https://chromedriver.chromium.org/downloads/version-selection' |
228 | 234 |
|
229 | 235 | expect { chromedriver.latest_version }.to raise_exception(Webdrivers::VersionError, msg)
|
230 | 236 | end
|
|
233 | 239 | allow(chromedriver).to receive(:browser_version).and_return Gem::Version.new('72.0.9999.0000')
|
234 | 240 | msg = 'Unable to find latest point release version for 72.0.9999. '\
|
235 | 241 | 'Please set `Webdrivers::Chromedriver.required_version = <desired driver version>` '\
|
236 |
| -'to a known chromedriver version: https://chromedriver.storage.googleapis.com/index.html' |
| 242 | +'to a known chromedriver version: https://chromedriver.chromium.org/downloads/version-selection' |
237 | 243 |
|
238 | 244 | expect { chromedriver.latest_version }.to raise_exception(Webdrivers::VersionError, msg)
|
239 | 245 | end
|
240 | 246 |
|
241 | 247 | it 'raises ConnectionError when offline' do
|
242 | 248 | allow(Net::HTTP).to receive(:get_response).and_raise(SocketError)
|
| 249 | + allow(Webdrivers::ChromeFinder).to receive(:version).and_return('115.0.5790.114') |
243 | 250 |
|
244 |
| - msg = %r{^Can not reach https://googlechromelabs.github.io/chrome-for-testing/latest-patch-versions-per-build.json} |
| 251 | + msg = %r{^Can not reach https://googlechromelabs.github.io/chrome-for-testing} |
245 | 252 | expect { chromedriver.latest_version }.to raise_error(Webdrivers::ConnectionError, msg)
|
246 | 253 | end
|
247 | 254 |
|
|
0 commit comments