Cypress: refactor for Redact and NoRedact tests (#656)

This commit is contained in:
Adam Kol
2022-01-17 10:43:39 +02:00
committed by GitHub
parent 5ca3107422
commit 6b4bcc8abd
10 changed files with 35 additions and 30 deletions

View File

@@ -0,0 +1,9 @@
export function isValueExistsInElement(shouldInclude, content, domPathToContainer){
it(`should ${shouldInclude ? '' : 'not'} include '${content}'`, function () {
cy.get(domPathToContainer).then(htmlText => {
const allTextString = htmlText.text();
if (allTextString.includes(content) !== shouldInclude)
throw new Error(`One of the containers part contains ${content}`)
});
});
}