-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(playwright-html-report): Added snippet parameter to playwright config #36464
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
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good, thanks for the PR! I left a pointer about the test.
tests/library/snippet.spec.ts
Outdated
// 3. Open the HTML report and confirm that the code snippet is NOT present for the failure. | ||
// 4. Change snippets: true and confirm the snippet IS present. | ||
|
||
test('should fail and allow visual check of HTML report snippet', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a look at reporter-html.spec.ts
and add a test into that file.
tests/library/playwright.config.ts
Outdated
@@ -48,7 +48,7 @@ const reporters = () => { | |||
['json', { outputFile: path.join(outputDir, 'report.json') }], | |||
['blob', { fileName: `${process.env.PWTEST_BOT_NAME}.zip` }], | |||
] : [ | |||
['html', { open: 'on-failure', title: 'Playwright Library Tests' }] | |||
['html', { open: 'on-failure', title: 'Playwright Library Tests', snippets: true }] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's revert this
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Just want to let you know that during development, I noticed that single test runs (npm run ctest -- specific-test.spec.ts) don't always pass reporter options through properly, but when running full test, everything seems to run correctly. So it looks like this doesn't affect the feature's functionality in real usage. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Let's see what CI is saying.
Signed-off-by: Simon Knott <info@simonknott.de>
This comment has been minimized.
This comment has been minimized.
@agamjots05 Do you plan to follow up with reverting package.json and package-lock.json changes? |
done 👍 |
This comment has been minimized.
This comment has been minimized.
Test results for "tests 1"1 failed 10 flaky47087 passed, 980 skipped Merge workflow run. |
fixes #34052

Before
After (Disabling Snippets through playwright config)

New Playwright Config Change:
HTML - Report Disabling Snippets
