|
|
@ -95,17 +95,17 @@ export const staticProjects = { |
|
|
|
|
|
|
|
|
|
|
|
// return TRUE if test suite specified is activated from env-variables
|
|
|
|
// return TRUE if test suite specified is activated from env-variables
|
|
|
|
//
|
|
|
|
//
|
|
|
|
export const isTestSuiteActive = (type, xcdb) => { |
|
|
|
export const isTestSuiteActive = (apiType, dbType) => { |
|
|
|
const env = Cypress.env("testMode"); |
|
|
|
const env = Cypress.env("testMode"); |
|
|
|
if (!xcdb) { |
|
|
|
if (!dbType) { |
|
|
|
switch (type) { |
|
|
|
switch (apiType) { |
|
|
|
case "rest": |
|
|
|
case "rest": |
|
|
|
return env.includes("extREST") ? true : false; |
|
|
|
return env.includes("extREST") ? true : false; |
|
|
|
case "graphql": |
|
|
|
case "graphql": |
|
|
|
return env.includes("extGQL") ? true : false; |
|
|
|
return env.includes("extGQL") ? true : false; |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
switch (type) { |
|
|
|
switch (apiType) { |
|
|
|
case "rest": |
|
|
|
case "rest": |
|
|
|
return env.includes("xcdbREST") ? true : false; |
|
|
|
return env.includes("xcdbREST") ? true : false; |
|
|
|
case "graphql": |
|
|
|
case "graphql": |
|
|
@ -129,31 +129,31 @@ export const getPrimarySuite = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export const isSecondarySuite = (proj, xcdb) => { |
|
|
|
export const isSecondarySuite = (apiType, dbType) => { |
|
|
|
if (!isTestSuiteActive(proj, xcdb)) return false; |
|
|
|
if (!isTestSuiteActive(apiType, dbType)) return false; |
|
|
|
|
|
|
|
|
|
|
|
const env = Cypress.env("testMode").split("."); |
|
|
|
const env = Cypress.env("testMode").split("."); |
|
|
|
|
|
|
|
|
|
|
|
switch (env[0]) { |
|
|
|
switch (env[0]) { |
|
|
|
case "extREST": |
|
|
|
case "extREST": |
|
|
|
return proj == "rest" && !xcdb ? false : true; |
|
|
|
return apiType == "rest" && !dbType ? false : true; |
|
|
|
case "extGQL": |
|
|
|
case "extGQL": |
|
|
|
return proj == "graphql" && !xcdb ? false : true; |
|
|
|
return apiType == "graphql" && !dbType ? false : true; |
|
|
|
case "xcdbREST": |
|
|
|
case "xcdbREST": |
|
|
|
return proj == "rest" && xcdb ? false : true; |
|
|
|
return apiType == "rest" && dbType ? false : true; |
|
|
|
case "xcdbGQL": |
|
|
|
case "xcdbGQL": |
|
|
|
return proj == "graphql" && xcdb ? false : true; |
|
|
|
return apiType == "graphql" && dbType ? false : true; |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
let currentTestMode = ``; |
|
|
|
let currentTestMode = ``; |
|
|
|
let xcdbProjectString = ``; |
|
|
|
let xcdbProjectString = ``; |
|
|
|
export function setCurrentMode(proj, xcdb) { |
|
|
|
export function setCurrentMode(apiType, dbType) { |
|
|
|
if (!xcdb) { |
|
|
|
if (!dbType) { |
|
|
|
if (proj == "rest") currentTestMode = "extREST"; |
|
|
|
if (apiType == "rest") currentTestMode = "extREST"; |
|
|
|
else currentTestMode = "extGQL"; |
|
|
|
else currentTestMode = "extGQL"; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (proj == "rest") currentTestMode = "xcdbREST"; |
|
|
|
if (apiType == "rest") currentTestMode = "xcdbREST"; |
|
|
|
else currentTestMode = "xcdbGQL"; |
|
|
|
else currentTestMode = "xcdbGQL"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|