diff --git a/src/tools/sdk-utils/commands.ts b/src/tools/sdk-utils/commands.ts index 28ff9a5..f257347 100644 --- a/src/tools/sdk-utils/commands.ts +++ b/src/tools/sdk-utils/commands.ts @@ -7,6 +7,7 @@ const JAVA_FRAMEWORK_MAP: Record = { junit5: "junit5", junit4: "junit4", cucumber: "cucumber-testng", + serenity: "serenity", }; // Common Gradle setup instructions (platform-independent) diff --git a/src/tools/sdk-utils/constants.ts b/src/tools/sdk-utils/constants.ts index 15e3c02..5149e41 100644 --- a/src/tools/sdk-utils/constants.ts +++ b/src/tools/sdk-utils/constants.ts @@ -106,6 +106,63 @@ gradle clean test \`\`\` `; +const serenityInstructions = (username: string, accessKey: string) => ` +---STEP--- + +Set BrowserStack credentials as environment variables: +For macOS/Linux: +\`\`\`bash +export BROWSERSTACK_USERNAME=${username} +export BROWSERSTACK_ACCESS_KEY=${accessKey} +\`\`\` + +For Windows Command Prompt: +\`\`\`cmd +set BROWSERSTACK_USERNAME=${username} +set BROWSERSTACK_ACCESS_KEY=${accessKey} +\`\`\` + +---STEP--- + +Add serenity-browserstack dependency in pom.xml: +Add the following dependency to your pom.xml file and save it: +\`\`\`xml + + net.serenity-bdd + serenity-browserstack + 3.3.4 + +\`\`\` + +---STEP--- + +Set up serenity.conf file: +Create or update your serenity.conf file in the project root with the following configuration: +\`\`\` +webdriver { + driver = remote + remote.url = "https://hub.browserstack.com/wd/hub" +} +browserstack.user="${username}" +browserstack.key="${accessKey}" +\`\`\` + +---STEP--- + +Run your Serenity tests: +You can continue running your tests as you normally would. For example: + +Using Maven: +\`\`\`bash +mvn clean verify +\`\`\` + +Using Gradle: +\`\`\`bash +gradle clean test +\`\`\` +`; + /** * ---------- CSharp INSTRUCTIONS ---------- */ @@ -488,6 +545,7 @@ export const SUPPORTED_CONFIGURATIONS: ConfigMapping = { cucumber: { instructions: javaInstructions }, junit4: { instructions: javaInstructions }, junit5: { instructions: javaInstructions }, + serenity: { instructions: serenityInstructions }, }, }, csharp: { diff --git a/src/tools/sdk-utils/percy/constants.ts b/src/tools/sdk-utils/percy/constants.ts index 63a3eae..39dea6a 100644 --- a/src/tools/sdk-utils/percy/constants.ts +++ b/src/tools/sdk-utils/percy/constants.ts @@ -159,6 +159,7 @@ export const PERCY_INSTRUCTIONS: PercyConfigMapping = { cucumber: { script_updates: javaSeleniumInstructions }, junit4: { script_updates: javaSeleniumInstructions }, junit5: { script_updates: javaSeleniumInstructions }, + serenity: { script_updates: javaSeleniumInstructions }, }, }, csharp: { diff --git a/src/tools/sdk-utils/types.ts b/src/tools/sdk-utils/types.ts index 7a82790..e30449e 100644 --- a/src/tools/sdk-utils/types.ts +++ b/src/tools/sdk-utils/types.ts @@ -28,6 +28,7 @@ export enum SDKSupportedTestingFrameworkEnum { junit4 = "junit4", junit5 = "junit5", testng = "testng", + serenity = "serenity", cypress = "cypress", nunit = "nunit", mstest = "mstest",