Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions sdk/parameterisedSDKCloud.js
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();
}
})();
Loading