Skip to content

pbraiders/pomponne-test-bdd

Repository files navigation

The autogenerated table of contents is here

PBRaiders Pomponne BDD library

Lint CodeQL

Behavioral driven development library for PBRaiders Pomponne using pytest-bdd and pytest-splinter

Requirements

  • pbraiders: latest pomponne
  • python: ^3.9
  • python3-pip: ^21.1
  • python3-venv: ^3.9
  • python modules: selenium, pytest, pytest-bdd, pytest-splinter
  • web drivers: chromium-chromedriver or/and firefox-geckodriver

Installation

On Ubuntu Desktop 20.10

Installing PBRaiders

Install the latest PBRaiders pomponne version using the documentation

Installing Web Drivers

A driver is required to interact with the specified browser. Each browser has a particular Selenium WebDriver associated with it, so you need to install any one of the drivers provided; for example, geckodriver is a Selenium WebDriver that only operates with Mozilla Firefox.

Run:

apt-get install chromium-chromedriver firefox-geckodriver

Installing Python

This project requires an up-to-date version of Python 3. Run:

apt-get install python3 python3-pip python3-venv

Installing Python modules

This project uses venv to manage packages in an virtual environment. To set up the project on your local machine:

  1. Clone it from this GitHub repository.
  2. Run: python3 -m venv .venv from the command line in the project's root directory to create the virtual environment.
  3. Run: source .venv/bin/activate to activate the virtual environment.
  4. Run: pip install --upgrade pip to uprade pip.
  5. Run: pip install --upgrade setuptools to uprade setuptools.
  6. Run: pip install wheel ; pip install -r requirements.txt to install all the necessary packages.

Running the tests

Go to the tests folder and update the website configuration file

Once the virtual environment activated, the command used to run the tests is python -m pytest. Also, there is a provision to run the tests by providing the tag names. It can be achieved by appending -k and the tag name. e.g. python -m pytest -k adm

This framework uses pytest-html plugin to generate html reports for the test runs. To generate a report, run the command pipenv run python -m pytest -k automated --html=report.html

Documentation

Contributing

Thanks you for taking the time to contribute. Please fork the repository and make changes as you'd like.

If you have any ideas, just open an issue and tell me what you think. Pull requests are also warmly welcome.

If you encounter any bugs, please open an issue.

Be sure to include a title and clear description,as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring.

License

PBRaiders Pomponne BDD library is open-source and is licensed under the MIT License.