Request is already handled!
Stencil version:
@stencil/[email protected]
I'm submitting a: [x] bug report [ ] feature request [ ] support request
Current behavior: As already stated in #1567 there is a problem when using the request interceptor capability on E2EPages before .setContent()
We need the request interceptor before the web-components lifecycle sets in.
Result:
Error: Request is already handled!
at assert (C:...\node_modules\puppeteer-core\lib\helper.js:270:11)
at Request.continue (C:...\node_modules\puppeteer-core\lib\NetworkManager.js:433:5)
at Request.
Expected behavior: Stencil should not interfere with any request interceptors set by our tests.
Steps to reproduce:
await page.setRequestInterception(true);
page.on('request', (request) =>{
request.continue();
});
await page.setContent('<my-component></my-component>'
);
await page.waitForChanges();
Other information: Prior Issue report: https://github.com/ionic-team/stencil/issues/1567 Prior fix attempt: https://github.com/ionic-team/stencil/pull/1568/files
We encourage you use the html option, of newSpecPage, try to avoid using page.on('request'). However, we recently merged some fixes around that, so maybe it helped!
@manucorporat could you elaborate on how html of newSpecPage helps in an E2E scenario?
I tried page.on('request', ...) with 1.13.0-4 and still run into the Request is already handled! issue. 😕
@manucorporat Tested 1.13.0-4 and the issue still persists.
As our application provides vital social security services to about 3 million customers we want to achieve a higher standard of testing.
Of cource we are using SpecPage to test as many things as possible, but that does not replace E2EPage tests.
Unfortunately we have to use mocks in our E2EPage tests and the only way that we could think of (without touching the application) is to forward requests by using the requestInterceptor mechanism.
Appreciate your help.
Best regards, PhorkysXT
Hi @manucorporat, I have same question as @luchsamapparat any particular explanation how html option of newSpecPage would help? Is this documented somewhere?
I'm also curious what kind of fixes were merged to fix page.on('request').
Kind regards
We encourage you use the html option, of newSpecPage, try to avoid using
page.on('request'). However, we recently merged some fixes around that, so maybe it helped!
How exactly does that answer close this issue?