Skip to main content

lambdatest-playwright-driver

SmartUI-Testing

SmartUI SDK for python playwright

Installation

Install Smart UI cli

$ npm install -g @lambdatest/smartui-cli 

Install Python Playwright Package

$ pip3 install lambdatest-playwright-driver

Methods

smartui_snapshot(page,"snapshotName")
  • page (required) - A page object instance from playwright is required.
  • snapshotName (required) - Name of the screenshot

Usage

Example playwright test using smartui_snapshot

from playwright.sync_api import sync_playwright, Playwright
from lambdatest_playwright_driver import smartui_snapshot

def run(playwright: Playwright):
    webkit = playwright.webkit
    browser = webkit.launch()
    context = browser.new_context()
    page = context.new_page()
    
    try:
        page.goto("https://www.lambdatest.com")
        smartui_snapshot(page, "example_snapshot", options={})
    except Exception as e:
        print(f"Error occurred during SmartUI snapshot: {e}")
    finally:
        browser.close()

with sync_playwright() as playwright:
    run(playwright)

Copy the project token from SmartUI Dashboard and set on CLI via comman For Linux/macOS:

 export PROJECT_TOKEN="****-****-****-************"

For Windows:

 set PROJECT_TOKEN="****-****-****-************"

Running test

$ npx smartui exec [python test command]

This will create new build and upload snapshot to Smart UI Project.

Executing above test

$ npx smartui exec python test.py
✔ Authenticated with SmartUI
  → using project token '******#ihcjks'
✔ SmartUI started
  → listening on port 8080
✔ Fetched git information
  → branch: main, commit: 7e336e6, author: Sushobhit Dua
✔ SmartUI build created
  → build id: ee2cb6c5-9541-494a-9c75-a74629396b80
✔ Execution of 'python3 test.py' completed; exited with code 0
  → INFO:@lambdatest/python-selenium-driver:Snapshot captured name
✔ Finalized build

Contribute

Reporting bugs

Our GitHub Issue Tracker will help you log bug reports.

Tips for submitting an issue: Keep in mind, you don't end up submitting two issues with the same information. Make sure you add a unique input in every issue that you submit. You could also provide a "+1" value in the comments.

Always provide the steps to reproduce before you submit a bug. Provide the environment details where you received the issue i.e. Browser Name, Browser Version, Operating System, Screen Resolution and more. Describe the situation that led to your encounter with bug. Describe the expected output, and the actual output precisely.

Pull Requests

We don't want to pull breaks in case you want to customize your LambdaTest experience. Before you proceed with implementing pull requests, keep in mind the following. Make sure you stick to coding conventions. Once you include tests, ensure that they all pass. Make sure to clean up your Git history, prior your submission of a pull-request. You can do so by using the interactive rebase command for committing and squashing, simultaneously with minor changes + fixes into the corresponding commits.

About LambdaTest

LambdaTest is a cloud based selenium grid infrastructure that can help you run automated cross browser compatibility tests on 2000+ different browser and operating system environments. LambdaTest supports all programming languages and frameworks that are supported with Selenium, and have easy integrations with all popular CI/CD platforms. It's a perfect solution to bring your selenium automation testing to cloud based infrastructure that not only helps you increase your test coverage over multiple desktop and mobile browsers, but also allows you to cut down your test execution time by running tests on parallel.

Metadata

Release files for lambdatest-playwright-driver 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lambdatest-playwright-driver 1.1.0
File Size Uploaded
lambdatest_playwright_driver-1.1.0.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lambdatest-playwright-driver 1.1.0
File Interpreter ABI Platform
lambdatest_playwright_driver-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.1 kB

Release files / lambdatest_playwright_driver-1.1.0.tar.gz

Download URL lambdatest_playwright_driver-1.1.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d9e9e76f498b9df527156297701c9f585fa4f9bccef7c878c28e4ecab80672c7
BLAKE2b-256 checksum
How to use checksums
508971136e267eb7c76fb21b243793170a381159ac533e83856197fdb862a6ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / lambdatest_playwright_driver-1.1.0-py3-none-any.whl

Download URL lambdatest_playwright_driver-1.1.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac1578b4d4c8838b103923721d37dc402e3410cbb2d2da605b4fa0907de9ba88
BLAKE2b-256 checksum
How to use checksums
cf9bdbca59718494801df9ff8eb91b7c5acffa51f413d9770a2a33f0ed886a3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page