Skip to content

Commit e4f0924

Browse files
committed
fix failed tests content
1 parent 253332e commit e4f0924

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

.github/workflows/playwright.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,7 @@ jobs:
3737
- name: Get failed tests
3838
id: get-failed-tests
3939
if: ${{ !cancelled() }}
40-
run: |
41-
CONTENT=$(cat ./playwright-errors/errors.md)
42-
{
43-
echo 'content<<EOF'
44-
echo $CONTENT
45-
echo EOF
46-
} >> $GITHUB_OUTPUT
40+
run: echo "content='$(printf "%s\n" "$(cat ./playwright-errors/errors.md)")'" >> $GITHUB_OUTPUT
4741
- uses: actions/upload-artifact@v4
4842
if: ${{ !cancelled() }}
4943
id: artifact-upload-step

e2e/config/reporter.ts

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

23+
escapeQuotes( input: string ) {
24+
return input.replace( /([\'\"])/g, '\\$1' )
25+
}
26+
2327
cleanupFolder() {
2428
const folderPath = path.resolve( this.outputFolder )
2529

@@ -82,6 +86,8 @@ class MyReporter implements Reporter {
8286
reportContent += `## Failed Tests
8387
8488
${ this.testResults.join( '' ) }`
89+
90+
reportContent = this.escapeQuotes( reportContent )
8591
}
8692

8793
fs.writeFileSync( reportPath, reportContent )

0 commit comments

Comments
 (0)