Skip to main content

Cypress-like bindings for Selenium with Python

Project description

Welcome to Pylenium

The mission here is simple:

Make the experience of Selenium more like Cypress.

I teach courses and do trainings for both Selenium and Cypress, but Selenium, out of the box, feels clunky.

Cypress has done an amazing job of making the testing experience more enjoyable - especially for beginners.

Pylenium looks to bring more Cypress-like bindings for Selenium and Python, so behaviors and names will be the same or similar.

Get Started

  1. Install Pylenium into your Project

    $ pip install pyleniumio
    
    • conftest.py is created at the Workspace Root
    • pylenium.json is created at the Workspace Root
    • Pylenium uses pytest as the testing framework
  2. Create a test_google.py file

  3. Install the chromedriver (in detail below)

  4. Write the following test in your new test file

def test_google_search(py):
    py.visit('https://google.com')
    py.get('[name="q"]').type('puppies')
    py.get('[name="btnK"]').submit()
    assert 'puppies' in py.title

Install Chromedriver

Everyone handles the install of their drivers differently.

As of right now, Pylenium expects your chromedriver to be on your PATH.

The easiest way to do this is with WebDriver Manager.

  1. Install the manager

    $ npm install -g webdriver-manager
    
  2. Then download the chromedriver executable

    $ webdriver-manager update
    

Run the Test

This depends on your IDE, environment and configurations, but you can easily do it from the CLI using:

$ python -m pytest 

YOU'RE ALL SET

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyleniumio-1.0.1.tar.gz (6.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page