This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function findTag(retries = 0) { | |
return cy.get('mention-tags').then((mention) => { | |
if (!mention.text().includes(tagName) && retries < maxRetries) { | |
cy.log(`Tag name element not found! Retry number: ${retries + 1}`); | |
cy.reload(); | |
findTag(retries + 1); | |
} else if (retries === maxRetries) { | |
throw new Error(`Tag name element not found after ${retries} retries.`); | |
} else { | |
onFeedPage.elements.tagOnMention().should('contain', tagName); |