From 88e410a30ac3337e0506091a7c7187b9304750b1 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Thu, 5 May 2022 17:32:16 +0100 Subject: [PATCH] More Job Application Tracker Template Tests Edit an application - Change application from not hired to hired - Confirm relative sections update Delete an application - Currently skipped as there seems to be an issue with deleting an application within the template --- .../HR/jobApplicationTracker.spec.js | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/packages/builder/cypress/integration/templates/HR/jobApplicationTracker.spec.js b/packages/builder/cypress/integration/templates/HR/jobApplicationTracker.spec.js index 0c6a66f018..531630aea6 100644 --- a/packages/builder/cypress/integration/templates/HR/jobApplicationTracker.spec.js +++ b/packages/builder/cypress/integration/templates/HR/jobApplicationTracker.spec.js @@ -175,5 +175,65 @@ filterTests(["all"], () => { } }) }) + + it("should edit an application", () => { + // Switch application from not hired to hired + // Visit published app + cy.visit(`${Cypress.config().baseUrl}/app/` + templateNameParsed) + cy.wait(1000) + + // Not Hired section + cy.get(".links").contains("Not hired").click({ force: true }) + cy.wait(500) + + // View application + cy.get(".spectrum-Table").within(() => { + cy.get(".spectrum-Button").contains("View").click({ force: true }) + cy.wait(500) + }) + + // Update value for 'Staged' + cy.get('[data-name="Stage"]').within(() => { + cy.get(".spectrum-Picker-label").click() + }) + cy.get(".spectrum-Menu").within(() => { + cy.get(".spectrum-Menu-item").contains("Hired").click() + }) + + // Save application + cy.get(".spectrum-Button").contains("Save").click({ force: true }) + cy.wait(500) + + // Hired section + cy.get(".links").contains("Hired").click({ force: true }) + cy.wait(500) + + // Verify Table size - Total rows = 2 + cy.get(".spectrum-Table").find(".spectrum-Table-row").its('length').then((len => { + expect(len).to.eq(2) + })) + }) + + xit("should delete an application", () => { + // Visit published app + cy.visit(`${Cypress.config().baseUrl}/app/` + templateNameParsed) + cy.wait(1000) + + // Hired section + cy.get(".links").contains("Hired").click({ force: true }) + cy.wait(500) + + // View first application + cy.get(".spectrum-Table-row").eq(0).within(() => { + cy.get(".spectrum-Button").contains("View").click({ force: true }) + cy.wait(500) + }) + + // Delete application + cy.get(".spectrum-Button").contains("Delete").click({ force: true }) + cy.get(".spectrum-Dialog-grid").within(() => { + cy.get(".spectrum-Button").contains("Confirm").click() + }) + }) }) })