Skip to main content

A simple library for automation testing with UI and API using Playwright

Project description

robotframework-playerlibrary

Simple GUI/API automation testing library written in Python using Playwright

Import the library:

*** Settings ***
Library           PlayerLibrary    assertion_timeout=10000    

assertion_timeout: Customize the timeout for each assertion in milliseconds

Example keyword:

*** Keywords ***
Login into the system using provided account
    Input Into    id:login-email       sample-test@abc.com
    Input Into    id:login-password    yourpassword
    Click    //button[contains(.,"Sign In")]
    Page Should Have    Welcome Back!

Example UI scenario:

Suite Setup          Start Browser Then Open Url    https://sample-system.com/     headless=True


Test Setup       Login into the system using provided account    AND
Test Teardown       Start new browser session
Suite Teardown      Quit all browsers

*** Test Cases ***
TC_01 - Check correctness of some elements on the screen
    Element Should Be Shown    ${calendar_picker}
    Element Should Be Shown    ${apply_btn}
    Element Should Be Shown    ${clear_btn}

Example API scenario:

TC_001 - Sample Rest API test case
    [Tags]     api    
    ${sample_header}    Create Header
    start api session
    ${resp}     rest post    ${URL}     ${sample_header}     ${post_body}
    rest patch    https://api.restful-api.dev/objects/${resp}[id]     ${sample_header}    ${patch_body}
    rest put      https://api.restful-api.dev/objects/${resp}[id]     ${sample_header}    ${put_body}
    rest delete   https://api.restful-api.dev/objects/${resp}[id]     ${sample_header}
    rest get      https://api.restful-api.dev/objects                 ${sample_header}
    Rest Dispose

Keyword documentation at https://lynhbn.github.io/robotframework-playerlibrary/keyword_document.html

Quick-hand prefix locator supported:

  • BUILT_IN_PREFIXES = ('id', 'text', 'data-test-id', 'data-testid','data-test')
  • ATTR_PREFIXES = ('placeholder', 'name', 'class', 'value', 'title')
  • OBJ_PREFIXES = ('link',)
  • XPATH_PREFIXES = ("xpath://", "//")

Project details


Download files

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

Source Distribution

robotframework-playerlibrary-1.1.0.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

robotframework_playerlibrary-1.1.0-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

Details for the file robotframework-playerlibrary-1.1.0.tar.gz.

File metadata

  • Download URL: robotframework-playerlibrary-1.1.0.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.6 importlib-metadata/6.8.0 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.31.0 rfc3986/1.5.0 tqdm/4.65.0 urllib3/1.26.16 CPython/3.10.12

File hashes

Hashes for robotframework-playerlibrary-1.1.0.tar.gz
Algorithm Hash digest
SHA256 59faee406dd9cbc88f19b02a6343b4d1747cbf3ef7d8223c0de20fafc60124c5
MD5 25a6c6ec48c9a4aafee45d3b98e31abf
BLAKE2b-256 33edcc7358e04e062803ffc695a378bf4acf6e4736fb0d317686da290bf4199f

See more details on using hashes here.

File details

Details for the file robotframework_playerlibrary-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: robotframework_playerlibrary-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.6 importlib-metadata/6.8.0 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.31.0 rfc3986/1.5.0 tqdm/4.65.0 urllib3/1.26.16 CPython/3.10.12

File hashes

Hashes for robotframework_playerlibrary-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43b9e2f7ef66872a1f40487f1aee8ee07b547f1a748a9bf273476edb37f0e2e2
MD5 fc2341e7d77dfb250de000905fb7fa50
BLAKE2b-256 2cccdcf646f7c657724ede45d8d3a631d3f7677df3c28e74b222e4a9f3e6953d

See more details on using hashes here.

Supported by

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