-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
9.21.0
Node.js Version
- Node: 22.x (also seen in GH Actions Ubuntu 22.04 runner)
Mode
WDIO Testrunner
Which capabilities are you using?
{
browserName: 'chrome'
browserVersion: 'latest'
platformName: 'Windows 10'
'wdio:maxInstances': 10
'wdio:enforceWebDriverClassic': true
}What happened?
SauceService.beforeTest attempts to set _suiteTitle using:
if (this._suiteTitle === 'Jasmine__TopLevel__Suite') {
this._suiteTitle = test.fullName.slice(
0,
test.fullName.indexOf(test.description || '') - 1
)
}On Jasmine runs the framework hook receives a test object without fullName (and sometimes without description). The call to slice throws, the error is logged by @wdio/utils (shim), and execution continues. The job still passes, but the logs are flooded with the error on every beforeTest.
Example log line (repeats for every spec):
ERROR @wdio/utils:shim: TypeError: Cannot read properties of undefined (reading 'slice')
at SauceService.beforeTest (.../node_modules/@wdio/sauce-service/build/index.js:257:40)
What is your expected behavior?
- Sauce service should handle missing
fullName/descriptiongracefully (either skip deriving the name or use a fallback) and avoid throwing.
Impact
- CI logs are flooded with hundreds of identical TypeErrors on passing suites, obscuring real issues.
- The service still works (job names / annotations may be missing), but logging noise is significant.
How to reproduce the bug.
Minimal reproduction steps
npm init wdio@latest(or use an existing v9.21.0 project) withframework: jasmineand enable@wdio/sauce-service.- Add a trivial Jasmine spec:
describe('sample', () => { it('runs', () => { expect(true).toBeTrue(); }); });
- Run via Sauce (e.g.,
wdio wdio.sauce.conf.ts -f jasmine --spec ./path/to/spec.ts) with valid Sauce creds. - Observe worker logs: every spec logs
TypeError: Cannot read properties of undefined (reading 'slice')from@wdio/utils:shimpointing toSauceService.beforeTest.
Relevant log output
Sanitized log below
2026-01-09T15:52:56.0782062Z [0-8] RUNNING in chrome(latest) on Windows 10 - file:///path/to/spec.ts
2026-01-09T15:52:56.2600204Z [0-7] RUNNING in chrome(latest) on Windows 10 - file:///path/to/spec.ts
...
2026-01-09T15:53:02.5111831Z [0-7] 2026-01-09T15:53:02.509Z ERROR @wdio/utils:shim: TypeError: Cannot read properties of undefined (reading 'slice')
[0-7] at SauceService.beforeTest (file:///path/to/project/node_modules/@wdio/sauce-service/build/index.js:257:40)
[0-7] at <anonymous> (/path/to/project/node_modules/@wdio/utils/build/index.js:945:22)
[0-7] Error in "BeforeTest Hook"
[0-7] at new Promise (<anonymous>)
Cannot read properties of undefined (reading 'slice')
[0-7] at <anonymous> (/path/to/project/node_modules/@wdio/utils/build/index.js:942:45)
[0-7] at Array.map (<anonymous>)
[0-7] at executeHooksWithArgs (/path/to/project/node_modules/@wdio/utils/build/index.js:942:31)
[0-7] at UserContext.testFrameworkFnWrapper (/path/to/project/node_modules/@wdio/utils/build/index.js:1171:45)
[0-7] at UserContext.testFnWrapper (/path/to/project/node_modules/@wdio/utils/build/index.js:1163:33)
[0-7] at UserContext.wrappedFn (/path/to/project/node_modules/@wdio/utils/build/index.js:1250:26)
[0-7] at QueueRunner.attempt (/path/to/project/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:8545:40)Code of Conduct
- I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues
Reactions are currently unavailable