Untitled
function checkInbox(mailinator,inbox,retries=0){ if(retries != 5){ mailinator.getInbox(inbox).then((inboxResponse) => { if(inboxResponse.body.msgs.length == 0){ cy.wait(2000) checkInbox(mailinator,inbox,retries+=1); } else { return Promise.resolve() } }) } else { return Promise.reject(new Error('fail')) } }
Leave a Comment