From d3e557ec768c792630186e1a288f1f6aee9c36b8 Mon Sep 17 00:00:00 2001 From: Cesar Varela Date: Tue, 11 Jul 2023 17:14:23 -0300 Subject: [PATCH] Fix cset test (#2150) * Reduce test flakiness * Update test --- .../cypress/e2e/integration/cite.cy.js | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/site/gatsby-site/cypress/e2e/integration/cite.cy.js b/site/gatsby-site/cypress/e2e/integration/cite.cy.js index 3692d1c71a..7c48dd819d 100644 --- a/site/gatsby-site/cypress/e2e/integration/cite.cy.js +++ b/site/gatsby-site/cypress/e2e/integration/cite.cy.js @@ -177,25 +177,21 @@ describe('Cite pages', () => { cy.waitForStableDOM(); - cy.get('[data-cy="CSETv1"] [data-cy="AI System"]') - .last() - .find('input[type="radio"]') - .eq(0) - .should('be.checked'); + cy.waitForStableDOM(); + + cy.get('[data-cy="CSETv1"] [data-cy="AI System"] [value="yes"]').first().check(); + + cy.waitForStableDOM(); + + cy.get('[data-cy="CSETv1"] [data-cy="AI System"] [value="yes"]').last().should('be.checked'); // Clicking unchecks the input for both fields - cy.get('[data-cy="CSETv1"] [data-cy="AI System"]') - .last() - .find('input[type="radio"]') - .eq(0) - .click(); + cy.get('[data-cy="CSETv1"] [data-cy="AI System"] [value="yes"]').last().click(); cy.waitForStableDOM(); - cy.get('[data-cy="CSETv1"] [data-cy="AI System"]') + cy.get('[data-cy="CSETv1"] [data-cy="AI System"] [value="yes"]') .first() - .find('input[type="radio"]') - .eq(0) .should('not.be.checked'); });