Skip to content

Commit 21b8a26

Browse files
authored
feat(tests): remove favicon requests (#517)
1 parent 60374d8 commit 21b8a26

File tree

116 files changed

+1311
-2377
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+1311
-2377
lines changed

spec/browser_spec.rb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
it "supports :logger argument" do
4545
browser = Ferrum::Browser.new(logger: logger)
46-
browser.go_to(base_url("/ferrum/console_log"))
46+
browser.go_to(base_url("/console_log"))
4747
expect(logger.string).to include("Hello world")
4848
ensure
4949
browser&.quit
@@ -52,7 +52,7 @@
5252
it "supports :ignore_default_browser_options argument" do
5353
defaults = Ferrum::Browser::Options::Chrome.options.except("disable-web-security")
5454
browser = Ferrum::Browser.new(ignore_default_browser_options: true, browser_options: defaults)
55-
browser.go_to(base_url("/ferrum/console_log"))
55+
browser.go_to(base_url("/console_log"))
5656
ensure
5757
browser&.quit
5858
end
@@ -73,7 +73,7 @@
7373
browser = Ferrum::Browser.new(base_url: base_url,
7474
extensions: [File.expand_path("support/geolocation.js", __dir__)])
7575

76-
browser.go_to("/ferrum/requiring_custom_extension")
76+
browser.go_to("/requiring_custom_extension")
7777

7878
expect(
7979
browser.body
@@ -94,7 +94,7 @@
9494
browser = Ferrum::Browser.new(base_url: base_url,
9595
extensions: [{ source: "window.secret = 'top'" }])
9696

97-
browser.go_to("/ferrum/requiring_custom_extension")
97+
browser.go_to("/requiring_custom_extension")
9898

9999
expect(browser.evaluate(%(window.secret))).to eq("top")
100100
ensure
@@ -237,7 +237,7 @@
237237
it "supports :pending_connection_errors argument" do
238238
browser = Ferrum::Browser.new(base_url: base_url, pending_connection_errors: false, timeout: 0.5)
239239

240-
expect { browser.go_to("/ferrum/really_slow") }.not_to raise_error
240+
expect { browser.go_to("/really_slow") }.not_to raise_error
241241
ensure
242242
browser&.quit
243243
end
@@ -388,13 +388,13 @@
388388
expect(browser.targets.size).to eq(1)
389389

390390
browser.execute <<-JS
391-
window.open("/ferrum/simple", "popup1")
391+
window.open("/simple", "popup1")
392392
JS
393393

394394
sleep 0.1
395395

396396
browser.execute <<-JS
397-
window.open("/ferrum/simple", "popup2")
397+
window.open("/simple", "popup2")
398398
JS
399399

400400
popup1, popup2 = browser.windows(:last, 2)
@@ -416,12 +416,12 @@
416416
end
417417

418418
include_examples "resize viewport by fullscreen" do
419-
let(:path) { "/ferrum/custom_html_size" }
419+
let(:path) { "/custom_html_size" }
420420
let(:viewport_size) { [1280, 1024] }
421421
end
422422

423423
include_examples "resize viewport by fullscreen" do
424-
let(:path) { "/ferrum/custom_html_size_100%" }
424+
let(:path) { "/custom_html_size_100%" }
425425
let(:viewport_size) { [1272, 1008] }
426426
end
427427

@@ -444,7 +444,7 @@
444444
});
445445
JS
446446

447-
browser.go_to("/ferrum/with_user_js")
447+
browser.go_to("/with_user_js")
448448
language = browser.at_xpath("//*[@id='browser-languages']/text()").text
449449
expect(language).to eq("tlh")
450450
ensure
@@ -457,15 +457,15 @@
457457
browser.go_to
458458

459459
browser.execute <<~JS
460-
window.open("/ferrum/simple", "popup")
460+
window.open("/simple", "popup")
461461
JS
462462

463463
sleep 0.1
464464

465465
expect(browser.targets.size).to eq(2)
466466

467467
browser.execute <<~JS
468-
window.open("/ferrum/simple", "popup2")
468+
window.open("/simple", "popup2")
469469
JS
470470

471471
sleep 0.1
@@ -519,7 +519,7 @@
519519
expect(browser.targets.size).to eq(0)
520520

521521
page = browser.create_page
522-
page.go_to("/ferrum/simple")
522+
page.go_to("/simple")
523523

524524
expect(browser.contexts.size).to eq(1)
525525
expect(browser.targets.size).to eq(1)
@@ -530,7 +530,7 @@
530530
expect(browser.targets.size).to eq(0)
531531

