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

Sanitize script command logs #8165

Merged
merged 1 commit into from Mar 29, 2022
Merged

Conversation

christian-bromann
Copy link
Member

Proposed changes

Currently commands like isDisplayed or isClickable create massive amounts of log lines due to the script that is being executed. I added another if clause in the transformCommandLogResult function to sanitize this. Now it only outputs the following:

[0-0] 2022-03-29T10:42:54.337Z INFO webdriver: COMMAND executeScript(<fn>, <object>)
[0-0] 2022-03-29T10:42:54.338Z INFO webdriver: [POST] http://localhost:4444/session/fa980f6d37ebaa9d167686f5571c17ee/execute/sync
[0-0] 2022-03-29T10:42:54.338Z INFO webdriver: DATA {
[0-0]   script: 'isElementDisplayed(...) [7962 bytes]',
[0-0]   args: [
[0-0]     {
[0-0]       'element-6066-11e4-a52e-4f735466cecf': '5767af2b-37bb-4103-b5eb-6b4e0c058da8',
[0-0]       ELEMENT: '5767af2b-37bb-4103-b5eb-6b4e0c058da8'
[0-0]     }
[0-0]   ]
[0-0] }
[0-0] 2022-03-29T10:42:54.341Z INFO webdriver: RESULT true
[0-0] 2022-03-29T10:42:54.341Z INFO webdriver: COMMAND executeScript(<fn>, <object>)
[0-0] 2022-03-29T10:42:54.341Z INFO webdriver: [POST] http://localhost:4444/session/fa980f6d37ebaa9d167686f5571c17ee/execute/sync
[0-0] 2022-03-29T10:42:54.341Z INFO webdriver: DATA {
[0-0]   script: 'isElementClickable(...) [5349 bytes]',
[0-0]   args: [
[0-0]     {
[0-0]       'element-6066-11e4-a52e-4f735466cecf': '5767af2b-37bb-4103-b5eb-6b4e0c058da8',
[0-0]       ELEMENT: '5767af2b-37bb-4103-b5eb-6b4e0c058da8'
[0-0]     }
[0-0]   ]
[0-0] }
[0-0] 2022-03-29T10:42:54.345Z INFO webdriver: RESULT true

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)

Further comments

n/a

Reviewers: @webdriverio/project-committers

@christian-bromann christian-bromann added the PR: Polish 💅 PRs that contain improvements on existing features label Mar 29, 2022
@christian-bromann christian-bromann requested a review from a team March 29, 2022 10:46
@christian-bromann christian-bromann merged commit 3841213 into main Mar 29, 2022
@vijaychowthri
Copy link

thank you @christian-bromann

@christian-bromann christian-bromann deleted the cb-sanitize-script-command-logs branch September 26, 2022 16:03
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