filiphric / cypress-plugin-api

Cypress plugin to show your API information in the Cypress UI runner
ISC License
257 stars 34 forks source link

bug v2.5.0 - Timeout find element #72

Closed lucasdonato closed 1 year ago

lucasdonato commented 1 year ago

Hi Filip! I'm using cypress-plugin-api in version 2.5.0, in my e2 tests and when I make a call to the API it's returning the error below

image

example code image

filiphric commented 1 year ago

Hey @lucasdonato I was trying to replicate this with the exact same properties, but was not able to. can you provide me with some more info? is there anything specific in your cypress.config.json? what are the imports in your support file? could there be something that causes a conflict? when you run your test, do you see the UI, or do you still see the google site? THanks in advance!

lucasdonato commented 1 year ago

I created a repository for you to simulate the bug! 😃 Happens when I make any API call in my global beforeEach (e2e.js file)

https://github.com/lucasdonato/test-cypress-plugin-api

filiphric commented 1 year ago

thank you for the repro, that helped quite a lot. since you are trying to combine UI and API test, I would recommend enabling snapshotOnly mode which is built exactly for this kind of use case. however, in the case you showed me it might make sense to show UI even without having the snapshotOnly mode 🤔

lucasdonato commented 1 year ago

with snapshotOnly:true it worked perfectly. Thank you for your support.