tests: add tryAssertion command to replace cy.wait

This commit is contained in:
braks
2022-10-13 23:23:43 +02:00
committed by Braks
parent 0613350554
commit 5aa94e2e13
11 changed files with 78 additions and 42 deletions
@@ -33,12 +33,12 @@ describe('Store Action: `addSelectedNodes`', () => {
if (index < randomNumber) {
expect(!!storedNode?.selected).to.eq(true)
cy.wait(1).then(() => {
cy.tryAssertion(() => {
expect(node).to.have.class('selected')
})
} else {
expect(!!storedNode?.selected).to.eq(false)
cy.wait(1).then(() => {
cy.tryAssertion(() => {
expect(node).to.not.have.class('selected')
})
}
@@ -36,12 +36,12 @@ describe('Store Action: `removeSelectedNodes`', () => {
if (index >= randomNumber2 && index < randomNumber) {
expect(!!storedNode?.selected).to.eq(true)
cy.wait(1).then(() => {
cy.tryAssertion(() => {
expect(node).to.have.class('selected')
})
} else {
expect(!!storedNode?.selected).to.eq(false)
cy.wait(1).then(() => {
cy.tryAssertion(() => {
expect(node).to.not.have.class('selected')
})
}