Hi, I'm facing the same issue. I have some tests that are skipped (for many reasons). I added the test.fixme()
in my beforeEach()
hook, and test.info().annotations.push({})
annotation in the test that's skipped, with a message about why it was skipped, but the reporters I have doesn't show in the reports the descriptions.
Sample 1.-
test.beforeEach(async ({ page }) => {
test.fixme();
// rest of the code
});
test.describe('My amazing suite, () => {
test('My amazing test to fix', async ({ page }) => {
test.info().annotations.push({
type: 'My amazing issue',
description: 'My amazing description'
});
// rest of my test
});
// other tests
});
Then I moved the test.fixme()
to the skipped test, before the test.info().annotations.push({})
annotation, and it continued with no showing in the reports the description of why the test was skipped.
Sample 2.-
test.beforeEach(async ({ page }) => {
// rest of the code
});
test.describe('My amazing suite, () => {
test('My amazing test to fix', async ({ page }) => {
test.fixme();
test.info().annotations.push({
type: 'My amazing issue',
description: 'My amazing description'
});
// rest of my test
});
// other tests
});
Finally I put the fixme()
annotation as a flag in my test (like this test.fixme('My test, async ({ page }) => { // body of my test });
and it happened the same behaviour I mentioned.
Sample 3.-
test.beforeEach(async ({ page }) => {
// rest of the code
});
test.describe('My amazing suite, () => {
test.fixme('My amazing test to fix', async ({ page }) => {
test.info().annotations.push({
type: 'My amazing issue',
description: 'My amazing description'
});
// rest of my test
});
// other tests
});
(continue in thread)
This thread is trying to answer question "Is there another way to show the description of why the test was skipped or set with the annotation `fixme()` in Playwright?"
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].