Skip to content

Latest commit

 

History

History
86 lines (56 loc) · 1.94 KB

File metadata and controls

86 lines (56 loc) · 1.94 KB

Integrating screenshots in Allure Report with Pytest and Selenium

This repository is a part of Allure Report documentation and contains code examples for integrating screenshots in Allure Report with Pytest and Selenium. You can find the original documentation:

Preparation

  1. Make sure you have installed:

  2. Clone the repository via HTTPS:

    git clone https://github.com/allure-examples/guide-pytest-selenium-screenshots.git

    or SSH:

    git clone [email protected]:allure-examples/guide-pytest-selenium-screenshots.git
  3. In the shell of your choice, navigate to the repository directory:

    cd path/to/guide-pytest-selenium-screenshots

Run tests

The repository provides with automatic scripts that install the virtual environment, necessary packages, and run the tests. Run the script correspondind to your operating system. For Linux and MacOS:

./run.sh

For OS Windows:

.\run.bat

Alternatively:

  1. Create a Python virtual environment manually:

    python -m venv venv
  2. Activate the virtual environment (Linux and MacOS):

    source venv/bin/activate 

    OS Windows:

    .\venv\Scripts\Activate.ps1
  3. Install the packages used in the project:

    pip install -r requirements.txt
    
  4. Run Pytest:

    pytest
    

Run Allure Report

  1. To start a local Allure Report server, in the project root directory run:

    allure serve -p <port-of-your-choice>
  2. Browse Allure Report page on http://127.0.0.1:<port-of-your-choice>