Python client for visual testing with Percy for mobile apps
Project description
percy-appium-python
Percy visual testing for Python Appium.
Installation
npm install @percy/cli
:
$ npm install --save-dev @percy/cli
pip install Percy appium package:
$ pip install percy-appium-app
Usage
This is an example test using the percy_screenshot
function.
from appium import webdriver
from percy import percy_screenshot
driver = webdriver.Remote("https://" + userName + ":" + accessKey + "@hub-cloud.browserstack.com/wd/hub", desired_caps)
# take a screenshot
percy_screenshot(driver, 'here is some name')
Running the test above normally will result in the following log:
[percy] Percy is not running, disabling screenshots
When running with percy app:exec
, and your project's
PERCY_TOKEN
, a new Percy build will be created and screenshots will be uploaded to your project.
$ export PERCY_TOKEN=[your-project-token]
$ percy app:exec -- [python test command]
[percy] Percy has started!
[percy] Created build #1: https://percy.io/[your-project]
[percy] Screenshot taken "Python example"
[percy] Stopping percy...
[percy] Finalized build #1: https://percy.io/[your-project]
[percy] Done!
Configuration
percy_screenshot(driver, name[, **kwargs])
driver
(required) - A appium driver instancename
(required) - The screenshot name; must be unique to each screenshotdevice_name
(optional) - The device name used for capturing screenshotorientation
(optional) - Orientation of device while capturing screeenshot; Allowed values [portrait
|landscape
]status_bar_height
(optional) - Height of status bar; intnav_bar_height
(optional) - Height of navigation bar; intfull_screen
(optional) - Indicate whether app is full screen; booleanfullpage
(optional) - [Experimental] only supported on App Automate driver sessions [ needs @percy/cli 1.20.2+ ]; booleanscreen_lengths
(optional) - [Experimental] max screen lengths for fullPage [ needs @percy/cli 1.20.2+ ]; boolean
Migrating Config
If you have a previous Percy configuration file, migrate it to the newest version with the
config:migrate
command:
$ percy config:migrate
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
percy-appium-app-1.0.1.tar.gz
(19.9 kB
view hashes)
Built Distribution
Close
Hashes for percy_appium_app-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10366c2e5925692b7958ecd3db903062183af77ae71c7f2584f06832800f5e8f |
|
MD5 | e673009b86aa250d699dadd29f9051e1 |
|
BLAKE2b-256 | a9e7944aeac438a55243e93c5f1a8a62d4b0af6abca8d59c1a90303ee97e7c54 |