How do I configure ALLURE to display runs in different browsers? #3168
Closed
soloweyDev
started this conversation in
Start
Replies: 2 comments
-
|
Hi, @soloweyDev This is a common pitfall; see more details here. To resolve, try adding an extra parameter to help Allure keep the test results of different browsers apart: @pytest.fixture(autouse=True)
def add_browser_to_allure():
allure.dynamic.parameter("browser", f'{Browser.name}')
allure.dynamic.epic(f'{Browser.name}')Without the parameter, Allure doesn't have enough information and treats it as the results of multiple attempts of the same test (it keeps the most recent one while hiding the rest on the Retries tab). |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Thank you. It works! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm running a suite of tests on different browsers. Each test has a set of Labels. I can select a different set of browsers to run. All test run results are saved in the same folder. When generating a report, I only see the results of the last run. How can I get results from multiple runs separated by browser?
I can achieve this by running tests in a single suite for different browsers. Like this:
@pytest.fixture(autouse=True, scope="session", params=['chrome', 'edge', 'yandex'])
Project
@pytest.fixture(autouse=True, scope="session")
Test:
@allure.feature('Smoke')
@allure.story('Setup')
@allure.title('Test 2.1 - Initial settings')
def test_setup(setup_test: SetupTests, setup_page: SetupPage):
allure.dynamic.epic(f'{Browser.name}')
setup_test.test_setup(setup_page)
Run:
pytest -v test.py --browser CHROME --alluredir ALLURE_RESULT_DIR
pytest -v test.py --browser YANDEX --alluredir ALLURE_RESULT_DIR
pytest -v test.py --browser EDGE --alluredir ALLURE_RESULT_DIR
Create report:
allure serve ALLURE_RESULT_DIR
Beta Was this translation helpful? Give feedback.
All reactions