Skip to content

fix(playwright): classify attachment disposition by type - #125

Open
Pranav-Bobde wants to merge 1 commit into
keploy:mainfrom
Pranav-Bobde:fix/playwright-inline-disposition
Open

Pranav-Bobde wants to merge 1 commit into
keploy:mainfrom
Pranav-Bobde:fix/playwright-inline-disposition

Conversation

@Pranav-Bobde

Copy link
Copy Markdown

Problem

@keploy/playwright waits for page requests to finish before ending a test. It treated any Content-Disposition value containing attachment as a download. Chromium renders inline; filename="attachment-page.html" as a page. When that navigation cancels an older request, settle kept waiting and timed out the test.

The new test runs Chromium against a local page server and fake Keploy agent. Before the fix, Chromium cancelled /slow, but the test timed out in context teardown while the settle step still listed GET /slow.

Change

Read the header's disposition type, its first token. inline counts as a page navigation. Any other valid type counts as a download, because browsers treat unknown types such as x-attachment as attachment (RFC 6266, section 4.2). Inline headers with filenames containing "attachment" now count as page navigations. Existing download, 204 and 205 cases stay covered, and a new row covers an x-attachment download.

Checked

  • Before the fix, the focused regression failed: the test status was timedOut, the page server logged slow cut, and settle still reported a wait for /slow.
  • After the fix, the focused regression passed 1/1.
  • The new x-attachment download row passes both on main and with this change, so unknown disposition types still count as downloads.
  • Before and after: root npm run build passed; root node --test --test-reporter=spec test/*.test.mjs passed 51/51; Jest npm test passed 41/41.
  • Playwright npm test passed 47/47 before and 49/49 after in headless Chromium.
  • Not tested: live Keploy record/replay, including jest/e2e/lane.sh; Firefox; WebKit. The root, Jest and Playwright package scripts define no lint command.

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

Successfully merging this pull request may close these issues.

1 participant