Skip to content

feat(wdio-runner): automatically include SoftAssertionService#14546

Merged
christian-bromann merged 10 commits intowebdriverio:mainfrom
JustasMonkev:feat/auto-enable-soft-assertions
Jun 11, 2025
Merged

feat(wdio-runner): automatically include SoftAssertionService#14546
christian-bromann merged 10 commits intowebdriverio:mainfrom
JustasMonkev:feat/auto-enable-soft-assertions

Conversation

@JustasMonkev
Copy link
Contributor

Proposed changes

This change integrates the SoftAssertionService from expect-webdriverio
directly into the wdio-runner package, making soft assertions available
to all WebdriverIO users without requiring manual configuration.

Users can now use expect.soft() to collect assertion failures without
halting test execution, improving the testing experience by providing
more comprehensive test reports.

With minimal performance impact, adding this feature by default eliminates
an unnecessary configuration step and reduces potential setup errors.

Related to: webdriverio/expect-webdriverio#1836

Types of changes

  • Polish (an improvement for an existing feature)
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (improvements to the project's docs)
  • Specification changes (updates to WebDriver command specifications)
  • Internal updates (everything related to internal scripts, governance documentation and CI files)

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Backport Request

//: # (The current main branch is the development branch for WebdriverIO v9. If your change should be released to the current major version of WebdriverIO (v8), please raise another PR with the same changes against the v8 branch.)

  • This change is solely for v9 and doesn't need to be back-ported
  • Back-ported PR at #XXXXX

Further comments

Reviewers: @webdriverio/project-committers

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jun 6, 2025

Open in StackBlitz

eslint-plugin-wdio

npm i https://pkg.pr.new/webdriverio/webdriverio/eslint-plugin-wdio@14546

@wdio/allure-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/allure-reporter@14546

@wdio/appium-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/appium-service@14546

@wdio/browser-runner

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/browser-runner@14546

@wdio/browserstack-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/browserstack-service@14546

@wdio/cli

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/cli@14546

@wdio/concise-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/concise-reporter@14546

@wdio/config

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/config@14546

@wdio/cucumber-framework

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/cucumber-framework@14546

@wdio/dot-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/dot-reporter@14546

@wdio/firefox-profile-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/firefox-profile-service@14546

@wdio/globals

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/globals@14546

@wdio/jasmine-framework

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/jasmine-framework@14546

@wdio/json-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/json-reporter@14546

@wdio/junit-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/junit-reporter@14546

@wdio/lighthouse-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/lighthouse-service@14546

@wdio/local-runner

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/local-runner@14546

@wdio/logger

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/logger@14546

@wdio/mocha-framework

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/mocha-framework@14546

@wdio/protocols

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/protocols@14546

@wdio/repl

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/repl@14546

@wdio/reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/reporter@14546

@wdio/runner

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/runner@14546

@wdio/sauce-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/sauce-service@14546

@wdio/shared-store-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/shared-store-service@14546

@wdio/smoke-test-cjs-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/smoke-test-cjs-service@14546

@wdio/smoke-test-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/smoke-test-reporter@14546

@wdio/smoke-test-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/smoke-test-service@14546

@wdio/spec-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/spec-reporter@14546

@wdio/static-server-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/static-server-service@14546

@wdio/sumologic-reporter

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/sumologic-reporter@14546

@wdio/testingbot-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/testingbot-service@14546

@wdio/types

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/types@14546

@wdio/utils

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/utils@14546

@wdio/webdriver-mock-service

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/webdriver-mock-service@14546

webdriver

npm i https://pkg.pr.new/webdriverio/webdriverio/webdriver@14546

webdriverio

npm i https://pkg.pr.new/webdriverio/webdriverio@14546

commit: c4324c0

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor updates but overall 👍 LGTM

@christian-bromann christian-bromann added PR: Polish 💅 PRs that contain improvements on existing features PR: New Feature 🚀 PRs that contain new features and removed PR: Polish 💅 PRs that contain improvements on existing features labels Jun 6, 2025
Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@christian-bromann
Copy link
Member

@JustasMonkev in order to get the unit tests pass we have to extend the mock for it we use across all unit tests: https://github.com/webdriverio/webdriverio/blob/main/__mocks__/expect-webdriverio.ts

@JustasMonkev
Copy link
Contributor Author

@JustasMonkev in order to get the unit tests pass we have to extend the mock for it we use across all unit tests: https://github.com/webdriverio/webdriverio/blob/main/__mocks__/expect-webdriverio.ts

@christian-bromann I will check it today, and try to fix it

@christian-bromann
Copy link
Member

@JustasMonkev I wonder if these snapshot issues are related to an updated to the expect package, thoughts?

@JustasMonkev
Copy link
Contributor Author

@JustasMonkev I wonder if these snapshot issues are related to an updated to the expect package, thoughts?

probably checking it, rigth now

@JustasMonkev
Copy link
Contributor Author

I think the issue is related to this: vitest-dev/vitest#7322
The expect library had many dependency updates in this release: @christian-bromann
https://github.com/webdriverio/expect-webdriverio/releases/tag/v5.2.1

@christian-bromann
Copy link
Member

Let's just adjust the snapshot for now and move on. At some point I would love to replace the jest expect library with the Vitest one.

@JustasMonkev
Copy link
Contributor Author

Let's just adjust the snapshot for now and move on. At some point I would love to replace the jest expect library with the Vitest one.

I commented out the failing part. When running the snapshot test, it passes, but it doesn't start the other tests it just exits after the first run is completed.

[0-0] This is the global teardown script speaking!
[0-0] PASSED in chrome - webdriverio/e2e/browser-runner/react.test.tsx

 "dot" Reporter:
..

 "spec" Reporter:
------------------------------------------------------------------
[chrome 139.0.7229.0 windows #0-0] Running: chrome (v139.0.7229.0) on windows
[chrome 139.0.7229.0 windows #0-0] Session ID: 5b1a76f00d5369145bc7030032408534
[chrome 139.0.7229.0 windows #0-0]
[chrome 139.0.7229.0 windows #0-0] React Component Testing
[chrome 139.0.7229.0 windows #0-0]    ✓ Test theme button toggle
[chrome 139.0.7229.0 windows #0-0]    ✓ supports snapshot tests
[chrome 139.0.7229.0 windows #0-0]
[chrome 139.0.7229.0 windows #0-0] 2 passing (16.8s)


Snapshot Summary:
1 snapshot(s) unchecked.

Spec Files:      1 passed, 1 total (100% completed) in 00:01:03

---------------------|---------|----------|---------|---------|-------------------
File                 | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
---------------------|---------|----------|---------|---------|-------------------
All files            |     100 |    83.33 |     100 |     100 | 
 __fixtures__        |     100 |      100 |     100 |     100 | 
  setup.js           |     100 |      100 |     100 |     100 | 
 components          |     100 |    83.33 |     100 |     100 | 
  ReactComponent.jsx |     100 |    83.33 |     100 |     100 | 7
---------------------|---------|----------|---------|---------|-------------------

> e2e@ test:browser:react:verifyCoverage \webdriverio\e2e
> run-s verifyCoverage


> e2e@ verifyCoverage \webdriverio\e2e
> test -d ./browser-runner/coverage

 ELIFECYCLE  Command failed with exit code 1.
ERROR: "verifyCoverage" exited with 1.
 ELIFECYCLE  Command failed with exit code 1.
ERROR: "test:browser:react:verifyCoverage" exited with 1.
 ELIFECYCLE  Command failed with exit code 1.
ERROR: "test:browser:react" exited with 1.
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.
ERROR: "test:component:run" exited with 1.
 ELIFECYCLE  Command failed with exit code 1.

@christian-bromann
Copy link
Member

1 snapshot(s) unchecked.

I think because of this ☝️

@JustasMonkev
Copy link
Contributor Author

1 snapshot(s) unchecked.

I think because of this ☝️

same is also in main branch 😄
https://github.com/webdriverio/webdriverio/actions/runs/15588961026/job/43902809841#step:6:51

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

I will fix the e2e test issue on main.

@christian-bromann christian-bromann merged commit 10cddfd into webdriverio:main Jun 11, 2025
6 checks passed
@wdio-bot
Copy link
Contributor

Hey JustasMonkev 👋

Thank you for your contribution to WebdriverIO! Your pull request has been marked as an "Expensable" contribution.

We've sent you an email with further instructions on how to claim your expenses from our development fund.
Please make sure to check your spam folder as well. If you have any questions, feel free to reach out to us at expense@webdriver.io or in the contributing channel on Discord.

We are looking forward to more contributions from you in the future 🙌

Have a nice day,
The WebdriverIO Team 🤖

AutomatedTester pushed a commit to AutomatedTester/webdriverio that referenced this pull request Jun 17, 2025
…verio#14546)

* feat: automatically include SoftAssertionService in the core

* fix(docs): clarify default inclusion of SoftAssertionService in documentation

* feat: add autoAssertOnTestEnd option to control soft assertion behavior

* Update website/docs/Configuration.md

* Update website/docs/Assertion.md

* refactor(docs): reorganize Soft Assertions section for clarity

* feat: add SoftAssertionService to expect-webdriverio mock

* fix(tests): adjust snapshot formatting for consistency in React component tests

---------

Co-authored-by: Christian Bromann <git@bromann.dev>
@dsufriawan
Copy link

dsufriawan commented Jun 22, 2025

Hi, when can we expect this to be published in NPM?
WDIO version in NPM is still 9.1.5

@christian-bromann
Copy link
Member

We've just published v9.16.0 that includes these changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Expensable $25 💸 PR: New Feature 🚀 PRs that contain new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants