Skip to main content

Library for bdd testing

Project description

PB TESTING

Library for testing using Page Object Pattern and Behaviour Driven Development.

Usage

This application is experimental and is used mainly for Engineer's Thesis.

It will be maintained for errors and probably in near future might get some new features.

Before using

Before creating any tests, you need geckodriver. It's crucial, because selenium, which is responsible for initializing the browser and doing actions, need this driver to work. Link for geckodriver: https://github.com/mozilla/geckodriver/releases.

There are several ways for preparing driver to coopearte with library, depending on Operating System. On each of systems: Microsoft Windows, macOS and Linux it looks a bit different. I was using Linux, so I will describe it here, but here are links for other OS:

Windows: http://www.learningaboutelectronics.com/Articles/How-to-install-geckodriver-Python-windows.php

macOS: https://medium.com/dropout-analytics/selenium-and-geckodriver-on-mac-b411dbfe61bc

On Linux you need to:

  • download driver,
  • unpack it with any tool,
  • set execute rights for user chmod 700,
  • put library on path /usr/local/bin. It can be done by moving it to location(mv), copying to location(cp) or linking to directory(ln). Each command will work <geckodriver_name> /usr/local/bin

It's worth mentioning that is not only working way to put geckodriver to work with selenium.

Commands

All commands are typed into terminal, using venv

To activate venv type command

source venv/bin/activate

It will look like this. venv will show up next to your name and command prompt source_venv.png


prepare

It will create:

  • directories: resources_for_testing, features, steps, pages
  • configuration_file config.ini
  • common_steps.py file in steps,`` consisting basic commands used in testing (selenium finding, clicking elements on site)
  • database for keeping urls from your project

This step is crucial, because it will setup all directoreies for using this library

Available frameworks for url scan: rails, django


pb_configuration

This method will pop gui with urls from your project and urls used in tests. It will look like this: how_pb_configuration_looks.png

On left we have urls scanned from project. On the right side there are urls that will be used in testing.

Between listboxes is arrow, which let user pass value from one listbox to another and at the bottom there are buttons, which also allow user to include new urls into testing.

Overall working: how_pb_configuration_works.png


step_creator

This gui is responsible for creating tests, using scanning urls and

OK, application is fine, but how to do testing?

Testing in this application is based on BDD. This means

Invocing tests Use command behave <name_of_feature_file> -D headless

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pb_testing-0.2.2.tar.gz (33.5 kB view details)

Uploaded Source

Built Distribution

pb_testing-0.2.2-py3-none-any.whl (51.1 kB view details)

Uploaded Python 3

File details

Details for the file pb_testing-0.2.2.tar.gz.

File metadata

  • Download URL: pb_testing-0.2.2.tar.gz
  • Upload date:
  • Size: 33.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for pb_testing-0.2.2.tar.gz
Algorithm Hash digest
SHA256 f0db06de932497a04b8d0e466698b356c1c76e2cbdc1a529e958d486249c4fbf
MD5 f6515b69f16b9e2a410c283177124719
BLAKE2b-256 3b482273046a3e03f9bb3a9fafef77fd77c78c2e09b324b80e9429194530353f

See more details on using hashes here.

File details

Details for the file pb_testing-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: pb_testing-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 51.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for pb_testing-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b0c9f6e6d0bce79f08679e61250f6e2f0b9bb9f7e5fee5ae554f484c7aa5a579
MD5 9b17c1d396d4cf08e919dd4021c51d61
BLAKE2b-256 76b0ae6318e0459eed03d7561352beddec8ad2161b1d34e503d19e3fb8a6c30d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page