Skip to content

Commit

Permalink
Parameterised the file
Browse files Browse the repository at this point in the history
  • Loading branch information
Saurabh-LT committed Oct 9, 2024
1 parent 3c6ef6d commit 16b2d51
Showing 1 changed file with 44 additions and 0 deletions.
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();
}
})();

0 comments on commit 16b2d51

Please sign in to comment.