This is based on the cypress xpath command https://github.com/cypress-io/cypress-xpath/blob/master/src/index.js, mentioned as best practice for writing custom commands with retries in https://docs.cypress.io/api/cypress-api/custom-commands#See-also.
It should fix https://github.com/SMenigat/cypress-mailhog/issues/11 and might obsoletes the question in https://github.com/SMenigat/cypress-mailhog/issues/17.
If support for Cypress < 12 will be dropped in a future version, this could be solved with Custom Queries https://docs.cypress.io/api/cypress-api/custom-queries. Also, it might be a good idea to add the limit
parameter to the options object, instead of having multiple parameters.
feat(commands): add retry-ability to query commands
feat(commands): add retry-ability to query commands
feat(commands): add retry-ability to query commands
feat(commands): add retry-ability to query commands
feat(commands): add retry-ability to query commands
feat(commands): add retry-ability to query commands
feat(commands): add retry-ability to query commands
feat(commands): add retry-ability to query commands
feat(commands): add retry-ability to query commands