Skip to content

Commit

Permalink
Bug 2106866: Fix flaky OLM test
Browse files Browse the repository at this point in the history
Chaining of cypresss `should` with `click` is not necessary and might be causing flakiness. The test case will fail if the element we are trying to click does not exist, so we do not need to assert that it exists, then click it.
  • Loading branch information
TheRealJon committed Jul 13, 2022
1 parent c136a10 commit 94c9f3b
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@ describe('Using OLM descriptor components', () => {

it('pre-populates Field Group', () => {
cy.get(`#${FIELD_GROUP_ID}_field-group`).should('exist');
cy.get(`#${FIELD_GROUP_ID}_accordion-toggle`)
.should('exist')
.click();
cy.get(`#${FIELD_GROUP_ID}_accordion-toggle`).click();
cy.get(`[for="${FIELD_GROUP_ID}_itemOne"]`).should('have.text', 'itemOne');
cy.get(`#${FIELD_GROUP_ID}_itemOne`).should('have.value', testCR.spec.fieldGroup.itemOne);
cy.get(`[for="${FIELD_GROUP_ID}_itemTwo"]`).should('have.text', 'itemTwo');
Expand All @@ -164,9 +162,7 @@ describe('Using OLM descriptor components', () => {

it('pre-populates Array Field Group', () => {
cy.get(`#${ARRAY_FIELD_GROUP_ID}_field-group`).should('exist');
cy.get(`#${ARRAY_FIELD_GROUP_ID}_accordion-toggle`)
.should('exist')
.click();
cy.get(`#${ARRAY_FIELD_GROUP_ID}_accordion-toggle`).click();
cy.get(`[for="${ARRAY_FIELD_GROUP_ID}_0_itemOne"]`).should('have.text', 'Item One');
cy.get(`#${ARRAY_FIELD_GROUP_ID}_0_itemOne`).should(
'have.value',
Expand All @@ -185,9 +181,7 @@ describe('Using OLM descriptor components', () => {

it('successfully creates operand using form', () => {
cy.byTestID('create-dynamic-form').click();
cy.byTestOperandLink('olm-descriptors-test')
.should('exist')
.click();
cy.byTestOperandLink('olm-descriptors-test').click();
cy.get('.co-operand-details__section--info').should('exist');
});
});

0 comments on commit 94c9f3b

Please sign in to comment.