532532
browser.create_page do |page|
533-
page.go_to("/ferrum/simple")
533+
page.go_to("/simple")
534534
end
535535

536536
sleep 1 # It may take longer to close the target
@@ -543,7 +543,7 @@
543543
expect(browser.contexts.size).to eq(0)
544544

545545
page = browser.create_page(new_context: true)
546-
page.go_to("/ferrum/simple")
546+
page.go_to("/simple")
547547

548548
context = browser.contexts[page.context_id]
549549
expect(browser.contexts.size).to eq(1)
@@ -560,7 +560,7 @@
560560

561561
page = browser.create_page(new_context: true)
562562
context = browser.contexts[page.context_id]
563-
page.go_to("/ferrum/simple")
563+
page.go_to("/simple")
564564
page.close
565565

566566
expect(browser.contexts.size).to eq(1)
@@ -574,7 +574,7 @@
574574
expect(browser.contexts.size).to eq(0)
575575

576576
browser.create_page(new_context: true) do |page|
577-
page.go_to("/ferrum/simple")
577+
page.go_to("/simple")
578578
end
579579

580580
expect(browser.contexts.size).to eq(0)

spec/context_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
browser.go_to
77

88
browser.execute <<-JS
9-
window.open("/ferrum/slow", "popup")
9+
window.open("/slow", "popup")
1010
JS
1111

1212
popup, = browser.windows(:last)
@@ -18,7 +18,7 @@
1818
browser.go_to
1919

2020
browser.execute <<-JS
21-
window.open("/ferrum/simple", "popup")
21+
window.open("/simple", "popup")
2222
JS
2323

2424
popup, = browser.windows(:last)
@@ -28,7 +28,7 @@
2828
sleep 0.5 # https://github.com/ChromeDevTools/devtools-protocol/issues/145
2929

3030
browser.execute <<-JS
31-
window.open("/ferrum/simple", "popup")
31+
window.open("/simple", "popup")
3232
JS
3333

3434
sleep 0.5 # https://github.com/ChromeDevTools/devtools-protocol/issues/145

spec/cookies_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,18 @@
106106
browser.cookies.set(
107107
name: "stealth",
108108
value: "omg",
109-
path: "/ferrum",
109+
path: "/custom",
110110
httponly: true,
111111
samesite: "Strict"
112112
)
113113

114114
browser.go_to("/get_cookie")
115115
expect(browser.body).to_not include("omg")
116116

117-
browser.go_to("/ferrum/get_cookie")
117+
browser.go_to("/custom/get_cookie")
118118
expect(browser.body).to include("omg")
119119

120-
expect(browser.cookies["stealth"].path).to eq("/ferrum")
120+
expect(browser.cookies["stealth"].path).to eq("/custom")
121121
expect(browser.cookies["stealth"].httponly?).to be_truthy
122122
expect(browser.cookies["stealth"].samesite).to eq("Strict")
123123
end
@@ -213,10 +213,10 @@
213213
browser.cookies.set(name: "stealth", value: "127.0.0.1")
214214
browser.cookies.set(name: "stealth", value: "localhost", domain: "localhost")
215215

216-
browser.go_to("http://localhost:#{port}/ferrum/get_cookie")
216+
browser.go_to("http://localhost:#{port}/get_cookie")
217217
expect(browser.body).to include("localhost")
218218

219-
browser.go_to("http://127.0.0.1:#{port}/ferrum/get_cookie")
219+
browser.go_to("http://127.0.0.1:#{port}/get_cookie")
220220
expect(browser.body).to include("127.0.0.1")
221221
end
222222

@@ -225,10 +225,10 @@
225225
browser.cookies.set(name: "stealth", value: "123456", domain: "localhost")
226226

227227
port = server.port
228-
browser.go_to("http://localhost:#{port}/ferrum/get_cookie")
228+
browser.go_to("http://localhost:#{port}/get_cookie")
229229
expect(browser.body).to include("123456")
230230

231-
browser.go_to("http://127.0.0.1:#{port}/ferrum/get_cookie")
231+
browser.go_to("http://127.0.0.1:#{port}/get_cookie")
232232
expect(browser.body).not_to include("123456")
233233
ensure
234234
browser&.quit

spec/dialog_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
describe Ferrum::Dialog do
44
describe "#accept" do
55
it "works with nested modals" do
6-
browser.go_to("/ferrum/with_js")
6+
browser.go_to("/with_js")
77
browser.on(:dialog) do |dialog, _index, _total|
88
if dialog.match?("Are you sure?")
99
dialog.accept
@@ -21,7 +21,7 @@
2121
browser.go_to
2222

