Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
447c4d3
SDK-7414: open the CLI flow for WebdriverIO-cucumber
AdityaHirapara Sep 2, 2026
78a90f2
feat(cli): add WdioCucumberTestFramework and drive it from cucumber's…
AdityaHirapara Sep 2, 2026
7299385
feat(cli): widen cucumber's shared dispatch gates and hook payload
AdityaHirapara Sep 2, 2026
71fa9bb
fix(cli): honour ignoreHooksStatus when marking cucumber sessions
AdityaHirapara Sep 2, 2026
e6596eb
fix(cli): route turboscale marking, hook-failure verdicts, a11y gate …
AdityaHirapara Sep 3, 2026
bdf9cb1
fix(cli): mark the cucumber session failed when a build hook fails wi…
AdityaHirapara Sep 3, 2026
650ca23
fix(cli): fail the cucumber session when any scenario fails, whatever…
AdityaHirapara Sep 4, 2026
28aa160
fix(a11y): decode goog:chromeOptions when it arrives over gRPC
AdityaHirapara Sep 6, 2026
e7f74f5
fix(cli): honour preferScenarioName on the CLI flow, and keep it out …
AdityaHirapara Sep 6, 2026
f1444f6
refactor(a11y): simplify the mocha-only guard on the hook scan gate
AdityaHirapara Sep 8, 2026
7573393
docs(cli): trim the cucumber hook comments in service.ts
AdityaHirapara Sep 8, 2026
ed012cf
refactor(cli): let automateModule own the preferScenarioName rename
AdityaHirapara Sep 8, 2026
a16ef31
docs(cli): drop parity-table references from cucumber comments
AdityaHirapara Sep 9, 2026
f8f5f6a
docs(cli): condense the BEFORE_ALL cascade comment
AdityaHirapara Sep 9, 2026
1382903
fix(cli): send the raw uri in bdd_meta_info.feature.path
AdityaHirapara Sep 9, 2026
e35a3d1
test(cli): name the cucumber framework suite as the main test file
AdityaHirapara Sep 9, 2026
8c550bd
test(cli): drop migration-plan references from test names and labels
AdityaHirapara Sep 9, 2026
17ed99f
fix(cli): relativise bdd_meta_info.feature.path, which 1382903 did not
AdityaHirapara Sep 9, 2026
f45497d
docs(cli): condense the build-level hook comment
AdityaHirapara Sep 9, 2026
f84fc39
fix(cli): status-mark a session even when setSessionName is false
AdityaHirapara Sep 9, 2026
59a03de
fix(cli): register the driver when every product is turned off
AdityaHirapara Sep 9, 2026
31c5cc7
test(cli): merge the driver-registration tests into service.test.ts
AdityaHirapara Sep 9, 2026
8d63e5f
test(cli): fold service.preferScenarioName.cli.test.ts into service.t…
AdityaHirapara Sep 9, 2026
5fd444d
test(cli): fold the automateModule satellites into its main suite
AdityaHirapara Sep 9, 2026
e9f9aaa
Merge branch 'main' into SDK-7414/wdio-cucumber-platformisation
AdityaHirapara Sep 9, 2026
6a73c32
style(test): drop an unnecessary semicolon failing lint
AdityaHirapara Sep 9, 2026
bb7eacf
Merge branch 'main' into SDK-7414/wdio-cucumber-platformisation
AdityaHirapara Sep 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/browserstack-service/src/cli/cliUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const CLI_DOWNLOAD_TMP_SUFFIX = '.zip'
export class CLIUtils {
static automationFrameworkDetail = {}
static testFrameworkDetail = {}
static CLISupportedFrameworks = ['mocha']
static CLISupportedFrameworks = ['mocha', 'cucumber']

static isDevelopmentEnv() {
return process.env.BROWSERSTACK_CLI_ENV === 'development'
Expand Down

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion packages/browserstack-service/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { BROWSERSTACK_ACCESSIBILITY, BROWSERSTACK_OBSERVABILITY, BROWSERSTACK_TE
import type { Options } from '@wdio/types'
import TestOpsConfig from '../testOps/testOpsConfig.js'
import WdioMochaTestFramework from './frameworks/wdioMochaTestFramework.js'
import WdioCucumberTestFramework from './frameworks/wdioCucumberTestFramework.js'
import WdioAutomationFramework from './frameworks/wdioAutomationFramework.js'
import WebdriverIOModule from './modules/webdriverIOModule.js'
import AccessibilityModule from './modules/accessibilityModule.js'
Expand Down Expand Up @@ -47,7 +48,7 @@ export class BrowserstackCLI {
modulesLoaded = false
binSessionId: string | null = null
modules: Record<string, BaseModule> = {}
testFramework: WdioMochaTestFramework|null = null
testFramework: WdioMochaTestFramework|WdioCucumberTestFramework|null = null
cliParams: Record<string, string> | null = null
automationFramework: WdioAutomationFramework|null = null
SDK_CLI_BIN_PATH: string | null = null
Expand Down Expand Up @@ -548,7 +549,15 @@ export class BrowserstackCLI {
const testFrameworkDetail = CLIUtils.getTestFrameworkDetail()
if (testFrameworkDetail.name.toLowerCase() === 'webdriverio-mocha') {
this.testFramework = new WdioMochaTestFramework([testFrameworkDetail.name], testFrameworkDetail.version, this.binSessionId as string)
return
}
if (testFrameworkDetail.name.toLowerCase() === 'webdriverio-cucumber') {
this.testFramework = new WdioCucumberTestFramework([testFrameworkDetail.name], testFrameworkDetail.version, this.binSessionId as string)
return
}
// An unmatched name leaves testFramework null, and every CLI event then no-ops with no
// error of any kind. Name it so the silence is diagnosable.
this.logger.error(`setupTestFramework: no CLI test framework registered for name=${testFrameworkDetail.name}; test events will not be tracked`)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,14 @@ export default class AccessibilityModule extends BaseModule {
if (!this.accessibility) {
return
}
// Open the scan gate for the hook window so DOM-changing commands issued inside
// before/beforeEach/afterEach/after hooks trigger scans (web per-command path). The
// following onBeforeTest re-computes the per-test gate, so this only affects the hook.
if (this.autoScanning && sessionId !== undefined && sessionId !== null) {
// Open the scan gate for the hook window, so commands issued inside hooks are scanned.
// Mocha-only, as legacy gates the identical write (`this._framework === 'mocha'`): it
// relies on the following onBeforeTest re-computing the gate, which holds only where
// beforeEach precedes beforeTest. Cucumber inverts that ordering, so there the write
// would land last and force the gate permanently open.
const frameworkName = String(TestFramework.getState(testInstance, TestFrameworkConstants.KEY_TEST_FRAMEWORK_NAME) || '')
const isMocha = frameworkName.toLowerCase().includes('mocha')
if (this.autoScanning && isMocha && sessionId) {
this.accessibilityMap.set(sessionId, true)
}
} catch (error) {
Expand Down Expand Up @@ -343,7 +347,13 @@ export default class AccessibilityModule extends BaseModule {

const sessionId = AutomationFramework.getState(autoInstance, AutomationFrameworkConstants.KEY_FRAMEWORK_SESSION_ID)
const accessibilityOptions = this.config.accessibilityOptions
const shouldScanTest = this.autoScanning && shouldScanTestForAccessibility(suiteTitle, test.title || '', accessibilityOptions as Record<string, string> | undefined) && this.accessibility
// Cucumber filters scans by gherkin tag, which needs the world object and the 6-arg
// form of shouldScanTestForAccessibility; the 3-arg form matches include/exclude tags
// against the test title instead and so silently scans every scenario. `args.world` is
// only ever populated on the cucumber path, so mocha and jasmine keep the exact 3-arg
// behaviour — both extra args arrive undefined/false and the tag branch is not taken.
const world = args.world as { [key: string]: unknown } | undefined
const shouldScanTest = this.autoScanning && shouldScanTestForAccessibility(suiteTitle, test.title || '', accessibilityOptions as Record<string, string> | undefined, world, Boolean(world)) && this.accessibility

this.accessibilityMap.set(sessionId, shouldScanTest)

Expand Down
Loading
Loading