Skip to content

add smartui capabilities in LT:Options for selenium version >=4 #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 1, 2024
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
49 changes: 26 additions & 23 deletions hooks/examples/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ const USERNAME = process.env.LT_USERNAME || "username";
const KEY = process.env.LT_ACCESS_KEY || "accessKey";

// gridUrl: gridUrl can be found at automation dashboard
//const GRID_HOST = process.env.GRID_HOST || "@hub.sushobhit.dev.lambdatest.io/wd/hub"; //dev
const GRID_HOST =
process.env.GRID_HOST || "@hub.lambdatest.com/wd/hub"; //connect to lambdatest hub
const GRID_HOST = process.env.GRID_HOST || "@hub.lambdatest.com/wd/hub"; //connect to lambdatest hub

async function searchTextOnGoogle() {
var keys = process.argv;
Expand All @@ -34,32 +32,34 @@ async function searchTextOnGoogle() {
"accessKey": KEY,
name: "test session", // name of the test
build: platform + browserName + version, // name of the build
"smartUI.project": "smartuigithub",
// will generate random smartUI build if not specified
// "smartUI.build": "first",
"smartUI.options": {
"output": {
"errorColor": {
"red": 200,
"green": 0,
"blue": 255
"LT:Options": {
"smartUI.project": "smartuigithub",
// will generate random smartUI build if not specified
// "smartUI.build": "first",
"smartUI.options": {
"output": {
"errorColor": {
"red": 200,
"green": 0,
"blue": 255
},
"errorType": "movement",
"transparency": 0.3,
"largeImageThreshold": 100,
"useCrossOrigin": false,
"outputDiff": true
},
"errorType": "movement",
"transparency": 0.3,
"largeImageThreshold": 100,
"useCrossOrigin": false,
"outputDiff": true
},
"scaleToSameSize": true,
"ignore": "antialiasing"
"scaleToSameSize": true,
"ignore": "antialiasing"
}
}
};

//add github app capabilities
let githubURL = process.env.GITHUB_URL
if (githubURL){
if (githubURL) {
capabilities.github = {
url:githubURL
url: githubURL
}
}

Expand Down Expand Up @@ -104,7 +104,10 @@ async function startTest(gridUrl, capabilities, name) {
// For Smartui TakeScreenshot
setTimeout(function () {
console.log("taking screenshot ...")
driver.executeScript(`smartui.takeScreenshot,{"screenshotName":"web-page"}`).then(out => {
let config = {
screenshotName: "web-page"
};
driver.executeScript("smartui.takeScreenshot", config).then(out => {
console.log("RESPONSE :", out)
return
});
Expand Down
Loading