Skip to content

testery/example-pytest-selenium

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example Pytest Selenium

Tags

  • webtest: marks a test that uses selenium
  • fail: marks a test that should fail
  • green: marks a test that should pass

To Run locally in vscode

Test Explorer settings.json file

Setup

  1. Install Python 3 (this also installs the python package-management system - pip)

  2. Set up virtual environment

  3. Install the requirements.txt through the terminal run pip install -r requirements.txt

  4. Set up any IDE configurations

    {
        "python.testing.pytestArgs": [
            ".",
            "--driver",
            "Chrome"
        ],
        "python.testing.unittestEnabled": false,
        "python.testing.pytestEnabled": true
    }

Sample pytest commands and arguments

Pytest help

pytest --help

Run sample non-selenium tests in a file

pytest -s test/test_class.py

Run selenium tests in a file

pytest ./test_selenium.py --driver Chrome

pytest ./test/test_basic.py --driver Chrome

About

Test project using Python and Selenium

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages