Closed Roy412 closed 1 year ago
Hi @Roy412,
Thanks for your report. I reproduced this behavior. We will inform you as soon as we have news on this issue.
Hi @Roy412
As a workaround, you can use the --experimental-proxyless
option to run the tests.
Option syntax:
// Command-line
testcafe chrome tests --experimental-proxyless
// Programmatic
const testcafe = await createTestCafe({ experimentalProxyless: true });
// Configuration file
{
"experimentalProxyless": "true"
}
I've run the tests with the testcafe@2.2.0-rc.1
version and the --experimental-proxyless
option enabled, and the initial issue is not reproduced.
There is some test error, but it looks like you need to fix the test.
Hi @miherlosev
Thanks for the reply. Enabling experimentalProxyless
at testcafe@2.2.0-rc.1
resolved the proxy issue. However, as you can see, it brings another problem of testing library compatibility.
Cannot call method `queryByRole` of undefined
Obviously, @testing-library/testcafe
doesn't work with experimentalProxyless
option. I tested with the latest version of testing-library already and this compatibility is very important for us as we use it everywhere in our project. Can you please help me with this issue and should I raise a new issue about this?
https://github.com/DevExpress/testcafe/issues/7429
Enabling experimentalProxyless at testcafe@2.2.0-rc.1 resolved the proxy issue.
I'm happy to hear this.
Obviously, @testing-library/testcafe doesn't work with experimentalProxyless option. I tested with the latest version of testing-library already and this compatibility is very important for us as we use it everywhere in our project. Can you please help me with this issue and should I raise a new issue about this?
Please simplify the example and create a new issue with it.
Please simplify the example and create a new issue with it.
@miherlosev Just raised a new issue with the simple demo project. https://github.com/DevExpress/testcafe/issues/7439
Thank you very much.
@miherlosev Can you please let me know how I can modify the proxy URL of a certain public resource(app/public/mockServiceWorker.js
) to be hosted at the URL without hash?
Current serviceWorker is hosted at https://localhost:1337/fKieyJftH*vfYuf6GWj!c!utf-8/http://localhost:3000/mockServiceWorker.js
I'd like to host it at https://localhost:1337/mockServiceWorker.js
or https://localhost:1337/fKieyJftH*vfYuf6GWj/http://localhost:3000/mockServiceWorker.js
I'd appreciate if you locate the related hammerhead code so that I can modify it on my end. Or how can I get that KieyJftH*vfYuf6GWj!c!utf-8
value?
@Roy412 The proxied url is not supposed to be modified. However, if you want to research the issue, you can start from the following code lines:
@AlexKamaev Thanks, it worked.
Hi @Roy412,
This issue is not reproduced with combination of testcafe@3.0.1
and the Google Chrome browser. Feel free to reopen this issue if you encounter it in other browsers.
Hello I encountered the same error, which is reproduced on version 2.4.0 with experimentalProxyless turned off. If you turn it on, the page opens correctly. On version 3.1.0 - the error is reproduced both with experimentalProxyless disabled and enabled. Could you reopened the bug?
Hi @ilya2010ujl,
There is no experimentalProxyless
option in the 3.1.0 version. Now it is called the Native Automation mode and it is enabled by default. If you still encounter an issue in Native Automation mode in Chromium-based browsers, please create a separate ticket using the following link: https://github.com/DevExpress/testcafe/issues/new?assignees=&labels=TYPE%3A+bug&projects=&template=bug_report.yaml.
What is your Scenario?
I'm working on the testcafe based on NextJS framework and integrated msw library for mocking requests. Testcafe hammeread doesn't forward the some mock requests to the msw service worker and the requests fail with
404 Not Found
. I debugged some hammerhead library codes and I guess this is related to the scope problem of hammerhead but not sure how I can fix this.What is the Current behavior?
Interestingly, the mocking requests at testcafe tests work fine at the level 1 route pages(like '/', '/account', '/login', ...) and not working at deeper level sub-paths (e.g '/account/login', '/account/login/test', ...).
What is the Expected behavior?
The mocking request at testcafe should work at every sub paths. :)
What is your public website URL? (or attach your complete example)
To reproduce
yarn
yarn testcafe
What is your TestCafe test code?
https://github.com/Roy412/msw-testcafe-error/blob/main/testcafe/rest.spec.ts
Your complete configuration file
No response
Your complete test report
Screenshots
No response
Steps to Reproduce
To reproduce
yarn
yarn testcafe
TestCafe version
2.1.0
Node.js version
v16.16.0
Command-line arguments
NEXT_PUBLIC_IS_TESTCAFE=1 node runtestCafe.js
Browser name(s) and version(s)
No response
Platform(s) and version(s)
No response
Other
/account/login/test
--->/account
, the test passes.https://github.com/DevExpress/testcafe-hammerhead/blob/53f57614e829fc8f1f870b9904c3f5bdce76bfa6/src/client/worker/fetch-event.ts#L19
This check fails.
parsedUrl.partAfterHost.startsWith(swFetchCheckSettings.scope)
In my case,
Not sure which one of
parsedUrl.partAfterHost
orswFetchCheckSettings.scope
value is wrong.