Generate Pytest Allure Report

Run the below command to execute the test script and save the report in the given path folder.

Run Allure command


py.test --alluredir=’/Users/admin/Documents/AllureReport/AppiumPythonLogs’ -v –s test_PytestAllure.py


After executing the above command allure report is stored in the given path in the form of json files as shown in below image.

Allure Logs

To create Report instantly

Open command prompt and type below command to generate a report instantly which opens in the browser.


allure serve report_path

allure serve  /Users/admin/Documents/AllureReport/AppiumPythonLogs




Now after executing the above command allure report will open in the browser.

Allure Logs

Here we can see the total number of test cases count. Click on the show all, it will open the test file or Test Suite dashboard which has all the details of cases.

Click on the Test file, Here we can see all the test methods which are defined in the file and in the Right side we can see all the allure test steps which are defined in specific methods.

Allure Logs

At the top of the report we can see the status of the number of test cases Pass , Failed , Skied etc.

In the test cases we can see the time taken and the duration of the test case executed.

Allure Logs

To Generate Allure report

Open command prompt and type below command to generate a report.


allure generate report_path --clean -o path_to_save_reports
 
allure generate /Users/admin/Documents/AllureReport/AppiumPythonLogs  --clean -o /reports/allure-report



Now it will generate an allure-report folder along with an index.xml file.

Generate allure report

To Open Generated Allure report

Open command prompt and type below command to open a generated allure report


allure open report_path_after_generated

allure open /reports/allure-report