Describe the bug
When attempting to run tests via Microsoft Playwright Testing, if the PLAYWRIGHT_SERVICE_RUN_ID value contains a #, the tests will fail with a SyntaxError.
SyntaxError: browserType.connect: The URL contains a fragment identifier
Call log:
- <ws connecting> wss:{Playwright Service URL here}
To Reproduce
Steps to reproduce the behavior:
Run playwright tests via MPT with a PLAYWRIGHT_SERVICE_RUN_ID value with a # in it
PLAYWRIGHT_SERVICE_RUN_ID="my-service#id" npx playwright test {testFiles/Patterns} -c {path-to-service-config} --workers={workerAmt}
Conversely, run the same command WITHOUT a PLAYWRIGHT_SERVICE_RUN_ID value containing a #, and you'll see the tests run.
PLAYWRIGHT_SERVICE_RUN_ID="my-service-id" npx playwright test {testFiles/Patterns} -c {path-to-service-config} --workers={workerAmt}
Expected behavior
Tests run in MPT without any issues
Screenshots
N/A
Setup information (please complete the following information):
Browser on which tests are executed (if applicable): chromium
Time range (in PST) when the issue was experienced: 0700
Playwright Version: 1.47.2
Client machine OS: Mac
OS requested on Service: Linux
Additional context
I haven't done extensive testing to see if other reserved characters cause this issue. I encountered it because I was taking the branch name for the PR and using that to form the PLAYWRIGHT_SERVICE_RUN_ID. Some team members include a # in their branch name (annoying but 🤷🏻 ). The team members with branch names like feature/#1234-my-feature would experience this issue. Team members with branch names like feature/4321-my-feature did not experience the issue.
All in all, I'm not totally against restricting things like this if it's a major lift, but it should at least be documented.
Describe the bug When attempting to run tests via Microsoft Playwright Testing, if the
PLAYWRIGHT_SERVICE_RUN_ID
value contains a#
, the tests will fail with a SyntaxError.To Reproduce Steps to reproduce the behavior:
PLAYWRIGHT_SERVICE_RUN_ID
value with a#
in itPLAYWRIGHT_SERVICE_RUN_ID="my-service#id" npx playwright test {testFiles/Patterns} -c {path-to-service-config} --workers={workerAmt}
PLAYWRIGHT_SERVICE_RUN_ID
value containing a#
, and you'll see the tests run.PLAYWRIGHT_SERVICE_RUN_ID="my-service-id" npx playwright test {testFiles/Patterns} -c {path-to-service-config} --workers={workerAmt}
Expected behavior Tests run in MPT without any issues
Screenshots N/A
Setup information (please complete the following information):
Additional context I haven't done extensive testing to see if other reserved characters cause this issue. I encountered it because I was taking the branch name for the PR and using that to form the
PLAYWRIGHT_SERVICE_RUN_ID
. Some team members include a#
in their branch name (annoying but 🤷🏻 ). The team members with branch names likefeature/#1234-my-feature
would experience this issue. Team members with branch names likefeature/4321-my-feature
did not experience the issue.All in all, I'm not totally against restricting things like this if it's a major lift, but it should at least be documented.