Skip to content

[🐛 Bug]: BeforeTest hook in sauce-service throws an error Error in "BeforeTest Hook" Invalid left-hand side in assignment #13670

@wswebcreation

Description

@wswebcreation

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

latest

Node.js Version

20.11.1

Mode

Standalone Mode

Which capabilities are you using?

No response

What happened?

When running a test on Sauce the sauce-service updates the name of the test, see this, with the execute method, see this.

This now throws an error

[0-0] 2024-09-30T05:22:33.072Z ERROR @wdio/utils:shim: SyntaxError: Invalid left-hand side in assignment
[0-0]     at new Function (<anonymous>)
[0-0]     at Browser.execute (/Users/wimselles/Git/wdio/visual-testing/node_modules/.pnpm/webdriverio@9.1.2/node_modules/webdriverio/build/index.js:3032:53)
[0-0]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[0-0]     at Browser.wrapCommandFn (/Users/wimselles/Git/wdio/visual-testing/node_modules/.pnpm/@wdio+utils@9.1.2/node_modules/@wdio/utils/build/index.js:1380:23)
[0-0]     at async SauceService._setJobName (file:///Users/wimselles/Git/wdio/visual-testing/node_modules/.pnpm/@wdio+sauce-service@9.1.2/node_modules/@wdio/sauce-service/build/index.js:488:5)
[0-0]     at async SauceService.beforeTest (file:///Users/wimselles/Git/wdio/visual-testing/node_modules/.pnpm/@wdio+sauce-service@9.1.2/node_modules/@wdio/sauce-service/build/index.js:259:7)
[0-0]     at async Promise.all (index 1)
[0-0]     at executeHooksWithArgs (/Users/wimselles/Git/wdio/visual-testing/node_modules/.pnpm/@wdio+utils@9.1.2/node_modules/@wdio/utils/build/index.js:1363:18)
[0-0]     at Context.testFrameworkFnWrapper (/Users/wimselles/Git/wdio/visual-testing/node_modules/.pnpm/@wdio+utils@9.1.2/node_modules/@wdio/utils/build/index.js:1566:39)
[0-0] 2024-09-30T05:22:33.072Z DEBUG @wdio/utils:shim: Finished to run "beforeTest" hook in 0ms
[0-0] Error in "BeforeTest Hook"
Invalid left-hand side in assignment

What is your expected behavior?

The testname can be updated, which works with "^9.0.7"

How to reproduce the bug.

Create a simple test, use the latest sauce-service and let it automatically update the test in Sauce

Relevant log output

[0-0] 2024-09-30T05:22:33.072Z ERROR @wdio/utils:shim: SyntaxError: Invalid left-hand side in assignment
[0-0]     at new Function (<anonymous>)
[0-0]     at Browser.execute (/Users/wimselles/Git/wdio/visual-testing/node_modules/.pnpm/webdriverio@9.1.2/node_modules/webdriverio/build/index.js:3032:53)
[0-0]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[0-0]     at Browser.wrapCommandFn (/Users/wimselles/Git/wdio/visual-testing/node_modules/.pnpm/@wdio+utils@9.1.2/node_modules/@wdio/utils/build/index.js:1380:23)
[0-0]     at async SauceService._setJobName (file:///Users/wimselles/Git/wdio/visual-testing/node_modules/.pnpm/@wdio+sauce-service@9.1.2/node_modules/@wdio/sauce-service/build/index.js:488:5)
[0-0]     at async SauceService.beforeTest (file:///Users/wimselles/Git/wdio/visual-testing/node_modules/.pnpm/@wdio+sauce-service@9.1.2/node_modules/@wdio/sauce-service/build/index.js:259:7)
[0-0]     at async Promise.all (index 1)
[0-0]     at executeHooksWithArgs (/Users/wimselles/Git/wdio/visual-testing/node_modules/.pnpm/@wdio+utils@9.1.2/node_modules/@wdio/utils/build/index.js:1363:18)
[0-0]     at Context.testFrameworkFnWrapper (/Users/wimselles/Git/wdio/visual-testing/node_modules/.pnpm/@wdio+utils@9.1.2/node_modules/@wdio/utils/build/index.js:1566:39)
[0-0] 2024-09-30T05:22:33.072Z DEBUG @wdio/utils:shim: Finished to run "beforeTest" hook in 0ms
[0-0] Error in "BeforeTest Hook"
Invalid left-hand side in assignment

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions