Add UX Test for controls at the row level (#3601)

* Add UX Test for controls at the row level
This commit is contained in:
S-Harshit 2021-02-12 18:46:33 +05:30 committed by GitHub
parent 253f91949b
commit 389fa6257d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 0 deletions

View File

@ -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');
});
});

View File

@ -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');
});
});