-
Notifications
You must be signed in to change notification settings - Fork 7
Add network logging and error visibility to Playwright CAD upload test #12
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
Merged
gtheler
merged 7 commits into
playwright-tests
from
copilot/add-network-logging-debugging
Jan 26, 2026
Merged
Add network logging and error visibility to Playwright CAD upload test #12
gtheler
merged 7 commits into
playwright-tests
from
copilot/add-network-logging-debugging
Jan 26, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: gtheler <9962631+gtheler@users.noreply.github.com>
Co-authored-by: gtheler <9962631+gtheler@users.noreply.github.com>
Co-authored-by: gtheler <9962631+gtheler@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve test debugging with network logging
Add network logging and error visibility to Playwright CAD upload test
Jan 26, 2026
Contributor
|
@copilot Now the test that was passing is also failing. |
Co-authored-by: gtheler <9962631+gtheler@users.noreply.github.com>
Contributor
Author
Contributor
|
@copilot Fair enough. How do I trigger the actions workflow? |
Contributor
Author
GitHub Actions workflows can be triggered in several ways:
For this PR, the workflow should trigger automatically when the latest commit (152316e) is pushed. You can check the status in the Actions tab or on the PR checks. |
gtheler
approved these changes
Jan 26, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
The test was failing with "Protocol error (Network.getResponseBody): Request content was evicted from inspector cache" because the response body was being read twice:
responseevent handler (line 18).text()on the response object (lines 48, 57)Once a response body is consumed with
.text(), it cannot be read again.Solution
Removed the duplicate
.text()calls since the response bodies forimport_cad.phpandprocess.phpare already being logged in the response event handler. The test now:This preserves all the debugging functionality while fixing the test failure.
Original prompt
Problem
The Playwright e2e test
create_case.spec.jsis failing with a timeout waiting for#cad_previewto become visible after uploading a STEP file. The test times out after 30 seconds without any information about what's happening during the CAD processing.See failing test: https://github.com/seamplex/suncae/actions/runs/21357810068/job/61469308416
The test fails at line 16:
But we have no visibility into:
import_cad.phpendpoint is returningprocess.phpendpoint is returningSolution
Improve the test with comprehensive debugging and network logging:
1. Add Network Request/Response Logging
Add event listeners to log all HTTP requests and responses, with special attention to the PHP endpoints involved in CAD processing:
import_cad.php- handles the file uploadprocess.php- processes the CAD and generates preview2. Add Browser Console Logging
Capture console messages from the browser (including JavaScript errors, console.log output, etc.)
3. Add Explicit Waits for Network Responses
Instead of just waiting for the DOM element to appear, wait for the actual network responses and log their content. This will show us exactly what the PHP scripts are returning.
4. Improve Error Reporting
When the test fails:
#cad_errordiv is visible and log its contents5. Add HAR Recording to Playwright Config
If a
playwright.config.jsexists, add HAR (HTTP Archive) recording to capture all network traffic for post-mortem analysis.Implementation Details
Update
tests/e2e/create_case.spec.jswith:Wait for actual network responses instead of just DOM elements:
Add better error handling:
If
playwright.config.jsorplaywright.config.tsexists, add HAR recording:Expected Outcome
After these changes, when the test fails, the GitHub Actions logs will show:
import_cad.phpandprocess.phpThis will allow us to diagnose exactly why the CAD preview is not appearing.
Files to Modify
tests/e2e/create_case.spec.js- main test file (required)playwright.config.jsorplaywright.config.ts- if it exists (optional enhancement)This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.