Giter VIP home page Giter VIP logo

bdd-behave_sauce-demo_functional-testing_automation's Introduction

Purpose

This repository is for learning and practice purposes on authoring Gherkin scenarios in a BDD behave project. The sample scenarios covers functional related tests from the practice automation site Saucedemo.

For more coverage, feel free to create pull requests to add additional scenarios/scenario outlines into the repository.

Prerequisites

For both test authoring and execution:

  • Python 3.7+ Ensure that you have python installed in your system preferably Python 3.7 or higher.

Only for automated test execution:

  • Chrome
  • Chrome web driver for Selenium, which needs to be in your PATH environment variable. Ensure that the Chrome web driver you download is compatible to the chrome browser you are using. To check the version of your chrome browser, input this url in your chrome browser chrome://settings/help. The version should be displayed on that page.

Configuration

Configuration is contained in config.yaml. Here are the available options:

  • users: User information.

    • user_name: String. User name.
    • password: String. Password.
  • browser: General browser settings.

    • url: String. Base URL.
    • headless: Boolean. Whether to run the browser in headless mode.
    • size: String. Window dimensions in format width,height (e.g., 1920,1080).
    • extensions: Boolean. Whether to allow the use of installed extensions.
    • gpu: Boolean. Whether to enable GPU acceleration.

You can also create a file named config.override.yaml to selectively override a subset of the defaults without directly changing config.yaml, which is useful when you want to avoid Git picking up those changes. Example override file:

browser:
  headless: true

Development

Prerequisites:

  • Poetry 1.0.0+
    • Windows: pip install poetry
    • Linux/Mac: pip3 install --user poetry

poetry is a tool to handle dependency installation as well as building and packaging of Python packages. It only needs one file to do all of that: the new, standardized pyproject.toml.

In other words, poetry uses pyproject.toml to replace setup.py, requirements.txt, setup.cfg, MANIFEST.in and the newly added Pipfile.

After cloning this repository, prepare your development environment like so:

  • Set the virtual environment in your project locally: poetry config virtualenvs.in-project true --local
  • Set up the Python virtual environment: poetry install
  • Activate the pre-commit hooks: poetry run pre-commit install

Test Execution

Test Execution commands:

  • Run all scenarios: poetry run behave
  • Running tag specific scenarios: poetry run behave features --tags ~wip --tags @positive
  • Verify scenario syntax without actually running the tests: poetry run behave --dry-run

bdd-behave_sauce-demo_functional-testing_automation's People

Contributors

bddwithtim avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.