Closed vlcekr closed 1 year ago
The same problem happened to me. In my E2E tests, sometimes the screen gets stuck with the request preview. I can't always reproduce the error. it's random
Sure, I'll make sure to fix this once I identify the issue. A reproducible example would really help here. If you are able to provide this, that would be great 👍
You can reproduce it easily with this test
describe('test', () => {
it('doesnt switch back to app', () => {
cy.visit('https://www.typescriptlang.org/docs/');
cy.api('https://api.publicapis.org/entries');
cy.contains('TS for the New Programmer').click(); // this will fail because there is api screen displayed and it doesn't switch back to website
});
});
@vlcekr are you using snapshotOnly
in your test? I can replicate the issue with the code you sent me, but only when snapshotOnly
is set to false
(which is default)
@lucasdonato does this happen when snapshotOnly
mode is set to true
?
We also have simular issues with both settings to true.
{
requestMode: true,
snapshotOnly: true
}
and also with
{
requestMode: true,
snapshotOnly: false
}
The tests are working when both settings are set to false.
Hey! I’m still unable to replicate this issue. I found some minor errors that I’m going to fix, but as far as the described issue goes, I’m not able to help. I tried this:
describe('test', { env: { snapshotOnly: true} }, () => {
it('doesnt switch back to app', () => {
cy.visit('https://www.typescriptlang.org/docs/');
cy.api('https://api.publicapis.org/entries');
cy.contains('TS for the New Programmer').click();
});
});
when snapshotOnly
mode is set, all works as intended, UI view hides. when it is not set, it’s false
by default, so you are not able to select elements on visited page (as expected).
Closing this for now, feel free to reopen
Hi Filip, we use cypress-plugin-api v2.3.3 + Cypress v 11.0.1 and there is issue of Cypress App preview not switching back to tested application after making api calls.
We have tests for application front-end, it just simulates user behavior but at some point we make api calls to make something happen on the background. After these api calls, test should continue in testing application front-end. Unfortunately, in Cypress App preview, the screen is stuck on API calls view and doesn't go back to tested APP and fails.
Could you please take a look at it? Thanks!