pyseleniumjs

Small library with javascript utilities for official Python selenium bindings.


Keywords
angularjs, e2e-tests, html, javascript, pyselenium-js, python, selenium
License
Apache-2.0
Install
pip install pyseleniumjs==1.3.8

Documentation

pyselenium-js

build Documentation Status Code Health codecov

PyPI version Join the chat at https://gitter.im/riot-view-router/Lobby

Lightweight python module to execute frequently used javascript functionality on a Selenium webdriver.

For an all inclusive selenium framework check out py-component-controller!

Official documentation be be read here.

About

pyselenium-js is a very simple, lightweight module that helps relieve some of the burden of e2e testing with the official Selenium bindings. The official Selenium bindings operate in the most natural way a user would operate against a given web page. The problem with this, is with more advanced and modern websites, these bindings may not always work as expected on custom elements or components.

An example of this being a div tag taking keyboard input, where div tags do not support the onfocus event listener by design -- and the selenium bindings invoke this before attempting to send input to the target DOM.

Usage

This project was created using selenium 3.12.0.

Support is available for both Python 2.7 and 3.4+.

pyselenium-js and can be installed using pip like so,

pip install pyseleniumjs

For more information refer to the official documentation here.

Testing

All module related e2e tests are in the pyselenium/tests subdirectory. To setup your environment run make setup. To stand up the mock site, run make app. This will serve the site on localhost:3000. To run the test suite, use make tests.

The mock website was created using angular.js 1.6, bulmacss, and webpack 3. It was designed to represent a common website layout with responsive capabilities. To add new features for unit tests, refer to pyjs-mock-site and be sure to update the submodule commit accordingly.

Note as of this time, tests for the Angular 2 bindings are not yet available.

Requirements:

  • Python 2.7, 3.4+ (with pip)
  • Chrome or Chromium (last confirmed test used version 67)
  • ChromeDriver (last confirmed test used version 2.38.3)
  • Node.js 6+ (with npm)

Contributors

Contributing guidelines are as follows,

  • Any new features added must also be unit tested in the pyseleniumjs/tests subdirectory.
    • Branches for bugs and features should be structured like so, issue-x-username.
  • Include your name and email in the contributors list.

Copyright (c) 2017 John Nolette Licensed under the Apache License, Version 2.0.