Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: reuse browserContext for debugging. #34480

Closed
ykawakamy opened this issue Jan 26, 2025 · 1 comment
Closed

[Feature]: reuse browserContext for debugging. #34480

ykawakamy opened this issue Jan 26, 2025 · 1 comment

Comments

@ykawakamy
Copy link

ykawakamy commented Jan 26, 2025

🚀 Feature Request

I'd like to reuse the browser context during debugging.

Example

I propose test.sandbox annotation.

test("too much navigation", async({page})=>{
  await page.getByRole("button", { name:"page1"}).click();
  await page.getByRole("button", { name:"page2"}).click();
  await page.getByRole("button", { name:"page3"}).click();
  // ... too much navigation and too slow...

  // failed.
  await expect(page.locator("flaky-element")).toHaveText("xxx");
});


// proposal annotation
test.sandbox( "for fix flaky-element assertion", async ({page})=>{
  await expect(page.locator("flaky-element")).toHaveText("fixed");
});

when stabled,

 - await expect(page.locator("flaky-element")).toHaveText("xxx");
 + await expect(page.locator("flaky-element")).toHaveText("fixed");

...

-test.sandbox( "for fix flaky-element assertion", async ({page})=>{
-  await expect(page.locator("flaky-element")).toHaveText("fixed");
-});

test.sandbox use last browser context.

Motivation

Make tests for debugging to easy. (particularly, too slow navigation.)

--
sorry, i'm not good at English.

@mxschmitt
Copy link
Member

This seems to be outside of the scope for Playwright, our core principle is to isolate tests from each-other. If you have to deal with slow navigation, we instead recommend test.step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants