Skip to content

Commit e8a653f

Browse files
committed
refactor: enhance error handling in validateSupportforAppAutomate
1 parent b67bea9 commit e8a653f

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/tools/appautomate-utils/appium-sdk/types.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,8 @@ export interface AppSDKInstruction {
6060
export const SUPPORTED_CONFIGURATIONS = {
6161
appium: {
6262
ruby: ["cucumberRuby"],
63-
java: [
64-
"junit5",
65-
"junit4",
66-
"testng",
67-
"cucumberTestng",
68-
"selenide",
69-
"jbehave",
70-
],
71-
csharp: ["nunit", "xunit", "mstest", "specflow", "reqnroll"],
63+
java: [],
64+
csharp: [],
7265
python: ["pytest", "robot", "behave", "lettuce"],
7366
nodejs: ["jest", "mocha", "cucumberJs", "webdriverio", "nightwatch"],
7467
},

src/tools/appautomate-utils/appium-sdk/utils.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,15 @@ export function validateSupportforAppAutomate(
9696
);
9797
}
9898

99-
const testingFrameworks = SUPPORTED_CONFIGURATIONS[framework][language];
99+
const testingFrameworks = SUPPORTED_CONFIGURATIONS[framework][
100+
language
101+
] as string[];
102+
103+
if (testingFrameworks.length === 0) {
104+
throw new Error(
105+
`No testing frameworks are supported for language '${language}' and framework '${framework}'.`,
106+
);
107+
}
100108
if (!testingFrameworks.includes(testingFramework)) {
101109
throw new Error(
102110
`Unsupported testing framework '${testingFramework}' for language '${language}' and framework '${framework}'. Supported testing frameworks: ${testingFrameworks.join(", ")}`,

0 commit comments

Comments
 (0)