Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Multi-test file #201

Closed
luciano-renzi opened this issue Sep 9, 2020 · 3 comments
Closed

Multi-test file #201

luciano-renzi opened this issue Sep 9, 2020 · 3 comments
Assignees
Labels
Milestone

Comments

@luciano-renzi
Copy link
Member

luciano-renzi commented Sep 9, 2020

Add the possibility to have more than one test per file.

  • A test would be a function that starts with 'test' defined in a module inside the 'tests' folder of a project.
  • The browser session is shared between every test in a module by default.
  • All tests inside a test file are run sequentially.
  • The data passed down to each tests is also shared.
@luciano-renzi
Copy link
Member Author

Example, a test file with two test (functions)

test_file_one.py

def test_one(data):
    assert 2 + 2 == 4

def test_two(data):
    assert 2 + 2 == 5

@luciano-renzi
Copy link
Member Author

luciano-renzi commented May 17, 2021

The report folder structure is the same when runnning a test file, a suite or a folder.

New report file structure:

reports/
    test_file_one/   # name of the execution (one test file, a suite, or an entire folder)
        2021.05.17.19.00.52.301/
            test_file_one/   # one folder for each individual test file
                report.json   # result of all test functions in test_file_one
             report.json   # result of every test function in every test file included in this execution

@luciano-renzi
Copy link
Member Author

luciano-renzi commented May 17, 2021

Example, json report for a test file:

[
    {
        "test_file": "test_file_one",
        "test": "test_one",
        "set_name": "",   <-- set name a random str used when the same test is run multiple times using test data.
                                         empty when there is no test data. (the test is run once)
        "environment": "",
        "result": "success",
        "description": null,
        "browser": "chrome",
        "test_data": {},
        "steps": [],
        "errors": [],
        "elapsed_time": 0.0,
        "timestamp": "2021.05.17.19.00.52.303"
    },
    {
        "test_file": "test_file_one",
        "test": "test_two",
        "set_name": "",
        "environment": "",
        "result": "failure",
        "description": null,
        "browser": "chrome",
        "test_data": {},
        "steps": [...]
        "errors": [...],
        "elapsed_time": 0.0,
        "timestamp": "2021.05.17.19.00.52.303"
    }
]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant