Percy visual testing for Appium and Webdriver.
Assuming you have an existing Appium setup using Webdriver:
- Install the
@percy/appium-wd
package:yarn add -D @percy/appium-wd
ornpm i -D @percy/appium-wd
import
orrequire
the SDK into the test suite (this can be done in a setup file or anywhere before the tests start):import '@percy/appium-wd';
orrequire('@percy/appium-wd');
- Call
await driver.percySnapshot('snapshot name')
in your tests (for example):
test('Percy works', async () => {
await driver.percySnapshot('test');
});
- Finally, when running your tests, wrap the test command with
percy exec
. For example:percy exec -- jest
. Be sure yourPERCY_TOKEN
is set in the terminal you're runningpercy exec
from (you can get yourPERCY_TOKEN
from your Percy projects settings).