From d2d08bc86939f2948a9ec2a8be23ed504746217c Mon Sep 17 00:00:00 2001 From: Sauli Purhonen Date: Wed, 6 Apr 2022 15:58:50 +0300 Subject: [PATCH] Fix for folder generation in Cypress tests #4 --- cypress/integration/generateObjects.spec.ts | 2 ++ cypress/support/commands.ts | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cypress/integration/generateObjects.spec.ts b/cypress/integration/generateObjects.spec.ts index 42dba19ad..8c1c67a1b 100644 --- a/cypress/integration/generateObjects.spec.ts +++ b/cypress/integration/generateObjects.spec.ts @@ -8,6 +8,7 @@ describe("Generate objects", function () { it("should generate objects from templates and publish", () => { cy.generateFolderAndObjects() + cy.reload() // Edit newly created folder cy.contains("Edit").click({ force: true }) @@ -36,6 +37,7 @@ describe("Generate objects", function () { it("should generate objects and stop in specific object type", () => { cy.generateFolderAndObjects(ObjectTypes.dac) + cy.reload() // // Edit newly created folder cy.contains("Edit").click({ force: true }) diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index bca605f36..517b92323 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -242,17 +242,17 @@ Cypress.Commands.add("generateFolderAndObjects", (stopToObjectType = "") => { } generateObjects() + + // Test that newly created folder is listed + // cy.reload() + // cy.wait("@fetchFolders", { timeout: 10000 }) + // cy.get("[data-field='name']").eq(1).should("have.text", "Test generated folder") + // cy.get("[data-testid='edit-draft-submission']").scrollIntoView().should("be.visible") }) } else { cy.log("Error in fetching user") } }) - - // Test that newly created folder is listed - cy.visit(baseUrl + "/en/home") - cy.wait("@fetchFolders", { timeout: 10000 }) - cy.get("[data-field='name']").eq(1).should("have.text", "Test generated folder") - cy.get("[data-testid='edit-draft-submission']").scrollIntoView().should("be.visible") }) // Generate single object for given object type