Skip to content

tim-corley/selenium-pytest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Selenium Logo PyTest Logo

Automated UI Testing with Selenium & PyTest

Easy & Effective Browser Test Automation

Report Issue

Table of Contents
  1. About
  2. Getting Started
  3. Contact

About

This repo contains boilerplate code to get up-and-running with Automated UI Testing using Selenium & PyTest. It is intended to be used as a foundation for writing / adding your own tests.

Built With

  • Selenium - a toolset for web browser automation that uses the best techniques available to remotely control browser instances and emulate a user’s interaction with the browser
  • PyTest - a framework that makes building simple and scalable tests easy

Getting Started

Follow the steps below to get a local development instance up & running.

Prerequisites

  • Python3

  • pipenv

  • Drivers

    The drivers for each browser (Chrome & Firefox) need to be downloaded, converted to executables, and places in the usr/local/bin directory

    chmod +x Downloads/geckodriver
    sudo mv Downloads/geckodriver ../../usr/local/bin/

Installation

git clone
cd project_dir
pipenv shell
pipenv install

Test Data

Navigate to Automated Practice's create an account page and manually create a new test account. Then add the email address, password, and user name to a .env in project root.

[email protected]
PASSWORD=yourpassword
USERNAME=Your Name

Test Configuration

Set the desired test configurations (brower and url) via the config.json file. Supported browsers are: "Headless Chrome", "Chrome", and "Firefox".

Running Tests

  • Run All Tests

pipenv run python -m pytest

  • Run Single Test Suite/File

pipenv run python -m pytest tests/test_home.py

  • Run Single Test Case

pipenv run python -m pytest tests/test_home.py::test_LogoDisplayed

  • Run Tests in Parallel

pipenv run python -m pytest -n 2

Contact

Tim Corley | @tcor215 | [email protected]

About

boilerplate to get started with automated browser testing using selenium and pytest

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages