An open API service indexing awesome lists of open source software.

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

Demo repository for the guide on taking screenshots for Allure Report with Pytest and Selenium
https://github.com/allure-examples/guide-pytest-selenium-screenshots

allure allure-report guide pytest python selenium

Last synced: about 1 month ago
JSON representation

Demo repository for the guide on taking screenshots for Allure Report with Pytest and Selenium

Awesome Lists containing this project

README

          

# 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:

- [English version](https://allurereport.org/docs/guides/pytest-selenium-screenshots/)
- [Spanish version](https://allurereport.org/es/docs/guides/pytest-selenium-screenshots/)

## Preparation

1. Make sure you have installed:

- [Python](https://www.python.org/downloads/) version 3.9 or higher
- [Allure Report](https://allurereport.org/docs/install/)

1. Clone the repository via HTTPS:

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

or SSH:

```shell
git clone git@github.com:allure-examples/guide-pytest-selenium-screenshots.git
```

1. In the shell of your choice, navigate to the repository directory:

```shell
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:

```shell
.\run.bat
```

Alternatively:
1. Create a Python virtual environment manually:

```shell
python -m venv venv
```

1. Activate the virtual environment (Linux and MacOS):

```shell
source venv/bin/activate
```

OS Windows:

```powershell
.\venv\Scripts\Activate.ps1
```

1. Install the packages used in the project:

```
pip install -r requirements.txt
```

1. Run Pytest:

```
pytest
```

## Run Allure Report

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

```shell
allure serve -p
```

1. Browse Allure Report page on `http://127.0.0.1:`