Skip to content

Commit 76f5910

Browse files
authored
Merge pull request #99 from ruturaj-browserstack/main
feat: add support for Serenity framework in SDK utilities
2 parents 2606067 + ce479aa commit 76f5910

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed

src/tools/sdk-utils/commands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const JAVA_FRAMEWORK_MAP: Record<string, string> = {
77
junit5: "junit5",
88
junit4: "junit4",
99
cucumber: "cucumber-testng",
10+
serenity: "serenity",
1011
};
1112

1213
// Common Gradle setup instructions (platform-independent)

src/tools/sdk-utils/constants.ts

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,63 @@ gradle clean test
106106
\`\`\`
107107
`;
108108

109+
const serenityInstructions = (username: string, accessKey: string) => `
110+
---STEP---
111+
112+
Set BrowserStack credentials as environment variables:
113+
For macOS/Linux:
114+
\`\`\`bash
115+
export BROWSERSTACK_USERNAME=${username}
116+
export BROWSERSTACK_ACCESS_KEY=${accessKey}
117+
\`\`\`
118+
119+
For Windows Command Prompt:
120+
\`\`\`cmd
121+
set BROWSERSTACK_USERNAME=${username}
122+
set BROWSERSTACK_ACCESS_KEY=${accessKey}
123+
\`\`\`
124+
125+
---STEP---
126+
127+
Add serenity-browserstack dependency in pom.xml:
128+
Add the following dependency to your pom.xml file and save it:
129+
\`\`\`xml
130+
<dependency>
131+
<groupId>net.serenity-bdd</groupId>
132+
<artifactId>serenity-browserstack</artifactId>
133+
<version>3.3.4</version>
134+
</dependency>
135+
\`\`\`
136+
137+
---STEP---
138+
139+
Set up serenity.conf file:
140+
Create or update your serenity.conf file in the project root with the following configuration:
141+
\`\`\`
142+
webdriver {
143+
driver = remote
144+
remote.url = "https://hub.browserstack.com/wd/hub"
145+
}
146+
browserstack.user="${username}"
147+
browserstack.key="${accessKey}"
148+
\`\`\`
149+
150+
---STEP---
151+
152+
Run your Serenity tests:
153+
You can continue running your tests as you normally would. For example:
154+
155+
Using Maven:
156+
\`\`\`bash
157+
mvn clean verify
158+
\`\`\`
159+
160+
Using Gradle:
161+
\`\`\`bash
162+
gradle clean test
163+
\`\`\`
164+
`;
165+
109166
/**
110167
* ---------- CSharp INSTRUCTIONS ----------
111168
*/
@@ -488,6 +545,7 @@ export const SUPPORTED_CONFIGURATIONS: ConfigMapping = {
488545
cucumber: { instructions: javaInstructions },
489546
junit4: { instructions: javaInstructions },
490547
junit5: { instructions: javaInstructions },
548+
serenity: { instructions: serenityInstructions },
491549
},
492550
},
493551
csharp: {

src/tools/sdk-utils/percy/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export const PERCY_INSTRUCTIONS: PercyConfigMapping = {
159159
cucumber: { script_updates: javaSeleniumInstructions },
160160
junit4: { script_updates: javaSeleniumInstructions },
161161
junit5: { script_updates: javaSeleniumInstructions },
162+
serenity: { script_updates: javaSeleniumInstructions },
162163
},
163164
},
164165
csharp: {

src/tools/sdk-utils/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export enum SDKSupportedTestingFrameworkEnum {
2828
junit4 = "junit4",
2929
junit5 = "junit5",
3030
testng = "testng",
31+
serenity = "serenity",
3132
cypress = "cypress",
3233
nunit = "nunit",
3334
mstest = "mstest",

0 commit comments

Comments
 (0)