Bug 1470659 - Move timeouts test to separate file. r=automatedtester,whimboo
authorAndreas Tolfsen <ato@sny.no>
Sat, 21 Jul 2018 18:35:23 +0100
changeset 825617 0ad9872c27e07e5f9dbbb62ec41e5be180e98f05
parent 825616 a3d141d56e531d882111ccf569c76427091ed088
child 825618 b5d9ec944fe0e33bdea383a1f0114ada1dcabdc3
push id118150
push usermaglione.k@gmail.com
push dateThu, 02 Aug 2018 04:47:08 +0000
reviewersautomatedtester, whimboo
bugs1470659
milestone63.0a1
Bug 1470659 - Move timeouts test to separate file. r=automatedtester,whimboo For similar reasons as for platformName, tests for configuring the timeouts object do not belong in the same parent test as those for response body structure.
testing/web-platform/tests/webdriver/tests/new_session/response.py
testing/web-platform/tests/webdriver/tests/new_session/timeouts.py
--- a/testing/web-platform/tests/webdriver/tests/new_session/response.py
+++ b/testing/web-platform/tests/webdriver/tests/new_session/response.py
@@ -46,21 +46,8 @@ def test_data(new_session, add_browser_c
         assert "platformName" in value["capabilities"]
     assert value["capabilities"]["acceptInsecureCerts"] is False
     assert isinstance(value["capabilities"]["setWindowRect"], bool)
     assert value["capabilities"]["timeouts"]["implicit"] == 0
     assert value["capabilities"]["timeouts"]["pageLoad"] == 300000
     assert value["capabilities"]["timeouts"]["script"] == 30000
     assert value["capabilities"]["proxy"] == {}
     assert value["capabilities"]["pageLoadStrategy"] == "normal"
-
-
-def test_timeouts(new_session, add_browser_capabilities, platform_name):
-    response, _ = new_session({"capabilities": {
-        "alwaysMatch": add_browser_capabilities({"timeouts": {"implicit": 1000}}),
-    }})
-    value = assert_success(response)
-
-    assert value["capabilities"]["timeouts"] == {
-        "implicit": 1000,
-        "pageLoad": 300000,
-        "script": 30000
-    }
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/webdriver/tests/new_session/timeouts.py
@@ -0,0 +1,22 @@
+import pytest
+
+from tests.support.asserts import assert_success
+
+
+def test_default_values(session):
+    timeouts = session.capabilities["timeouts"]
+
+    assert timeouts["implicit"] == 0
+    assert timeouts["pageLoad"] == 300000
+    assert timeouts["script"] == 30000
+
+
+@pytest.mark.parametrize("timeouts", [
+    {"implicit": 444, "pageLoad": 300000,"script": 30000},
+    {"implicit": 0, "pageLoad": 444,"script": 30000},
+    {"implicit": 0, "pageLoad": 300000,"script": 444},
+])
+def test_timeouts(new_session, add_browser_capabilities, timeouts):
+    response, _ = new_session({"capabilities": {"alwaysMatch": add_browser_capabilities({"timeouts": timeouts})}})
+    value = assert_success(response)
+    assert value["capabilities"]["timeouts"] == timeouts