All Projects → ElSnoMan → Pyleniumio

ElSnoMan / Pyleniumio

Licence: mit
Bring the best of Selenium and Cypress into a single Python package

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pyleniumio

Panther
A browser testing and web crawling library for PHP and Symfony
Stars: ✭ 2,480 (+3965.57%)
Mutual labels:  hacktoberfest, selenium, selenium-webdriver
Node Chromedriver
An installer and wrapper for Chromedriver.
Stars: ✭ 378 (+519.67%)
Mutual labels:  selenium, selenium-webdriver
Atata
C#/.NET test automation framework for web
Stars: ✭ 362 (+493.44%)
Mutual labels:  selenium, selenium-webdriver
Php Webdriver
PHP client for Selenium/WebDriver protocol. Previously facebook/php-webdriver
Stars: ✭ 4,477 (+7239.34%)
Mutual labels:  selenium, selenium-webdriver
Pywhatsapp
Python Automation using selenium & Scheduling of messages and media
Stars: ✭ 257 (+321.31%)
Mutual labels:  hacktoberfest, selenium
Playwright Go
Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.
Stars: ✭ 272 (+345.9%)
Mutual labels:  hacktoberfest, selenium
Golem
A complete test automation tool
Stars: ✭ 441 (+622.95%)
Mutual labels:  selenium, selenium-webdriver
atata-kendoui
A set of Atata components for Kendo UI
Stars: ✭ 17 (-72.13%)
Mutual labels:  selenium, selenium-webdriver
E2e Experiment
A demo project with Spring Boot / Angular application and e2e tests
Stars: ✭ 9 (-85.25%)
Mutual labels:  selenium, selenium-webdriver
Marionette client
Mozilla's Gecko Marionette client in golang
Stars: ✭ 21 (-65.57%)
Mutual labels:  selenium, selenium-webdriver
Javaee7 Petclinic
Java EE 7 Petclinic
Stars: ✭ 31 (-49.18%)
Mutual labels:  selenium, selenium-webdriver
Htmlelements
Html Elements is a Java framework providing easy-to-use way of interaction with web-page elements in web-page tests.
Stars: ✭ 258 (+322.95%)
Mutual labels:  selenium, selenium-webdriver
webdrivermanager-examples
JUnit tests with Selenium WebDriver and WebDriverManager
Stars: ✭ 94 (+54.1%)
Mutual labels:  selenium, selenium-webdriver
Codeceptjs
Supercharged End 2 End Testing Framework for NodeJS
Stars: ✭ 3,592 (+5788.52%)
Mutual labels:  hacktoberfest, selenium-webdriver
ZZULI-healthreport
郑州轻工业大学疫情打卡
Stars: ✭ 95 (+55.74%)
Mutual labels:  selenium, selenium-webdriver
Selenium Maven Template
A maven template for Selenium that will let you check out and go.
Stars: ✭ 403 (+560.66%)
Mutual labels:  selenium, selenium-webdriver
Wdio Video Reporter
Reporter for WebdriverIO v6 that makes videos of failed tests and has optional allure integration
Stars: ✭ 53 (-13.11%)
Mutual labels:  selenium, selenium-webdriver
PWAF
Python Webdriver Automation Framework
Stars: ✭ 37 (-39.34%)
Mutual labels:  selenium, selenium-webdriver
page-modeller
⚙️ Browser DevTools extension for modelling web pages for automation.
Stars: ✭ 66 (+8.2%)
Mutual labels:  selenium, selenium-webdriver
Instagramfirstcommenter
This bot will post a predefined comment as fast as possible to a new post on the target profile. I used this to successfully win tickets for a big music festival.
Stars: ✭ 26 (-57.38%)
Mutual labels:  selenium, selenium-webdriver

The mission is simple

Bring the best of Selenium, Cypress and Python into one package.

This means:

  • Automatic waiting and synchronization
  • Quick setup to start writing tests
  • Easy to use and clean syntax for amazing readability and maintainability
  • Automatic driver installation so you don't need to manage drivers
  • Leverage the awesome Python language
  • and more!

Test Example

Although Pylenium is a thin wrapper of Selenium, let's use this simple scenario to show the difference between using Selenium and Pylenium:

  1. Visit the QA at the Point website: https://qap.dev
  2. Hover the About link to reveal a menu
  3. Click the Leadership link in that menu
  4. Assert Carlos Kidman is on the Leadership page
def test_carlos_is_on_leadership(py):
    py.visit('https://qap.dev')
    py.get('a[href="/about"]').hover()
    py.get('a[href="/leadership"][class^="Header-nav"]').click()
    assert py.contains('Carlos Kidman')
# define your setup and teardown fixture
@pytest.fixture
def driver():
    driver = webdriver.Chrome()
    yield driver
    driver.quit()


def test_carlos_is_on_leadership_page_with_selenium(driver_setup):
    wait = WebDriverWait(driver, timeout=10)
    driver.get('https://qap.dev')
    
    # hover About link
    about_link = driver.find_element(By.CSS_SELECTOR, "a[href='/about']")
    actions = ActionChains(driver)
    actions.move_to_element(about_link).perform()
    
    # click Leadership link in About menu
    wait.until(EC.element_visible(By.CSS_SELECTOR, "a[href='/leadership'][class^='Header-nav']")).click()
    
    # check if 'Carlos Kidman' is on the page
    assert wait.until(lambda _: driver.find_element(By.XPATH, "//*[contains(text(), 'Carlos Kidman')]"))

Purpose

I teach courses and do trainings for both Selenium and Cypress, but Selenium, out of the box, feels clunky. When you start at a new place, you almost always need to "setup" the framework from scratch all over again. Instead of getting right to creating meaningful tests, you end up spending most of your time building a custom framework, maintaining it, and having to teach others to use it.

Also, many people blame Selenium for bad or flaky tests. This usually tells me that they have yet to experience someone that truly knows how to make Selenium amazing! This also tells me that they are not aware of the usual root causes that make Test Automation fail:

  • Poor programming skills, test design and practices
  • Flaky applications
  • Complex frameworks

What if we tried to get the best from both worlds and combine it with an amazing language?

Selenium has done an amazing job of providing W3C bindings to many languages and makes scaling a breeze.

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

Pylenium looks to bring more Cypress-like bindings and techniques to Selenium (like automatic waits) and still leverage Selenium's power along with the ease-of-use and power of Python.

Quick Start

The Official Pylenium Docs are the best place to start, but you can quickly get going with the following steps:

1. Install pyleniumio

pip install pyleniumio

---or---

pipenv install pyleniumio

2. Write a test

Create a directory called tests and then a test file called test_google.py

Define a new test called test_google_search

def test_google_search(py)

Pylenium uses pytest as the Test Framework. You only need to pass in pyto the function!

Now we can use Pylenium Commands to interact with the browser.

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

3. Run the Test

This will depend on your IDE, but you can always run tests from the CLI:

python -m pytest tests/test_google.py

You're all set! You should see the browser open and complete the commands we had in the test :)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].