2323
browser.execute <<-JS
24-
window.open("/ferrum/with_js", "popup")
24+
window.open("/with_js", "popup")
2525
JS
2626

2727
popup, = browser.windows(:last)
@@ -41,7 +41,7 @@
4141
browser.go_to
4242

4343
browser.execute <<-JS
44-
window.open("/ferrum/with_js", "popup")
44+
window.open("/with_js", "popup")
4545
JS
4646

4747
popup, = browser.windows(:last)
@@ -58,7 +58,7 @@
5858

5959
describe "#match?" do
6060
it "matches on partial strings" do
61-
browser.go_to("/ferrum/with_js")
61+
browser.go_to("/with_js")
6262
browser.on(:dialog) do |dialog, _index, _total|
6363
if dialog.match?(Regexp.escape("[reg.exp] (chara©+er$)"))
6464
dialog.accept
@@ -73,7 +73,7 @@
7373
end
7474

7575
it "matches on regular expressions" do
76-
browser.go_to("/ferrum/with_js")
76+
browser.go_to("/with_js")
7777
browser.on(:dialog) do |dialog, _index, _total|
7878
if dialog.match?(/^.t.ext.*\[\w{3}\.\w{3}\]/i)
7979
dialog.accept

spec/frame/runtime_spec.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@
5050
end
5151

5252
it "propagates a Javascript error during page load to a ruby exception" do
53-
expect { browser.go_to("/ferrum/js_error") }.to raise_error(Ferrum::JavaScriptError)
53+
expect { browser.go_to("/js_error") }.to raise_error(Ferrum::JavaScriptError)
5454
end
5555

5656
it "does not propagate a Javascript error to ruby if error raising disabled" do
5757
browser = Ferrum::Browser.new(base_url: base_url, js_errors: false)
58-
browser.go_to("/ferrum/js_error")
58+
browser.go_to("/js_error")
5959
browser.execute "setTimeout(function() { omg }, 0)"
6060
sleep 0.1
6161
expect(browser.body).to include("hello")
@@ -66,7 +66,7 @@
6666
it "does not propagate a Javascript error to ruby if error raising disabled and client restarted" do
6767
browser = Ferrum::Browser.new(base_url: base_url, js_errors: false)
6868
browser.restart
69-
browser.go_to("/ferrum/js_error")
69+
browser.go_to("/js_error")
7070
browser.execute "setTimeout(function() { omg }, 0)"
7171
sleep 0.1
7272
expect(browser.body).to include("hello")
@@ -78,19 +78,19 @@
7878

7979
describe "#evaluate" do
8080
it "returns an element" do
81-
browser.go_to("/ferrum/type")
81+
browser.go_to("/type")
8282
element = browser.evaluate(%(document.getElementById("empty_input")))
8383
expect(element).to eq(browser.at_css("#empty_input"))
8484
end
8585

8686
it "returns deeply nested node" do
87-
browser.go_to("/ferrum/deeply_nested")
87+
browser.go_to("/deeply_nested")
8888
node = browser.evaluate(%(document.getElementById("text")))
8989
expect(node.text).to eq("text")
9090
end
9191

9292
it "returns structures with elements" do
93-
browser.go_to("/ferrum/type")
93+
browser.go_to("/type")
9494
result = browser.evaluate <<~JS
9595
{
9696
a: document.getElementById("empty_input"),
@@ -176,7 +176,7 @@
176176
end
177177

178178
it "evaluates a function on a node" do
179-
browser.go_to("/ferrum/index")
179+
browser.go_to("/index")
180180
node = browser.at_xpath(".//a")
181181

182182
function = <<~JS
@@ -211,7 +211,7 @@
211211
browser.evaluate("$('a').first().text()")
212212
end.to raise_error(Ferrum::JavaScriptError)
213213

214-
browser.add_script_tag(url: "/ferrum/jquery.min.js")
214+
browser.add_script_tag(url: "/jquery.min.js")
215215

216216
expect(browser.evaluate("$('a').first().text()")).to eq("Relative")
217217
end
@@ -250,7 +250,7 @@
250250
browser.go_to
251251
expect(browser.evaluate(font_size)).to eq("16px")
252252

253-
browser.add_style_tag(url: "/ferrum/add_style_tag.css")
253+
browser.add_style_tag(url: "/add_style_tag.css")
254254

255255
expect(browser.evaluate(font_size)).to eq("50px")
256256
end

0 commit comments

Comments
 (0)