From 2a9fbd71474dd4e2bd13111eaca8d5c1ee9edf83 Mon Sep 17 00:00:00 2001 From: 21120447 Date: Mon, 5 Aug 2024 11:36:07 +0700 Subject: [PATCH] feat: add testcase: 02 --- .github/workflows/cypress-test.yml | 2 +- cypress/e2e/advanced/actions.cy.ts | 90 ++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cypress-test.yml b/.github/workflows/cypress-test.yml index f191a01..f8ab916 100644 --- a/.github/workflows/cypress-test.yml +++ b/.github/workflows/cypress-test.yml @@ -51,7 +51,7 @@ jobs: fail-fast: false matrix: # run copies of the current job in parallel - containers: [1, 2, 3, 4, 5] + containers: [1, 2, 3] steps: - name: Checkout uses: actions/checkout@v4 diff --git a/cypress/e2e/advanced/actions.cy.ts b/cypress/e2e/advanced/actions.cy.ts index f4f0f11..23a759c 100644 --- a/cypress/e2e/advanced/actions.cy.ts +++ b/cypress/e2e/advanced/actions.cy.ts @@ -123,6 +123,96 @@ describe('Actions', () => { }) it('.uncheck() - uncheck a checkbox element', () => { + cy.get('.action-check [type="checkbox"]').not('[disabled]').uncheck(); + cy.get('.action-check [type="checkbox"]').not('[disabled]').should('not.be.checked') + + // .uncheck() accepts a value argument + cy.get('.action-check [type="checkbox"]').check('checkbox1'); + cy.get('.action-check [type="checkbox"]').uncheck('checkbox1'); + + // .uncheck() accepts an array of values + cy.get('.action-check [type="checkbox"]') + .check(['checkbox1', 'checkbox3']) + cy.get('.action-check [type="checkbox"]') + .uncheck(['checkbox1', 'checkbox3']) + + // Ignore error checking prior to unchecking + cy.get('.action-check [disabled]').uncheck({ force: true }) + cy.get('.action-check [disabled]').should('not.be.checked') + }) + + it('.select() - select an option in a