Skip to content

[BUG]Screen and snapshot of beforeAll missed when trace mode is set to "retain-on-failure" #28527

Closed

Description

@Myron-Huang

System info

  • Playwright Version: [v1.40.1]
  • Operating System: [macOS 13.5]
  • Browser: [Chromium]
  • Other info:

Source code

Here is the test code:

import {Browser, BrowserContext, chromium, expect, Page, test} from '@playwright/test'

test.describe('test', () => {
    let browser: Browser
    let context: BrowserContext
    let page: Page

    test.beforeAll(async () => {
        browser = await chromium.launch()
        context = await browser.newContext()
        page = await context.newPage()
        await page.goto("https://www.google.com/")
        await page.getByRole('button', { name: 'Google Search' }).waitFor()

    })

    test.afterAll(async () => {
        await page.goto("https://www.bing.com/")
    })


    test('TESTXX', async () => {
        await page.goto("https://playwright.dev/docs/intro")
        expect(0).toEqual(1)
    })
})

Steps

  • Set trace mode to "retain-on-failure"
  • Run "TESTXX" and wait it failed
  • Show trace and check html-report

Expected
I can see all snapshots and screenshots in my "beforeAll", "test", "afterAll"

Actual

I can only see snapshots and screenshots in "test" and "afterAll", those in "beforeAll" is empty like this:
image

Other
If I set trace mode to "on", all works ok, so I think this is a bug of "retain-on-failure"

Activity

  1. changed the title [-][BUG]Screen and snapshot of beforeAll missed when trace mode is set to "on"[/-] [+][BUG]Screen and snapshot of beforeAll missed when trace mode is set to "retain-on-failure"[/+] on Dec 7, 2023
  2. vilgeforc5 commented on Feb 21, 2024

    @vilgeforc5

    Is there any solution?

  3. petarku commented on Apr 19, 2024

    @petarku

    is there any update on this issue or workaround. we are facing the same on our project and it is quite annoying that you cannot see screen and snapshot on setup of the tests and all tests are broken afterwards. we have limited space on jenkins machine so we dont want to set to always on

  4. pavelfeldman commented on Aug 16, 2024

    @pavelfeldman
    Member

    Why was this issue closed?

    Thank you for your contribution to our project. This issue has been closed due to its limited upvotes and recent activity, and insufficient feedback for us to effectively act upon. Our priority is to focus on bugs that reflect higher user engagement and have actionable feedback, to ensure our bug database stays manageable.

    Should you feel this closure was in error, please create a new issue and reference this one. We're open to revisiting it given increased support or additional clarity. Your understanding and cooperation are greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions