Skip to content

Add serenity-cucumber sample folder#5

Open
vishantkkk wants to merge 4 commits into
browserstack:mainfrom
vishantkkk:main
Open

Add serenity-cucumber sample folder#5
vishantkkk wants to merge 4 commits into
browserstack:mainfrom
vishantkkk:main

Conversation

@vishantkkk
Copy link
Copy Markdown
Collaborator

@vishantkkk vishantkkk commented Apr 29, 2026

What

Adds a serenity-cucumber/ sample folder alongside the existing java/, junit-4/, junit-5/, and testng/ variants — covers the Serenity-Cucumber BDD framework being added to BrowserStack Load Testing under LTS-2849.

Mirrors the junit-5 structure with two scenarios (add-to-cart, checkout) on bstackdemo.com, expressed as Gherkin features and run via the JUnit 5 Platform Suite + Cucumber JUnit Platform Engine. Uses RemoteWebDriver against a local Selenium Grid hub at localhost:4444/wd/hub, matching the rest of the repo.

Folder contents

serenity-cucumber/
├── README.md                       (verbatim copy of junit-5/README.md, only the cd line changes)
├── browserstack-load.yml           (verbatim copy of junit-5/, framework: serenity-cucumber)
├── pom.xml                         (Selenium 4.15 + Serenity 4.2 + Cucumber 7.20 + JUnit 5)
└── src/test/
    ├── java/com/example/
    │   ├── RunCucumberTest.java    (JUnit 5 Platform Suite runner)
    │   └── StepDefs.java           (RemoteWebDriver + bstackdemo.com flows)
    └── resources/features/
        └── bstackdemo.feature      (2 BDD scenarios)

What differs from sibling variants (and why)

Aspect Siblings serenity-cucumber Reason
maven.compiler.source/target 11 17 Serenity 4.x requires JDK 17+
Surefire <include> **/*Test.java **/RunCucumberTest.java JUnit 5 Platform Suite class must be selected explicitly
Surefire failIfNoTests not set true Cucumber @ignore can skip every scenario; without this, Maven exits 0 on zero work and the load test reports false success
Deps Selenium + JUnit/TestNG + Serenity 4.2 + Cucumber 7.20 + JUnit Platform Suite BDD requires these
Source files SimpleTest.java RunCucumberTest.java + StepDefs.java + bstackdemo.feature BDD shape: runner + step defs + Gherkin
framework: in YAML junit / testng serenity-cucumber Maps to LT backend constant SELENIUM_FRAMEWORK_SERENITY_CUCUMBER

Verifying locally

# 1. Start a local Selenium Grid hub
docker run -d -p 4444:4444 --shm-size=2g selenium/standalone-chrome:latest

# 2. Compile + run the BDD scenarios
cd serenity-cucumber
mvn test

Adds a Serenity-Cucumber BDD variant alongside the existing java/junit-4/junit-5/testng folders. Mirrors the junit-5 structure with two scenarios (add-to-cart, checkout) on bstackdemo.com expressed as Gherkin features and run via the JUnit 5 Platform Suite + Cucumber JUnit Platform Engine. Uses RemoteWebDriver against a local Selenium Grid hub at localhost:4444/wd/hub, matching the rest of the repo.
Cucumber's @ignore tag can mark every scenario as skipped — Maven then
exits 0 with zero scenarios executed and the load test reports a false
success on no work. failIfNoTests=true makes Maven fail the build
instead. Cucumber-specific safety; not relevant to the JUnit/TestNG
siblings.
@vishantkkk vishantkkk requested a review from a team as a code owner April 29, 2026 12:30
@vishantkkk vishantkkk requested a review from MihirR-BS April 29, 2026 12:30
@vishantkkk
Copy link
Copy Markdown
Collaborator Author

semgrep/ci

The cart panel slides in async after the add-to-cart click, so getText()
on the cart's product title can return an empty string before the panel
finishes rendering. Add an explicit WebDriverWait to wait for the text
to appear, then assert. Smoke tested locally end-to-end (Selenium Grid
+ bstackdemo.com): 2 scenarios, 11 steps, all passing.
The previous narrow include `<include>**/RunCucumberTest.java</include>`
worked only as long as the runner class kept that exact filename. Combined
with `failIfNoTests=true`, any rename (e.g. CucumberTestRunner.java —
which is the more common Cucumber JUnit5 Suite convention) made
Surefire find zero tests and Maven exit with BUILD FAILURE *before any
test ran*. On the BrowserStack Load Testing pod this surfaced as
`errorType: initialization` with no log artifacts uploaded.

Switch to the four standard test-class patterns (Test*/Tests/TestCase)
plus `*Runner.java` to cover both Cucumber Suite naming conventions.
This keeps `failIfNoTests=true` honest while letting users rename the
runner class without silently breaking their LT runs.

Caught by the LTS-2849 QA watchdog (TC-21) on 2026-05-04 — see
BStackAutomation PR #65129 commit 35655ce23df for the matching fix
in the QA repo's local seed of this sample.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant