From 389fa6257d560924157b1ba5e22b3222e2367706 Mon Sep 17 00:00:00 2001 From: S-Harshit <65359506+S-Harshit@users.noreply.github.com> Date: Fri, 12 Feb 2021 18:46:33 +0530 Subject: [PATCH] Add UX Test for controls at the row level (#3601) * Add UX Test for controls at the row level --- .../project/grid/all-column/flag.spec.js | 24 +++++++++++++++++++ .../project/grid/all-column/star.spec.js | 24 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 main/tests/cypress/cypress/integration/project/grid/all-column/flag.spec.js create mode 100644 main/tests/cypress/cypress/integration/project/grid/all-column/star.spec.js diff --git a/main/tests/cypress/cypress/integration/project/grid/all-column/flag.spec.js b/main/tests/cypress/cypress/integration/project/grid/all-column/flag.spec.js new file mode 100644 index 000000000..0286f3514 --- /dev/null +++ b/main/tests/cypress/cypress/integration/project/grid/all-column/flag.spec.js @@ -0,0 +1,24 @@ +describe(__filename, function () { + it('Ensure flag is visible and toggle on/off', function () { + cy.loadAndVisitProject('food.mini'); + cy.get('.data-table tr:nth-child(1) td:nth-child(2) a') + .should('have.class', 'data-table-flag-off') + .click(); + cy.assertNotificationContainingText('Flag row 1'); + + cy.get('.data-table tr:nth-child(2) td:nth-child(2) a') + .should('have.class', 'data-table-flag-off') + .click(); + cy.assertNotificationContainingText('Flag row 2'); + + cy.get('.data-table tr:nth-child(1) td:nth-child(2) a') + .should('have.class', 'data-table-flag-on') + .click(); + cy.assertNotificationContainingText('Unflag row 1'); + + cy.get('.data-table tr:nth-child(2) td:nth-child(2) a') + .should('have.class', 'data-table-flag-on') + .click(); + cy.assertNotificationContainingText('Unflag row 2'); + }); +}); diff --git a/main/tests/cypress/cypress/integration/project/grid/all-column/star.spec.js b/main/tests/cypress/cypress/integration/project/grid/all-column/star.spec.js new file mode 100644 index 000000000..787334ed0 --- /dev/null +++ b/main/tests/cypress/cypress/integration/project/grid/all-column/star.spec.js @@ -0,0 +1,24 @@ +describe(__filename, function () { + it('Ensure flag is visible and toggle on/off', function () { + cy.loadAndVisitProject('food.mini'); + cy.get('.data-table tr:nth-child(1) td:nth-child(1) a') + .should('have.class', 'data-table-star-off') + .click(); + cy.assertNotificationContainingText('Star row 1'); + + cy.get('.data-table tr:nth-child(2) td:nth-child(1) a') + .should('have.class', 'data-table-star-off') + .click(); + cy.assertNotificationContainingText('Star row 2'); + + cy.get('.data-table tr:nth-child(1) td:nth-child(1) a') + .should('have.class', 'data-table-star-on') + .click(); + cy.assertNotificationContainingText('Unstar row 1'); + + cy.get('.data-table tr:nth-child(2) td:nth-child(1) a') + .should('have.class', 'data-table-star-on') + .click(); + cy.assertNotificationContainingText('Unstar row 2'); + }); +});