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

[Bug]: trace stop_chunk. the network in chunk includes the network data from the previous chunk #30591

Open
bingosam opened this issue Apr 28, 2024 · 1 comment

Comments

@bingosam
Copy link

bingosam commented Apr 28, 2024

Version

1.43.0

Steps to reproduce

with sync_playwright() as playwright:
    browser = playwright.chromium.launch(channel="chrome")
    context = browser.new_context()
    context.tracing.start(name='trace')

    context.tracing.start_chunk(name='trace', title='case1')
    page = context.new_page()
    page.goto('url of case 1')
    context.tracing.stop_chunk(path='case1.zip')

    context.tracing.start_chunk(name='trace', title='case2')
    page = context.new_page()
    page.goto('url of case 2')
    context.tracing.stop_chunk(path='case2.zip')

Expected behavior

The network data in case2.zip should not include the network data from case1.zip

Actual behavior

The network data in case2.zip include the network data from case1.zip.

Additional context

No response

Environment

- Operating System: [Windows 11]
- Browser: [Chrome]
- Python Version: [3.9.16]
@mxschmitt
Copy link
Member

mxschmitt commented Apr 29, 2024

Was able to reproduce it with

import { chromium } from '@playwright/test';

(async () => {
  const browser = await chromium.launch();
  const context = await browser.newContext();
  await context.tracing.start({ name: 'trace', snapshots: true });

  await context.tracing.startChunk();
  let page = await context.newPage();
  await page.goto('https://www.microsoft.com/pt-pt/');
  await context.tracing.stopChunk({ path: 'case1.zip' });

  await context.tracing.startChunk();
  page = await context.newPage();
  await page.goto('https://example.com');
  await context.tracing.stopChunk({ path: 'case2.zip' });

  await browser.close();
})();

Looks like this is working as intended:

// Network file survives across chunks, make a snapshot before returning the resulting entries.

Moving upstream.

@mxschmitt mxschmitt transferred this issue from microsoft/playwright-python Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants