Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wdio-utils: Filter out internal stacktraces #8130

Merged
merged 2 commits into from Mar 23, 2022

Conversation

WillBrock
Copy link
Member

Proposed changes

Filters out internal stacktraces. This is the same concept we had for sync in #3750 but is needed for async now.

Before

[chrome 99.0.4844.74 linux #0-0] 1) My Login application should login with valid credentials
[chrome 99.0.4844.74 linux #0-0] Can't call setValue on element with selector ".adfsadfs" because element wasn't found
[chrome 99.0.4844.74 linux #0-0] Error: Can't call setValue on element with selector ".adfsadfs" because element wasn't found
[chrome 99.0.4844.74 linux #0-0]     at implicitWait (/home/will/dev/wdio-st/node_modules/webdriverio/build/utils/implicitWait.js:34:19)
[chrome 99.0.4844.74 linux #0-0]     at async Element.elementErrorHandlerCallbackFn (/home/will/dev/wdio-st/node_modules/webdriverio/build/middlewares.js:20:29)
[chrome 99.0.4844.74 linux #0-0]     at async Element.wrapCommandFn (/home/will/dev/wdio-st/node_modules/@wdio/utils/build/shim.js:137:29)
[chrome 99.0.4844.74 linux #0-0]     at async Context.<anonymous> (/home/will/dev/wdio-st/test/specs/example.e2e.ts:8:9)

After

[chrome 99.0.4844.74 linux #0-0] 1) My Login application should login with valid credentials
[chrome 99.0.4844.74 linux #0-0] Can't call setValue on element with selector ".adfsadfs" because element wasn't found
[chrome 99.0.4844.74 linux #0-0] Error: Can't call setValue on element with selector ".adfsadfs" because element wasn't found
[chrome 99.0.4844.74 linux #0-0]     at async Context.<anonymous> (/home/will/dev/wdio-st/test/specs/example.e2e.ts:8:9)

Types of changes

  • 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

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 necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Reviewers: @webdriverio/project-committers

@christian-bromann
Copy link
Member

Can we ensure that we modify stack traces only for WebdriverIO related commands. I want to avoid modifying them in case an arbitrary node module fails and we will be unable to debug due to this. And it seems to me that applying it to the framework wrapper would modify the stack trace for all errors thrown in a test case.

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.

👍 thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Polish 💅 PRs that contain improvements on existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants