Rayrun
← Back to Discord Forum

Playwright annotations doesn't display data on reports.

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?"

6 replies

Is there another way to show the description of why the test was skipped or set with the annotation fixme()? The only things that I see in my reports are the words fixme and skip.

I'm facing this issue with Allure and the native report of Playwright.

move .fixme() after annotations, either in beforeEach or test

It worked for the native report of Playwright (thanks!), but for the Allure report it doesn't show any info 😢

That might be an issue with allure report

Nevermind, it worked, but was a curious setup (I moved the lines of code before the Playwright annotations and added another parameter to my test). Thanks! 😄

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

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].