Skip to content

Commit 15ad69b

Browse files
authored
Merge pull request #58 from tech-sushant/java
feat : add sdk support for Java + Testng + Cucumber
2 parents 0e44677 + 3f9336a commit 15ad69b

File tree

2 files changed

+52
-2
lines changed

2 files changed

+52
-2
lines changed

src/tools/sdk-utils/constants.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,46 @@ browserstack-sdk python
3333
\`\`\`
3434
`;
3535

36+
const argsInstruction =
37+
'-javaagent:"${com.browserstack:browserstack-java-sdk:jar}"';
38+
39+
const javaInstructions = `
40+
Strictly Add the following dependencies to your \`pom.xml\`:
41+
\`\`\`xml
42+
43+
com.browserstack
44+
browserstack-java-sdk
45+
LATEST
46+
compile
47+
48+
49+
${argsInstruction}
50+
\`\`\`
51+
52+
For Gradle projects, add to \`build.gradle\`:
53+
\`\`\`groovy
54+
dependencies {
55+
implementation 'com.browserstack:browserstack-java-sdk:LATEST'
56+
}
57+
\`\`\`
58+
59+
Inform user to export:
60+
\`\`\`bash
61+
export BROWSERSTACK_USERNAME=${config.browserstackUsername}
62+
export BROWSERSTACK_ACCESS_KEY=${config.browserstackAccessKey}
63+
\`\`\`
64+
65+
Run tests using:
66+
\`\`\`bash
67+
mvn clean test
68+
\`\`\`
69+
70+
Or for Gradle:
71+
\`\`\`bash
72+
gradle clean test
73+
\`\`\`
74+
`;
75+
3676
export const SUPPORTED_CONFIGURATIONS: ConfigMapping = {
3777
nodejs: {
3878
playwright: {
@@ -59,4 +99,12 @@ export const SUPPORTED_CONFIGURATIONS: ConfigMapping = {
5999
behave: { instructions: pythonInstructions },
60100
},
61101
},
102+
java: {
103+
playwright: {},
104+
selenium: {
105+
testng: { instructions: javaInstructions },
106+
cucumber: { instructions: javaInstructions },
107+
junit: { instructions: javaInstructions },
108+
},
109+
},
62110
};

src/tools/sdk-utils/types.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export type SDKSupportedLanguage = "nodejs" | "python";
1+
export type SDKSupportedLanguage = "nodejs" | "python" | "java";
22
export type SDKSupportedBrowserAutomationFramework = "playwright" | "selenium";
33
export type SDKSupportedTestingFramework =
44
| "jest"
@@ -10,7 +10,9 @@ export type SDKSupportedTestingFramework =
1010
| "cucumber"
1111
| "nightwatch"
1212
| "webdriverio"
13-
| "mocha";
13+
| "mocha"
14+
| "junit"
15+
| "testng";
1416

1517
export type ConfigMapping = Record<
1618
SDKSupportedLanguage,

0 commit comments

Comments
 (0)