Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@sh41
Copy link
Contributor

@sh41 sh41 commented Jul 25, 2025

Proposed changes

As per #14655 (comment) this PR is the start of an attempt to reinstate the tsConfigPath configuration file property. At the moment it is silently ignored.

This initial implementation is a naïve attempt to create tests that cover the functionality. I was surprised to find that TS config files are correctly parsed by the tests without needing to perform any additional gymnastics with jiti or similar.

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

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 25, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@sh41 sh41 force-pushed the tsConfigPath-in-wdio.conf branch from ce756ba to 25f8e98 Compare July 25, 2025 00:54
@sh41 sh41 changed the title tsConfigPath-in-wdio.conf tsConfigPath in wdio.conf Jul 25, 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 christian-bromann added the PR: Polish 💅 PRs that contain improvements on existing features label Jul 25, 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.

Can we reinstate docs around this option as well? I suggest to add some docs:

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jul 25, 2025

Open in StackBlitz

create-wdio

npm i https://pkg.pr.new/webdriverio/webdriverio/create-wdio@14664

eslint-plugin-wdio

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

@wdio/allure-reporter

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

@wdio/appium-service

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

@wdio/browser-runner

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

@wdio/browserstack-service

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

@wdio/cli

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

@wdio/concise-reporter

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

@wdio/config

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

@wdio/cucumber-framework

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

@wdio/dot-reporter

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

@wdio/firefox-profile-service

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

@wdio/globals

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

@wdio/jasmine-framework

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

@wdio/json-reporter

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

@wdio/junit-reporter

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

@wdio/lighthouse-service

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

@wdio/local-runner

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

@wdio/logger

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

@wdio/mocha-framework

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

@wdio/protocols

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

@wdio/repl

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

@wdio/reporter

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

@wdio/runner

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

@wdio/sauce-service

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

@wdio/shared-store-service

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

@wdio/smoke-test-cjs-service

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

@wdio/smoke-test-reporter

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

@wdio/smoke-test-service

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

@wdio/spec-reporter

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

@wdio/static-server-service

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

@wdio/sumologic-reporter

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

@wdio/testingbot-service

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

@wdio/types

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

@wdio/utils

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

@wdio/webdriver-mock-service

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

@wdio/xvfb

npm i https://pkg.pr.new/webdriverio/webdriverio/@wdio/xvfb@14664

webdriver

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

webdriverio

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

commit: 9372b64

@sh41
Copy link
Contributor Author

sh41 commented Jul 25, 2025

Can we reinstate docs around this option as well? I suggest to add some docs:

* https://webdriver.io/docs/configuration

* https://webdriver.io/docs/typescript

Sure, is there anything particular that you want added? This is what's there currently:

### tsConfigPath
WDIO uses `tsx` to compile TypeScript files. Your TSConfig is automatically detected from the current working directory but you can specify a custom path here or by setting the TSX_TSCONFIG_PATH environment variable.
See the `tsx` docs: https://tsx.is/dev-api/node-cli#custom-tsconfig-json-path
Type: `String`<br />
Default: `null`<br />

// Specify a custom tsconfig path - WDIO uses `tsx` to compile TypeScript files
// Your TSConfig is automatically detected from the current working directory
// but you can specify a custom path here or by setting the TSX_TSCONFIG_PATH env var
// See the `tsx` docs: https://tsx.is/dev-api/node-cli#custom-tsconfig-json-path
tsConfigPath: 'path/to/tsconfig.json',

