Giter Club home page Giter Club logo

taf's Introduction

Test Automation Framework

This is my first test automation framework based on Selenium-Webdriver with Python.

Project Structure

Here you can find a short description of main directories, and it's content

  • configurations - This contains config.ini file, where user can store data like, browser type, application URL and common test data.
  • fixtures - User can store the all the fixtures.
  • page_objects - All the page object model code along with the locators of respective pages can be stored.
  • reports - In this folder, reports will be created.
  • resources - requirements.txt file is kept to maintain the libraries required.
  • run_jobs - Scripts are saved to run test cases with specific marker.
  • test_cases - This folder will consist of test case files, conftest.py and pytest.ini file.
  • test_data - All required test data can be stored in this folder.
  • utilities - All common/reusable codes are stored in this folder.

Project Features

  • framework follows Page Object Model
  • the ability to easily generate legible and attractive test reports using allure reports.
  • tests can be run on popular browsers - Chrome and Firefox are preconfigured in DriverFactory class and both can be selected in conftest.py,

e.g.

@pytest.fixture()
def setup(browser):
    if browser == "chrome" or browser == "Chrome":
        driver = webdriver.Chrome()

Getting Started

To enjoy the automated tests, develop the framework or adapt it to your own purposes, just download the project or clone repository. You need to install packages using pip according to requirements.txt file. Run the command below in terminal:

# Navigate to resources folder
$ pip install -r requirements.txt

Run Automated Tests

To run selected test you need to set pytest as default test runner in Pycharm first

File > Settings > Tools > Python Integrated Tools > Testing > Default test runner: pytest

After that you just need to choose one of the tests from "tests" directory and click "Run test" green arrow.

Generate Test Report

Move to test_cases folder and execute below commands:

Run 1st command to run test cases and use allure to generate files for raw report creation. Run 2nd command to generate allure reports.

1. pytest --alluredir=../reports/my_allure_results
2. allure serve ../reports/my_allure_results

Report generated can be viewed in any browser.

taf's People

Contributors

sachinpatil280 avatar sachinpatil-medwing avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.