Skip to content

Commit

Permalink
Fix for folder generation in Cypress tests #4
Browse files Browse the repository at this point in the history
  • Loading branch information
saulipurhonen committed Apr 6, 2022
1 parent 20c65de commit d2d08bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions cypress/integration/generateObjects.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })

Expand Down Expand Up @@ -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 })

Expand Down
12 changes: 6 additions & 6 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d2d08bc

Please sign in to comment.