Skip to content

Commit

Permalink
Merge pull request #139 from launchableinc/fix-test-path-order
Browse files Browse the repository at this point in the history
Fix test path order
  • Loading branch information
ninjinkun authored Feb 8, 2021
2 parents ea4cccc + 7d754e9 commit 4c5dadc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions launchable/commands/record/case_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ def f(case: TestCase, suite: TestSuite, report_file: str) -> TestPath:
filepath = os.path.relpath(filepath, start=base_path)

test_path = []
if classname:
test_path.append({"type": "class", "name": classname})
if filepath:
test_path.append({"type": "file", "name": filepath})
if classname:
test_path.append({"type": "class", "name": classname})
if case.name:
test_path.append(
{"type": "testcase", "name": case.name, "_lineno": case._elem.attrib.get("lineno")})
Expand Down
6 changes: 3 additions & 3 deletions tests/data/cypress/record_test_result.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{"events": [
{"type": "case", "testPath": [{"type": "class", "name": "cy.window() - get the global window object"}, {"type": "file", "name": "cypress/integration/examples/window.spec.js"}, {"type": "testcase", "name": "Window cy.window() - get the global window object", "_lineno": null}], "duration": 0.149, "status": 1, "stdout": "", "stderr": "", "created_at": "2021-01-20T08:49:02", "data": null}
{"type": "case", "testPath": [{"type": "file", "name": "cypress/integration/examples/window.spec.js"}, {"type": "class", "name": "cy.window() - get the global window object"}, {"type": "testcase", "name": "Window cy.window() - get the global window object", "_lineno": null}], "duration": 0.149, "status": 1, "stdout": "", "stderr": "", "created_at": "2021-01-20T08:49:02", "data": null}
,
{"type": "case", "testPath": [{"type": "class", "name": "cy.document() - get the document object"}, {"type": "file", "name": "cypress/integration/examples/window.spec.js"}, {"type": "testcase", "name": "Window cy.document() - get the document object", "_lineno": null}], "duration": 0.078, "status": 1, "stdout": "", "stderr": "", "created_at": "2021-01-20T08:49:02", "data": null}
{"type": "case", "testPath": [{"type": "file", "name": "cypress/integration/examples/window.spec.js"}, {"type": "class", "name": "cy.document() - get the document object"}, {"type": "testcase", "name": "Window cy.document() - get the document object", "_lineno": null}], "duration": 0.078, "status": 1, "stdout": "", "stderr": "", "created_at": "2021-01-20T08:49:02", "data": null}
,
{"type": "case", "testPath": [{"type": "class", "name": "cy.title() - get the title"}, {"type": "file", "name": "cypress/integration/examples/window.spec.js"}, {"type": "testcase", "name": "Window cy.title() - get the title", "_lineno": null}], "duration": 0.088, "status": 1, "stdout": "", "stderr": "", "created_at": "2021-01-20T08:49:02", "data": null}
{"type": "case", "testPath": [ {"type": "file", "name": "cypress/integration/examples/window.spec.js"}, {"type": "class", "name": "cy.title() - get the title"}, {"type": "testcase", "name": "Window cy.title() - get the title", "_lineno": null}], "duration": 0.088, "status": 1, "stdout": "", "stderr": "", "created_at": "2021-01-20T08:49:02", "data": null}
]}

0 comments on commit 4c5dadc

Please sign in to comment.