Pylenium.io
GitHub ↗️
  • Welcome to Pylenium
  • Getting Started
    • 1. Virtual Environments
    • 2. Setup pytest
    • 3. Project Structure with pytest
    • 4. Writing Tests with Pylenium
  • Guides
    • πŸ“ŠVisualize Test Results with Allure
    • πŸ“Logging
    • 🟨Run Tests in Containers
    • πŸ”€Run Tests in Parallel
    • πŸ§ͺShould / Expected Conditions
    • 🌐Script with Standalone Pylenium
  • CLI
    • πŸ’»Pylenium CLI
    • πŸ“ŠAllure CLI
  • Configuration
    • πŸ“„pylenium.json
    • πŸš—Driver
    • πŸ–₯️Viewport
  • Fixtures
    • ↗️api
    • πŸͺ“axe
    • πŸ₯Έfake
    • βœ…py
    • β˜‘οΈpyc
    • ❌pys
  • Driver Commands
    • Overview
    • πŸ—ΊοΈNavigation
      • go
      • quit
      • reload
      • visit
    • πŸ”Find Elements
      • contains
      • find
      • findx
      • get
      • getx
    • ⏱️Driver.should()
    • 🌐Browser
      • execute_script
      • execute_async_script
      • maximize_window
      • screenshot
      • scroll_to
      • title
      • url
      • window_handles
      • window_size
      • viewport
    • πŸͺCookies
      • delete_all_cookies
      • delete_cookie
      • get_all_cookies
      • get_cookie
      • set_cookie
    • πŸ”„Switch To
      • default_content
      • frame
      • frame_by_element
      • parent_frame
      • window
      • new_window
      • new_tab
    • πŸ“ŠWeb Performance
      • Performance API
      • CDP Performance
    • fake
    • wait
    • webdriver
  • Element Commands
    • πŸ”Find Elements
    • ⏱️Element.should()
    • πŸ‘Actions
      • check
      • clear
      • click
      • deselect
      • double_click
      • drag_to
      • drag_to_element
      • focus
      • hover
      • right_click
      • scroll_into_view
      • select_by_index
      • select_by_text
      • select_by_value
      • submit
      • type
      • uncheck
      • upload
    • πŸ”’Element Data
      • css_value
      • get_attribute
      • get_property
      • tag_name
      • text
      • is_checked
      • is_displayed
      • is_enabled
      • is_selected
    • πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦Family
      • children
      • parent
      • siblings
    • open_shadow_dom
    • screenshot
    • webelement
  • Elements Commands
    • ⏱️Elements.should()
    • first
    • length
    • last
    • is_empty
  • Contribute
    • Clone and Setup the Project
Powered by GitBook
On this page
  • 1. Install pyleniumio
  • 2. Initialize Pylenium
  • 3. Select pytest as the Test Framework
  1. Getting Started

2. Setup pytest

pytest is a modern and powerful Test Framework and we want to get intellisense and autocomplete

Previous1. Virtual EnvironmentsNext3. Project Structure with pytest

Last updated 1 year ago

1. Install pyleniumio

Install Pylenium into your if you haven't already:

Terminal $ (venv)
pip install pyleniumio
Terminal
poetry add pyleniumio
Terminal
pipenv install pyleniumio

poetry and pipenv auto-generate virtual environments for you!

2. Initialize Pylenium

Terminal $ (venv)
pylenium init

Execute this command at your Project Root

This creates three files:

  • conftest.py - This has the fixtures needed for Pylenium

  • pylenium.json - This is the file for Pylenium

  • pytest.ini - This is the configuration file for pytest

By default, Pylenium uses the Chrome browser. Chrome must be installed on the machine, but you don't have to worry about installing any of the drivers.

3. Select pytest as the Test Framework

To get the most out of your IDE, you need to configure it to use pytest as the Test Framework. This will give you:

  • Intellisense

  • Autocomplete

  • Run/Debug Test functionality with breakpoints

  • more depending on IDE

1. Open Command Palette (CMD + SHIFT + P or CTRL + SHIFT + P)
2. Search for "Python: Configure Tests"
3. Select pytest
1. Open Preferences (or Settings)
2. Open Tools > Python Integrated Tools
3. Select pytest in the "Default test runner" dropdown

Visit the pytest docs for more info on how to use it:

Virtual Environment
configuration
https://docs.pytest.org/