#### Custom TSConfig
If you need to set a different path for `tsconfig.json` please set the TSCONFIG_PATH environment variable with your desired path, or use wdio config's [tsConfigPath setting](/docs/configurationfile).
Alternatively, you can use the [environment variable](https://tsx.is/dev-api/node-cli#custom-tsconfig-json-path) for `tsx`.

I'll have a look at those failures on the windows pipeline. It's something to do with the path separators being different.

@sh41 sh41 force-pushed the tsConfigPath-in-wdio.conf branch from 25f8e98 to 2b98fba Compare July 25, 2025 19:06
@sh41 sh41 requested a review from christian-bromann July 25, 2025 19:20
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 👍

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.

@sh41 it seems like some of the unit tests are legitimately failing on Windows. Mind taking a look?

@sh41
Copy link
Contributor Author

sh41 commented Aug 1, 2025

@sh41 it seems like some of the unit tests are legitimately failing on Windows. Mind taking a look?

Sure! I'll need to get the tests running in Windows so I can see what's going on, so might take a few days.

@sh41 sh41 force-pushed the tsConfigPath-in-wdio.conf branch 2 times, most recently from 43450a7 to 2bbc262 Compare August 1, 2025 15:31
@sh41
Copy link
Contributor Author

sh41 commented Aug 1, 2025

@sh41 it seems like some of the unit tests are legitimately failing on Windows. Mind taking a look?

@christian-bromann I've updated the paths to be consistent on Windows and the pipeline now successfully passes in my own fork, so hopefully this is now good to go again.

@sh41 sh41 requested a review from christian-bromann August 10, 2025 11:14
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 👍

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.

@sh41 it seems like the e2e tests are failing, mind taking a look?

@sh41
Copy link
Contributor Author

sh41 commented Aug 13, 2025

Hi @christian-bromann, I was running node v24 locally which is able to handle TS files without any additional transpiling 🤦. I've now got v20.11.1, so I will rework the PR to work with that version.

@sh41 sh41 force-pushed the tsConfigPath-in-wdio.conf branch from 2bbc262 to 76dcc33 Compare August 13, 2025 09:05
@sh41
Copy link
Contributor Author

sh41 commented Aug 13, 2025

Commit 76dcc33 adds jiti as a dependency to the wdio-config package and uses it to import modules. The e2e tests now pass with node v20.11.1 on my Ubuntu dev setup. I don't have a MacOS or Windows config to test on. @christian-bromann could you trigger the workflow so that I can check if there is more to do?

@sh41 sh41 requested a review from christian-bromann August 13, 2025 09:10
@sh41 sh41 force-pushed the tsConfigPath-in-wdio.conf branch from 76dcc33 to 13dd1b9 Compare August 24, 2025 08:01
@sh41
Copy link
Contributor Author

sh41 commented Aug 24, 2025

HI @christian-bromann, the testing workflow passed. I received a failure notice for the continuous release workflow. My branch had merge conflicts with main so I've rebased and pushed again. Is the CR workflow something that I need to look at?

@sh41
Copy link
Contributor Author

sh41 commented Sep 9, 2025

Hi @christian-bromann, I've merged main to pick up #14748 which will hopefully resolve the failing workflow issue. 👍

Enables parsing of TS config files, in order to read the tsConfig setting and run with TS support enabled.
@sh41 sh41 force-pushed the tsConfigPath-in-wdio.conf branch from 24c0381 to 9372b64 Compare September 21, 2025 18:52
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 christian-bromann merged commit 6173b79 into webdriverio:main Sep 22, 2025
59 checks passed
@wdio-bot
Copy link
Contributor

Hey sh41 👋

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.
⚠️ You seemed to have committed using an email address ending up with @users.noreply.github.com, if you don't receive the email please 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 🤖

sh41 added a commit to sh41/webdriverio that referenced this pull request Oct 8, 2025
This reverts most of commit 6173b79.

The introduction of jiti caused significant regressions for users with complex `wdio.conf.ts` files, as reported in webdriverio#14801. This change restores the previous import mechanism to resolve these issues.

It retains the attempt to load the config file and parse the tsConfigPath setting from it, with a cache-busting mechanism to prevent Node from caching failed imports. Documentation has been updated to explain the limitations of this configuration method.

Fixes webdriverio#14801
sh41 added a commit to sh41/webdriverio that referenced this pull request Oct 8, 2025
This reverts most of commit 6173b79.

The introduction of jiti caused significant regressions for users with complex `wdio.conf.ts` files, as reported in webdriverio#14801. This change restores the previous import mechanism to resolve these issues.

It retains the attempt to load the config file and parse the tsConfigPath setting from it, with a cache-busting mechanism to prevent Node from caching failed imports. Documentation has been updated to explain the limitations of this configuration method.

Fixes webdriverio#14801
sh41 added a commit to sh41/webdriverio that referenced this pull request Oct 8, 2025
This reverts most of commit 6173b79.

The introduction of jiti caused significant regressions for users with complex `wdio.conf.ts` files, as reported in webdriverio#14801. This change restores the previous import mechanism to resolve these issues.

It retains the attempt to load the config file and parse the tsConfigPath setting from it, with a cache-busting mechanism to prevent Node from caching failed imports. Documentation has been updated to explain the limitations of this configuration method.

Fixes webdriverio#14801
sh41 added a commit to sh41/webdriverio that referenced this pull request Oct 8, 2025
This reverts most of commit 6173b79.

The introduction of jiti caused significant regressions for users with complex `wdio.conf.ts` files, as reported in webdriverio#14801. This change restores the previous import mechanism to resolve these issues.

It retains the attempt to load the config file and parse the tsConfigPath setting from it, with a cache-busting mechanism to prevent Node from caching failed imports. Documentation has been updated to explain the limitations of this configuration method.

Fixes webdriverio#14801
sh41 added a commit to sh41/webdriverio that referenced this pull request Nov 4, 2025
This reverts most of commit 6173b79.

The introduction of jiti caused significant regressions for users with complex `wdio.conf.ts` files, as reported in webdriverio#14801. This change restores the previous import mechanism to resolve these issues.

It retains the attempt to load the config file and parse the tsConfigPath setting from it, with a cache-busting mechanism to prevent Node from caching failed imports. Documentation has been updated to explain the limitations of this configuration method.

Fixes webdriverio#14801
christian-bromann pushed a commit that referenced this pull request Nov 14, 2025
* 🐛⏪️ revert: "tsConfigPath in wdio.conf (#14664)"

This reverts most of commit 6173b79.

The introduction of jiti caused significant regressions for users with complex `wdio.conf.ts` files, as reported in #14801. This change restores the previous import mechanism to resolve these issues.

It retains the attempt to load the config file and parse the tsConfigPath setting from it, with a cache-busting mechanism to prevent Node from caching failed imports. Documentation has been updated to explain the limitations of this configuration method.

Fixes #14801

* ✅ Resolve vitest "Please remember to await the assertion" warnings

An example of the warning in the test logs:
```
Promise returned by `expect(actual).rejects.toThrowError(expected)` was not awaited. Vitest currently auto-awaits hanging assertions at the end of the test, but this will cause the test to fail in Vitest 3. Please remember to await the assertion.
    at /home/steve/dev/webdriverio/packages/wdio-shared-store-service/tests/client.test.ts:38:43
```

* ✅ Update mock path to match changes in webdriverio/guinea-pig#9

* ✅ Attempt to avert flaky tests by increasing the timeout.

* ✅ limit the concurrent instances to one less than the number of CPUs

* ✅ use `beforeEach` rather than `before` to give the tests a known starting state

* ✅ disable infobars in the browser so that the viewport size is more predictable.

* ✅ await async onComplete in isRunning test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Expensable $50 💸 PR: Polish 💅 PRs that contain improvements on existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.