I am attempting creating an email service where cy request will fetch and return body of an email, but logically there could be a case where email did not arrived right away so i assume the correct way is to fetch every 3 seconds and if there is no email try to fetch again so basically retrying same operation over and over for lets say 2 minutes every 3 seconds. Is there something that cypress already have in the api ?
it('Should be able to reset password', () => {
let emailContent: string = '';
cy.request(
'GET',
`https://api.testmail.app/api/json?apikey=${TestMailService.APIKEY}&namespace=${TestMailService.NAMESPACE}&tag=test&livequery=true`,
).then((response) => {
emailContent = response.body.emails[0].text;
});
})
H