Skip to content

Commit d5024f4

Browse files
committed
MOB-44726: Playwright unit tests
1 parent 6b47257 commit d5024f4

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
@echo off
22
echo %*
33

4-
set REPORT_FILE=%TAURUS_ARTIFACTS_DIR%\PlaywrightTester.ldjson
5-
6-
echo {"test_case":"should load","test_suite":"demo","status":"PASSED","start_time":1537789085.169,"duration":0.002,"error_msg":null,"error_trace":null} > %REPORT_FILE%
4+
set REPORT_FILE=%TAURUS_ARTIFACTS_DIR%\taurus-playwright-reporter.jsonl
5+
echo {"timestamp":1770194006106,"label":"destination of week","ok":true,"concurency":10,"duration":6135,"connectTime":null,"latency":null,"status":"passed","expectedStatus":"passed","error":null,"runDetails":"destination of week:3:1:example2.spec.ts","logs":null,"byte_count":null} > %REPORT_FILE%
6+
echo {"timestamp":1770194006106,"label":"reserve flight","ok":true,"concurency":10,"duration":7257,"connectTime":null,"latency":null,"status":"passed","expectedStatus":"passed","error":null,"runDetails":"reserve flight:0:0:example2.spec.ts","logs":null,"byte_count":null} >> %REPORT_FILE%
77

88

tests/resources/playwright/playwright.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
# dump cmdline
44
echo "$@"
55

6-
REPORT_FILE="$TAURUS_ARTIFACTS_DIR/PlaywrightTester.ldjson"
7-
8-
echo '{"test_case":"should load","test_suite":"demo","status":"PASSED","start_time":1537789085.169,"duration":0.002,"error_msg":null,"error_trace":null}' > "$REPORT_FILE"
6+
REPORT_FILE="$TAURUS_ARTIFACTS_DIR/taurus-playwright-reporter.jsonl"
7+
echo '{"timestamp":1770194006106,"label":"destination of week","ok":true,"concurency":10,"duration":6135,"connectTime":null,"latency":null,"status":"passed","expectedStatus":"passed","error":null,"runDetails":"destination of week:3:1:example2.spec.ts","logs":null,"byte_count":null}' > "$REPORT_FILE"
8+
echo '{"timestamp":1770194006106,"label":"reserve flight","ok":true,"concurency":10,"duration":7257,"connectTime":null,"latency":null,"status":"passed","expectedStatus":"passed","error":null,"runDetails":"reserve flight:0:0:example2.spec.ts","logs":null,"byte_count":null}' >> "$REPORT_FILE"

tests/unit/modules/_selenium/test_javascript.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,14 @@ def test_playwright_full(self):
232232
self.assertEqual(self.obj.runner.execution["executor"], "playwright")
233233
self.assertEqual(self.obj.runner.engine.modules['playwright'], PlaywrightTester)
234234

235+
self.assertTrue(os.path.exists(self.obj.runner.reader.filename))
236+
samples = [sample for sample in self.obj.runner.reader._read(final_pass=True)]
237+
self.assertEqual(2, len(samples))
238+
self.assertEqual(samples[0][1], "destination of week")
239+
self.assertEqual(samples[0][6], 0)
240+
self.assertEqual(samples[1][1], "reserve flight")
241+
self.assertEqual(samples[1][6], 0)
242+
235243
def test_command_line(self):
236244
self.simple_run({
237245
'execution': {

0 commit comments

Comments
 (0)