Skip to content

[Feature]: Use browser in OneTimeSetUp and OneTimeTearDown #3216

@pnatashap

Description

@pnatashap

🚀 Feature Request

Very often we need to make some actions during OneTimeSetUp and make some cleaning in OneTimeTearDown and we need to open the same browser that we have.
Now it is possible via work-around for OneTimeTearDown, but absently not possible for OneTimeSetUp.

Example

[TestFixture]
public class MyTests : PlaywrightTest
{
    [OneTimeSetUp]
    public async Task OneTimeSetUp()
    {
        // Access to fixture-level browser instances
        var page = await FixtureBrowser.NewPageAsync();
        
        // Perform global setup
        
    }
}

Motivation

Now we need to duplicate the logic to run browser to some place to be able to run playwright in OneTimeSetUp, which can cause a lot of issues or just do not use adaptor at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions