megaten88 / automationChallengePython

Python, Selenium, Pytest, Pytest BDD

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automation Challenge Python-Selenium

This is an automation challenge, done in August 2021.

Technologies used:

  • python3
  • selenium
  • pytest
  • pytest-BDD
  • pytest-html
  • webDriver-manager
  • faker
  • pipenv

Install PipEnv

To run the project, pipenv is recommended.

    pip install pipenv

All dependencies are available in Pipfile, run the command pipenv install on the project directory to install them.

    pipenv install

Project Structure

The project structure is design to follow a Page Object Model and BDD.

.
|-- assets
|   `-- style.css
|-- tests
|   |-- features
|   |   `-- challenge.feature
|   |-- pages
|   |   |-- accountInfoPage.py
|   |   |-- basePage.py
|   |   |-- homePage.py
|   |   |-- __init__.py
|   |   |-- locators.py
|   |   |-- loginPage.py
|   |   `-- registerPage.py
|   |-- step_defs
|   |   |-- challenge_steps.py
|   |   `-- __init__.py
|   `-- test_challenge.py
|-- Pipfile
|-- Pipfile.lock
|-- README.md
|-- report.html
`-- userData.json

Run Project

To run the project, be sure to have install all dependencies with pipenv. Once that is done, run:

    pipenv shell

and run pytest:

    pytest -v tests/test_challenge.py

There's also the pytest-html module that can generate the report.
To generate the report:

    pytest -v tests/test_challenge.py --html=report.html

About

Python, Selenium, Pytest, Pytest BDD


Languages

Language:HTML 46.2%Language:Python 42.7%Language:CSS 9.0%Language:Gherkin 2.1%