question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] When creating a new Page in beforeAll to share between tests, how to get the correct recording behaviour

See original GitHub issue

Relevant playwright config settings

    video: "retain-on-failure",
    screenshot: "only-on-failure",

These settings however don’t apply to new pages I create:

  let page
  test.beforeAll(async ({ browser }) => {
    page = await browser.newPage()
  })
  test.afterAll(async () => {
    await page.close()
  })

how to get the same behaviour?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
aslushnikovcommented, Jan 28, 2022

do you think is the same case solved here #10980 (comment)

@ltsuda Might or might not be! Hard to say without further clarifications.

0reactions
afarooqscommented, Apr 29, 2022

Would love to see this implemented.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to share data between beforeAll / beforeEach and tests in ...
We use the beforeAll functions to set up general helper variables for each test and sometimes to set up tenant separation, in other...
Read more >
Test Data: To BeforeAll or to BeforeEach | Call Kent Podcast
Starting a new testing project, and I'm wondering if it's a bad practice to set up all the necessary seed data in a...
Read more >
Your first suite - Jasmine Documentation
To help a test suite DRY up any duplicated setup and teardown code, Jasmine provides the global beforeEach, afterEach, beforeAll, and afterAll functions....
Read more >
What You Need to Know About E2E Testing with Playwright
The test.beforeAll hook sets test data shared between test execution like entries, creating content types and establishing a new stack. The test ......
Read more >
JUnit 5 User Guide
Beginning with Java 16, @BeforeAll and @AfterAll methods can be declared as static in a @Nested test class with either test instance lifecycle ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found