Skip to content

Fix invalid unicode escape error on Windows#10815

Merged
christian-bromann merged 1 commit intowebdriverio:mainfrom
yishn:patch-1
Jul 28, 2023
Merged

Fix invalid unicode escape error on Windows#10815
christian-bromann merged 1 commit intowebdriverio:mainfrom
yishn:patch-1

Conversation

@yishn
Copy link
Contributor

@yishn yishn commented Jul 28, 2023

Proposed changes

On Windows, file system paths are delimited with \, so by interpolating paths directly between quotation marks could potentially lead to invalid values in good cases or to an "Uncaught SyntaxError: Invalid Unicode escape sequence" in the worst case, causing tests not being able to run.

This can be reproduced when running wdio with the browser runner in a current working directory whose path includes a directory that starts with e.g. ui under Windows.

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

Reviewers: @webdriverio/project-committers

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 28, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: yishn / name: Yichuan Shen (390b25f)

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 👍

Good catch!
Congratulations on your first WebdriverIO contribution 🎉

@christian-bromann christian-bromann merged commit 54cbada into webdriverio:main Jul 28, 2023
@christian-bromann christian-bromann added the PR: Bug Fix 🐛 PRs that contain bug fixes label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Bug Fix 🐛 PRs that contain bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants