Skip to content

fix: Global wait not working with toBeDisplayed#2023

Open
dprevost-LMI wants to merge 7 commits intowebdriverio:mainfrom
dprevost-LMI:fix-global-wait-not-working-in-toBeDisplayed
Open

fix: Global wait not working with toBeDisplayed#2023
dprevost-LMI wants to merge 7 commits intowebdriverio:mainfrom
dprevost-LMI:fix-global-wait-not-working-in-toBeDisplayed

Conversation

@dprevost-LMI
Copy link
Contributor

@dprevost-LMI dprevost-LMI commented Feb 14, 2026

Fixes #2020

The index.ts#setDefaultOptions method sets a global configuration in a way that is not obvious when making code changes to matchers, which leads to the issue mentioned above.

This PR fixes the regression, adds unit and integration tests, and adds a prevention mechanism to better account for the global configuration.

  • Modify the setDefaultOptions to allow multiple different global DEFAULT_OPTION constants to be modified and ease their usage as default value in the matchar's function signature
  • Add a lint rule to catch any new DEFAULT_OPTIONS constant not in the proper list to get altered by setDefaultOptions
  • Add better test coverage to ensure the global configuration is taken into consideration in toBeMatchers
  • Deprecated setOptions in favour of setDefaultOptions

Waiting for the merge of: #2010

@christian-bromann
Copy link
Member

Merged #2010 .. I hope this didn't cause this massive conflict 🙈

@dprevost-LMI
Copy link
Contributor Author

It's normal. I based myself on it to use the playground. I'll rebase and drop the conflicting commits!

@dprevost-LMI dprevost-LMI force-pushed the fix-global-wait-not-working-in-toBeDisplayed branch from cd3780b to 8c27a61 Compare March 8, 2026 13:40
@dprevost-LMI dprevost-LMI force-pushed the fix-global-wait-not-working-in-toBeDisplayed branch from 8004226 to 07cf00f Compare March 8, 2026 14:12
@dprevost-LMI dprevost-LMI marked this pull request as ready for review March 8, 2026 14:16
@dprevost-LMI
Copy link
Contributor Author

@christian-bromann ready! Do you mind triggering a release with this one so we can fix all known issues and use it in the webdriverio project?
FYI: I would not mind doing it myself, but I do not have access!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

toBeDisplayed() not respecting Webdriverio's waitForTimeout or waitForInterval

2 participants