Skip to content

Commit d925b20

Browse files
Merge pull request #447 from LambdaTest/dev
StageToProd
2 parents 983ece2 + 0aa56b1 commit d925b20

File tree

7 files changed

+34
-3103
lines changed

7 files changed

+34
-3103
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ build/Release
4040
# Dependency directories
4141
node_modules/
4242
jspm_packages/
43+
package-lock.json
4344

4445
# TypeScript v1 declaration files
4546
typings/

accessibility/scanner/index.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,16 @@ const processAccessibilityReport = async (windowNew) => {
165165
let needsReviewValue = Cypress.env("NEEDS_REVIEW") !== "false"; // Default to true
166166
let captureScreenshot = Cypress.env("CAPTURE_SCREENSHOT") === "true";
167167
let passedTestCases = Cypress.env("PASSED_TEST_CASES") === "true";
168+
let testId = Cypress.env("TEST_ID") || ""
168169

169170
const payloadToSend = {
170171
message: 'SET_CONFIG',
171172
wcagCriteria: wcagCriteriaValue,
172173
bestPractice: bestPracticeValue,
173174
needsReview: needsReviewValue,
174175
captureScreenshot: captureScreenshot,
175-
passedTestCases: passedTestCases
176+
passedTestCases: passedTestCases,
177+
testId: testId
176178
};
177179

178180
console.log('log', "SET SCAN: Payload to send: ", payloadToSend);
@@ -186,7 +188,7 @@ const processAccessibilityReport = async (windowNew) => {
186188

187189
let scanData;
188190
try {
189-
const payload = {message: 'GET_LATEST_SCAN_DATA'};
191+
const payload = {message: 'GET_LATEST_SCAN_DATA', testId: testId};
190192
scanData = await getScanData(windowNew, payload);
191193
LambdatestLog("GET SCAN:LambdaTest Accessibility: Scanning URL");
192194
if (captureScreenshot) {
@@ -248,17 +250,18 @@ function oldprocessAccessibilityReport(win){
248250
let wcagCriteriaValue = Cypress.env("WCAG_CRITERIA") || "wcag21a";
249251
let bestPracticeValue = Cypress.env("BEST_PRACTICE") || false;
250252
let needsReviewValue = Cypress.env("NEEDS_REVIEW") || true;
253+
let testId = Cypress.env("TEST_ID") || ""
251254
bestPracticeValue = bestPracticeValue == "true" ? true : false;
252255
needsReviewValue = needsReviewValue == "true" ? true : false;
253256
const payloadToSend = {
254257
message: 'SET_CONFIG',
255258
wcagCriteria: wcagCriteriaValue,
256259
bestPractice: bestPracticeValue,
257-
needsReview: needsReviewValue
260+
needsReview: needsReviewValue,
261+
testId: testId
258262
}
259263

260264
console.log('log', "payload to send " + payloadToSend);
261-
let testId = Cypress.env("TEST_ID") || ""
262265

263266
const filePath = Cypress.env("ACCESSIBILITY_REPORT_PATH") || 'cypress/results/accessibilityReport_' + testId + '.json';
264267

@@ -267,6 +270,7 @@ function oldprocessAccessibilityReport(win){
267270

268271
const payload = {
269272
message: 'GET_LATEST_SCAN_DATA',
273+
testId: testId
270274
}
271275

272276
cy.wrap(getScanData(win, payload), {timeout: 45000}).then((res) => {

commands/utils/set_args.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,13 @@ function sync_args_from_cmd(args) {
461461
lt_config["run_settings"]["timezone"] = "";
462462
}
463463

464+
//Check for region
465+
if ("region" in args) {
466+
lt_config["run_settings"]["region"] = args["region"];
467+
} else if (!lt_config["run_settings"]["region"]) {
468+
lt_config["run_settings"]["region"] = "";
469+
}
470+
464471
if ("privateCloud" in args) {
465472
if (args["privateCloud"]=="true"){
466473
lt_config["run_settings"]["privateCloud"] = true;

commands/utils/validate.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,17 @@ module.exports = validate_config = function (lt_config, validation_configs) {
205205
}
206206
}
207207

208+
//validate if region field contains expected value
209+
if ("region" in lt_config["run_settings"]) {
210+
if (
211+
!(
212+
typeof lt_config["run_settings"]["region"] === "string"
213+
)
214+
) {
215+
reject("Error!! string value is expected in region key");
216+
}
217+
}
218+
208219
//validate if accessibility field contains expected value
209220
if ("accessibility" in lt_config["run_settings"]) {
210221
if (![true, false].includes(lt_config["run_settings"]["accessibility"])) {

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,11 @@ const argv = require("yargs")
261261
describe: "Set custom timezone in machine for cypress.",
262262
type: "string",
263263
})
264+
.option("reg",{
265+
alias: "region",
266+
describe: "Set data center region (e.g., us, eu, ap)",
267+
type: "string",
268+
})
264269
.option("pC",{
265270
alias: "privateCloud",
266271
describe: "Set custom private Cloud",

0 commit comments

Comments
 (0)