Skip to content

Commit 66d0995

Browse files
committed
escape special characters
1 parent e4f0924 commit 66d0995

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

.github/workflows/playwright.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ jobs:
3434
WP_PASSWORD: password
3535
STACKABLE_SLUG: Stackable/plugin
3636
run: npm run test
37-
- name: Get failed tests
38-
id: get-failed-tests
39-
if: ${{ !cancelled() }}
40-
run: echo "content='$(printf "%s\n" "$(cat ./playwright-errors/errors.md)")'" >> $GITHUB_OUTPUT
4137
- uses: actions/upload-artifact@v4
4238
if: ${{ !cancelled() }}
4339
id: artifact-upload-step
@@ -61,7 +57,7 @@ jobs:
6157
comment-id: ${{ steps.fc.outputs.comment-id }}
6258
issue-number: ${{ github.event.pull_request.number }}
6359
body: |
64-
${{ steps.get-failed-tests.outputs.content }}
60+
$(cat ./playwright-errors/errors.md)
6561
## Playwright Report Artifact
6662
| file | commit |
6763
| ---- | ------ |

e2e/config/reporter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ class MyReporter implements Reporter {
2020
return input.replace( /\[[0-9;]*m/g, '' )
2121
}
2222

23-
escapeQuotes( input: string ) {
24-
return input.replace( /([\'\"])/g, '\\$1' )
23+
escapeSpecialCharacters( input: string ) {
24+
return input.replace( /([\'\"\&\{\}])/g, '\\$1' )
2525
}
2626

2727
cleanupFolder() {
@@ -87,7 +87,7 @@ class MyReporter implements Reporter {
8787
8888
${ this.testResults.join( '' ) }`
8989

90-
reportContent = this.escapeQuotes( reportContent )
90+
reportContent = this.escapeSpecialCharacters( reportContent )
9191
}
9292

9393
fs.writeFileSync( reportPath, reportContent )

0 commit comments

Comments
 (0)