From cc3fa5df8d8c4fbb436229acc88d501b9404f7ca Mon Sep 17 00:00:00 2001 From: Cindy Chang Date: Mon, 3 Jun 2024 10:15:43 +0800 Subject: [PATCH] unused cypress file; why unused? because cypress doesn't support canvas element --- cypress/e2e/pageAdmin.cy.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 cypress/e2e/pageAdmin.cy.js diff --git a/cypress/e2e/pageAdmin.cy.js b/cypress/e2e/pageAdmin.cy.js new file mode 100644 index 0000000..042fac9 --- /dev/null +++ b/cypress/e2e/pageAdmin.cy.js @@ -0,0 +1,29 @@ +describe('Modal dismissal related navigation button test', ()=>{ + beforeEach(() => { + cy.visit('https://REDACTED-HOST/files'); + cy.login(); + cy.visit('https://REDACTED-HOST/files'); + }); + + it("On MAP page, after dismissing modal, active page is still MAP page, not CONFORMANCE page.", () => { + cy.get('tbody td').first().dblclick(); + // Should enter MAP page + cy.url().should('include', 'map'); + cy.url().should('include', 'filter'); + + cy.get('canvas').click(); + + // At least set a condition as an edit action + cy.get('[type="checkbox"]').first().check(); + cy.contains('button', 'Apply').click(); + cy.get('#tabFunnel').click(); + cy.contains('button', 'Apply All').click(); + cy.contains('.nav-item', 'CONFORMANCE').click(); + // Simulate escape keyboard; simulate dismissal of modal + cy.get('body').trigger('keydown', { keyCode: 27}); + cy.wait(500); + cy.get('body').trigger('keyup', { keyCode: 27}); + cy.get('.nav-item', 'MAP').should('have.class', 'active'); + }); +}); + \ No newline at end of file