-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c6ef6d
commit 16b2d51
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const { Builder, By, Key, until } = require('selenium-webdriver'); | ||
const { smartuiSnapshot } = require('@lambdatest/selenium-driver'); | ||
|
||
// username: Username can be found at automation dashboard | ||
const USERNAME = process.env.LT_USERNAME || "<USERNAME>"; | ||
|
||
// AccessKey: AccessKey can be generated from automation dashboard or profile section | ||
const KEY = process.env.LT_ACCESS_KEY || "<ACCESS_KEY>"; | ||
|
||
// export BROWSER_NAME=edge | export BROWSER_NAME=firefox | export BROWSER_NAME=safari | ||
const BROWSER_NAME = process.env.BROWSER_NAME || "chrome"; | ||
|
||
let capabilities = { | ||
platform: "catalina", | ||
browserName: BROWSER_NAME, | ||
version: "latest", | ||
"LT:Options": { | ||
username: USERNAME, | ||
accessKey: KEY, | ||
project: "<PROJECT_NAME>", | ||
w3c: true, | ||
name: "SDK_Cloud_" + BROWSER_NAME, // name of the test | ||
build: "SmartUI_Node_SDK", // name of the build | ||
visual: true, | ||
}, | ||
}; | ||
|
||
(async function example() { | ||
// Setup Input capabilities | ||
var gridUrl = | ||
"https://" + USERNAME + ":" + KEY + "@hub.lambdatest.com/wd/hub"; | ||
|
||
let driver = await new Builder() | ||
.usingServer(gridUrl) | ||
.withCapabilities(capabilities) | ||
.build(); | ||
driver.manage().window().fullscreen(); | ||
try { | ||
await driver.get("https://www.lambdatest.com/visual-regression-testing"); | ||
await smartuiSnapshot(driver, "LT-SmartUI"); | ||
} finally { | ||
await driver.quit(); | ||
} | ||
})(); |