Skip to content

leandog/atdd-with-puppies-python-behave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Setup

If you don't yet have a .venv directory (which will typically be the case on first checkout)

python3 -m venv .venv

Setup your virtual environment and install dependencies:

Unix - bash shell

source .venv/bin/activate
pip install -r requirements.txt
playwright install

Windows - command prompt

.venv\Scripts\activate
pip install -r requirements.txt
playwright install

Run Functional Tests

By default, the functional tests run in headless mode:

behave

Run all functional tests WITH the @wip tag

behave --tags @wip --no-skipped

NOTE: In old versions of PowerShell you may have to place the @wip tag (or any other commands that include an @ sign) inside quotes like this: behave --tags '@wip' --no-skipped

Run all functional tests EXCEPT those with the @future tag

behave --tags ~@future --no-skipped

To show the browser while running and slow it down by 1,000 ms per call so a human can see what is happening:

Unix - bash shell

HEADLESS=false SLOW_BY=1000 behave

Windows - command prompt

set HEADLESS=false 
set SLOW_BY=1000 
behave
set HEADLESS= 
set SLOW_BY= 

Windows - PowerShell

$env:HEADLESS = "false"
$env:SLOW_BY = "1000"
behave
$env:HEADLESS=$null
$env:SLOW_BY=$null

You can also change the location of the application you are testing using the BASE_URL environment variable.

This is used to point at the site on different environments such as development, test, production, etc. By default, this is set to http://localhost:5063/

Unix - bash shell

BASE_URL="http://example.org:1234" behave

Windows - command prompt

set BASE_URL="http://example.org:1234"
behave
set BASE_URL=

Windows - PowerShell

$env:BASE_URL="http://example.org:1234"
behave
$env:BASE_URL=

Sometimes it is useful to show stdout (the output from print statements) when running the functional tests.

To do that pass the --no-capture flag as shown below:

behave --no-capture

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors