Skip to content

Commit 9ccd7fb

Browse files
committed
Ignore
1 parent 1134330 commit 9ccd7fb

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

sdk/ignorePlaywright.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ const { chromium } = require("playwright");
22
const { expect } = require("@playwright/test");
33
const smartuiSnapshot = require("@lambdatest/playwright-driver");
44

5+
6+
// username: Username can be found at automation dashboard
7+
const USERNAME = process.env.LT_USERNAME || "<USERNAME>";
8+
9+
// AccessKey: AccessKey can be generated from automation dashboard or profile section
10+
const KEY = process.env.LT_ACCESS_KEY || "<ACCESS_KEY>";
511
(async () => {
612
const capabilities = {
713
browserName: "Chrome",
@@ -10,8 +16,8 @@ const smartuiSnapshot = require("@lambdatest/playwright-driver");
1016
platform: "Windows 10",
1117
build: "Playwright SmartUI Build",
1218
name: "Playwright SmartUI Test",
13-
user: "jeeveshiitj",
14-
accessKey: "mtPSfImA94UZNUj92fOctXE1VrKR4uDAoYrVU1kKJlqzclR6xU",
19+
user: USERNAME,
20+
accessKey: KEY,
1521
network: true,
1622
video: true,
1723
console: true,
@@ -33,9 +39,13 @@ const smartuiSnapshot = require("@lambdatest/playwright-driver");
3339

3440
const page = await browser.newPage();
3541

36-
await page.goto("https://www.lambdatest.com");
37-
42+
await page.goto("https://ipinfo.io/");
43+
options = {
44+
ignoreDOM: {
45+
xpath: ['//*[@id="__next"]/div/div/main/section[4]'],
46+
}
47+
}
3848
// Add the following command in order to take screenshot in SmartUI
39-
await smartuiSnapshot.smartuiSnapshot(page, "LT-Home");
49+
await smartuiSnapshot.smartuiSnapshot(page, "Ignore-ticker", options);
4050
await browser.close();
4151
})();

0 commit comments

Comments
 (0)