Skip to content

Commit 5b2171a

Browse files
committed
Fix: bump test timeouts: 200ms -> 500ms
200ms allows for some flakiness. Most things will still finish faster. If the event doesn't happen in 500ms, that's probably interesting, finally.
1 parent bb2613c commit 5b2171a

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

test/integration/locator_test.exs

+9-9
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ defmodule Playwright.LocatorTest do
4040

4141
describe "Locator.check/2" do
4242
setup(%{assets: assets, page: page}) do
43-
options = %{timeout: 200}
43+
options = %{timeout: 500}
4444

4545
page |> Page.goto(assets.prefix <> "/empty.html")
4646
page |> Page.set_content("<input id='checkbox' type='checkbox'/>")
@@ -59,13 +59,13 @@ defmodule Playwright.LocatorTest do
5959
frame = Page.main_frame(page)
6060

6161
locator = Locator.new(frame, "input#bogus")
62-
assert {:error, %Error{message: "Timeout 200ms exceeded."}} = Locator.check(locator, options)
62+
assert {:error, %Error{message: "Timeout 500ms exceeded."}} = Locator.check(locator, options)
6363
end
6464
end
6565

6666
describe "Locator.click/2" do
6767
setup(%{assets: assets, page: page}) do
68-
options = %{timeout: 200}
68+
options = %{timeout: 500}
6969

7070
page |> Page.goto(assets.prefix <> "/empty.html")
7171
page |> Page.set_content("<a id='link' target=_blank rel=noopener href='/one-style.html'>yo</a>")
@@ -84,14 +84,14 @@ defmodule Playwright.LocatorTest do
8484
frame = Page.main_frame(page)
8585

8686
locator = Locator.new(frame, "a#bogus")
87-
assert {:error, %Error{message: "Timeout 200ms exceeded."}} = Locator.click(locator, options)
87+
assert {:error, %Error{message: "Timeout 500ms exceeded."}} = Locator.click(locator, options)
8888
end
8989

9090
test "clicking a button", %{assets: assets, page: page} do
9191
locator = Page.locator(page, "button")
9292
page |> Page.goto(assets.prefix <> "/input/button.html")
9393

94-
Locator.click(locator, %{timeout: 200})
94+
Locator.click(locator, %{timeout: 500})
9595
assert Page.evaluate(page, "window['result']") == "Clicked"
9696
end
9797
end
@@ -112,7 +112,7 @@ defmodule Playwright.LocatorTest do
112112
}
113113
""")
114114

115-
Locator.dblclick(locator, %{timeout: 200})
115+
Locator.dblclick(locator, %{timeout: 500})
116116
assert Page.evaluate(page, "window['double']") == true
117117
assert Page.evaluate(page, "window['result']") == "Clicked"
118118
end
@@ -694,7 +694,7 @@ defmodule Playwright.LocatorTest do
694694

695695
describe "Locator.uncheck/2" do
696696
setup(%{assets: assets, page: page}) do
697-
options = %{timeout: 200}
697+
options = %{timeout: 500}
698698

699699
page |> Page.goto(assets.prefix <> "/empty.html")
700700
page |> Page.set_content("<input id='checkbox' type='checkbox' checked/>")
@@ -712,13 +712,13 @@ defmodule Playwright.LocatorTest do
712712

713713
test "returns a timeout error when unable to 'uncheck'", %{options: options, page: page} do
714714
locator = Page.locator(page, "input#bogus")
715-
assert {:error, %Error{message: "Timeout 200ms exceeded."}} = Locator.uncheck(locator, options)
715+
assert {:error, %Error{message: "Timeout 500ms exceeded."}} = Locator.uncheck(locator, options)
716716
end
717717
end
718718

719719
describe "Locator.wait_for/2" do
720720
setup(%{assets: assets, page: page}) do
721-
options = %{timeout: 200}
721+
options = %{timeout: 500}
722722

723723
page |> Page.goto(assets.prefix <> "/empty.html")
724724

test/integration/page/expect_test.exs

+8-8
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ defmodule Playwright.Page.NetworkTest do
3737
test "w/ an event and a timeout", %{page: page} do
3838
{:error, %Error{message: message}} =
3939
Page.expect_event(page, :request_finished, %{
40-
timeout: 200
40+
timeout: 500
4141
})
4242

43-
assert message == "Timeout 200ms exceeded."
43+
assert message == "Timeout 500ms exceeded."
4444
end
4545

4646
test "w/ an event, a (truthy) predicate, and a timeout", %{assets: assets, page: page} do
@@ -51,7 +51,7 @@ defmodule Playwright.Page.NetworkTest do
5151
predicate: fn _, _ ->
5252
true
5353
end,
54-
timeout: 200
54+
timeout: 500
5555
})
5656

5757
assert event.type == :request_finished
@@ -65,10 +65,10 @@ defmodule Playwright.Page.NetworkTest do
6565
predicate: fn _, _ ->
6666
false
6767
end,
68-
timeout: 200
68+
timeout: 500
6969
})
7070

71-
assert message == "Timeout 200ms exceeded."
71+
assert message == "Timeout 500ms exceeded."
7272
end
7373
end
7474

@@ -115,14 +115,14 @@ defmodule Playwright.Page.NetworkTest do
115115
predicate: fn _, _ ->
116116
false
117117
end,
118-
timeout: 200
118+
timeout: 500
119119
},
120120
fn ->
121121
Page.goto(page, assets.empty)
122122
end
123123
)
124124

125-
assert message == "Timeout 200ms exceeded."
125+
assert message == "Timeout 500ms exceeded."
126126
end
127127

128128
test "w/ an event and a timeout", %{assets: assets, page: page} do
@@ -131,7 +131,7 @@ defmodule Playwright.Page.NetworkTest do
131131
page,
132132
:request_finished,
133133
%{
134-
timeout: 200
134+
timeout: 500
135135
},
136136
fn ->
137137
Page.goto(page, assets.empty)

test/integration/page_test.exs

+3-3
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ defmodule Playwright.PageTest do
220220
test "with a single option given mismatched attributes, returns a timeout", %{assets: assets, page: page} do
221221
page |> Page.goto(assets.prefix <> "/input/select.html")
222222

223-
assert {:error, %Error{message: "Timeout 200ms exceeded."}} =
224-
Page.select_option(page, "select", %{value: "green", label: "Brown"}, %{timeout: 200})
223+
assert {:error, %Error{message: "Timeout 500ms exceeded."}} =
224+
Page.select_option(page, "select", %{value: "green", label: "Brown"}, %{timeout: 500})
225225
end
226226

227227
test "with multiple options and a single-option select, selects the first", %{assets: assets, page: page} do
@@ -342,7 +342,7 @@ defmodule Playwright.PageTest do
342342
assert page |> Page.get_attribute("div#outer", "name") == "value"
343343
assert page |> Page.get_attribute("div#outer", "foo") == nil
344344

345-
assert({:error, %Error{}} = Page.get_attribute(page, "glorp", "foo", %{timeout: 200}))
345+
assert({:error, %Error{}} = Page.get_attribute(page, "glorp", "foo", %{timeout: 500}))
346346
end
347347
end
348348

0 commit comments

Comments
 (0)