code style: prettier

BDD base project: Python + Behave

Basic example of using Python with Behave (BDD). This Gherkin example includes:

  • Basic Scenario
  • Scenario Outline
  • Tagged tests

Table of contents

Get started

Installation

pip3 install -r requirements.txt

on Ubuntu 20.04 (pyvirtualdisplay requirements, we use pyvirtualdisplay to avoid Cloudflare errors in headless mode):

sudo apt-get install xvfb xserver-xephyr tigervnc-standalone-server xfonts-base

How to run the tests

Running tests

behave

2 features passed, 0 failed, 0 skipped
6 scenarios passed, 0 failed, 0 skipped
30 steps passed, 0 failed, 0 skipped, 0 undefined
Took 0m50.056s
  • ./reports/ folder:

    Output

Running tests and generate Allure report

behave -f allure -o reports/allure_report/
  • ./reports/ folder:

    Output

Open Allure report

Note: allure is required.

allure serve reports/allure_report/

HTML report:

Output

Running tagged tests

Running tagged smoke tests

behave --tags=smoke

Running using customized tags

<div class="highlight highlight-source-shell position-relative overflow-auto" data-snippet-clipboard-copy-content="behave –tags='’
“>

behave --tags='
   
    '