Closed minaairsupport closed 5 years ago
Hi there @minaairsupport! Our SDK is built to be used with async
/ await
. I'd expect this to work:
const assert = require("assert");
const { percySnapshot } = require("@percy/webdriverio");
describe("webdriver.io page", () => {
it("should have the right title", async () => {
await browser.url("https://webdriver.io");
let title = await browser.getTitle();
assert.strictEqual(title, "WebdriverIO · Next-gen WebDriver test framework for Node.js");
await percySnapshot(browser, 'sample');
});
});
Also notice I've moved percySnapshot
until after the page title assertion. You'll want to call percySnapshot
after the page has successfully loaded, that way the DOM snapshot that is captured is stable (and not of a still loading page).
Glad to know but could you update your documentation
I tried to integrate Percy with CircleCi I set the Percy_token on the environment variable
here is the whole yml script
my test code
what I am missing