You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my case, the playwright UI is running inside a docker running VSCode's codeserver instance. When the UI mode is started (on port 9501), it is proxied on a path that looks like this: https://mydomain/proxy/9501/trace/uiMode.html
Hence all api requests made by playwright UI must include the prefix /proxy/9501, especially for the /trace endpoint. This is already the case for most requests made by UI mode, but not for trace requests happening during the execution of a test (the ones asking for a .json file that is generated by the trace server), where an absolute path is used instead, which prevents the UI from displaying ongoing progress in the test.
/trace/contexts?trace=... use relative paths correctly --> https://mydomain/proxy/9501/trace/contexts?trace=...
/trace/file?path=my_trace.zip use relative paths correctly. --> https://mydomain/proxy/9501/trace/file?path=my_trace.zip
/trace/file?path=my_trace.json use an absolute path which makes them fail. --> https://mydomain/trace/file?path=my_trace.json (no /proxy/9501)
The issue only happens for network calls asking for a JSON trace (zip trace and contexts work)
altough I'm not familiar enough with the code to be 100% sure.
In the sw.bundle.js file that is shipped with the playwright package, this is the line that causes the issue (there are 2 such lines): fetch("/trace/file?path="+encodeURIComponent(t))
Replacing it by
fetch("./file?path="+encodeURIComponent(t))
In my case solves it, but I'm aware it's a fix inside a bundled file, which is not ideal.
Expected behavior
Running a test in a playwright UI running behind a proxy should display test progress during the test.
Actual behavior
Running a test in a playwright UI running behind a proxy does not display test progress during the test, but only reports on the status when the test ends. A bunch of network errors are seen in the network debug tab of chrome.
I verified it also exists on release-1.48, so this isn't a regression. The fix will ship as part of 1.50, and i'll try writing a test to ensure this doesn't break again.
Version
1.49.0
Steps to reproduce
Following on this issue: #29564
Using the playwright UI to run any test.
In my case, the playwright UI is running inside a docker running VSCode's codeserver instance. When the UI mode is started (on port 9501), it is proxied on a path that looks like this: https://mydomain/proxy/9501/trace/uiMode.html
Hence all api requests made by playwright UI must include the prefix /proxy/9501, especially for the /trace endpoint. This is already the case for most requests made by UI mode, but not for trace requests happening during the execution of a test (the ones asking for a .json file that is generated by the trace server), where an absolute path is used instead, which prevents the UI from displaying ongoing progress in the test.
/trace/contexts?trace=...
use relative paths correctly -->https://mydomain/proxy/9501/trace/contexts?trace=...
/trace/file?path=my_trace.zip
use relative paths correctly. -->https://mydomain/proxy/9501/trace/file?path=my_trace.zip
/trace/file?path=my_trace.json
use an absolute path which makes them fail. -->https://mydomain/trace/file?path=my_trace.json
(no/proxy/9501
)The issue only happens for network calls asking for a JSON trace (zip trace and contexts work)
I think the issue may come from here:
playwright/packages/trace-viewer/src/sw/traceModelBackends.ts
Line 152 in fc19e6e
altough I'm not familiar enough with the code to be 100% sure.
In the sw.bundle.js file that is shipped with the playwright package, this is the line that causes the issue (there are 2 such lines):
fetch("/trace/file?path="+encodeURIComponent(t))
Replacing it by
fetch("./file?path="+encodeURIComponent(t))
In my case solves it, but I'm aware it's a fix inside a bundled file, which is not ideal.
Expected behavior
Running a test in a playwright UI running behind a proxy should display test progress during the test.
Actual behavior
Running a test in a playwright UI running behind a proxy does not display test progress during the test, but only reports on the status when the test ends. A bunch of network errors are seen in the network debug tab of chrome.
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: