launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #28917
[Merge] ~andrey-fedoseev/launchpad:selenium into launchpad:master
Andrey Fedoseev has proposed merging ~andrey-fedoseev/launchpad:selenium into launchpad:master.
Commit message:
Ensure the tests run after the document is fully loaded
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~andrey-fedoseev/launchpad/+git/launchpad/+merge/427598
Hopefully, this will prevent test flakiness
in different environments
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~andrey-fedoseev/launchpad:selenium into launchpad:master.
diff --git a/lib/lp/testing/tests/test_html5browser.py b/lib/lp/testing/tests/test_html5browser.py
index 15db7b4..5118843 100644
--- a/lib/lp/testing/tests/test_html5browser.py
+++ b/lib/lp/testing/tests/test_html5browser.py
@@ -19,6 +19,7 @@ class TestBrowser(TestCase):
"""
<html><head>
<script type="text/javascript">
+ window.onload = function() {
// First test
setTimeout(function() {
window.top.test_results = JSON.stringify({
@@ -42,6 +43,7 @@ class TestBrowser(TestCase):
}, 200);
}, 200);
}, 100);
+ };
</script>
</head><body></body></html>
"""
@@ -64,12 +66,12 @@ class TestBrowser(TestCase):
)
def test_timeout_error(self):
- results = self.browser.run_tests(self.file_uri, timeout=250)
+ results = self.browser.run_tests(self.file_uri, timeout=150)
self.assertEqual(results.status, results.Status.TIMEOUT)
self.assertIsNone(results.results)
self.assertEqual(
- results.last_test_message,
{"testCase": "first", "testName": "first", "type": "passed"},
+ results.last_test_message,
)
def test_incremental_timeout_success(self):
@@ -78,11 +80,11 @@ class TestBrowser(TestCase):
)
self.assertEqual(results.status, results.Status.SUCCESS)
self.assertEqual(
- results.results,
{
"type": "complete",
"results": {"spam": "ham"},
},
+ results.results,
)
def test_incremental_timeout_error(self):
@@ -92,6 +94,6 @@ class TestBrowser(TestCase):
self.assertEqual(results.status, results.Status.TIMEOUT)
self.assertIsNone(results.results)
self.assertEqual(
- results.last_test_message,
{"testCase": "first", "testName": "first", "type": "passed"},
+ results.last_test_message,
)