2020-09-25 14:12:16 +02:00
|
|
|
context("Create a Table", () => {
|
|
|
|
before(() => {
|
|
|
|
cy.visit("localhost:4001/_builder")
|
|
|
|
cy.createApp("Table App", "Table App Description")
|
|
|
|
})
|
|
|
|
|
|
|
|
it("should create a new Table", () => {
|
|
|
|
cy.createTable("dog")
|
|
|
|
|
|
|
|
// Check if Table exists
|
2020-10-07 12:23:47 +02:00
|
|
|
cy.get(".title span").should("have.text", "dog")
|
2020-09-25 14:12:16 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
it("adds a new column to the table", () => {
|
2020-10-05 12:13:09 +02:00
|
|
|
cy.addColumn("dog", "name", "Text")
|
2020-09-25 14:12:16 +02:00
|
|
|
cy.contains("name").should("be.visible")
|
|
|
|
})
|
|
|
|
|
2020-10-09 20:10:28 +02:00
|
|
|
it("creates a row in the table", () => {
|
|
|
|
cy.addRow(["Rover"])
|
2020-09-25 14:12:16 +02:00
|
|
|
cy.contains("Rover").should("be.visible")
|
|
|
|
})
|
|
|
|
|
|
|
|
it("updates a column on the table", () => {
|
|
|
|
cy.contains("name").click()
|
|
|
|
cy.get("[data-cy='edit-column-header']").click()
|
2020-10-05 12:13:09 +02:00
|
|
|
cy.get(".actions input")
|
|
|
|
.first()
|
|
|
|
.type("updated")
|
2020-10-15 09:17:26 +02:00
|
|
|
// Unset table display column
|
|
|
|
cy.contains("display column").click()
|
2020-09-25 14:12:16 +02:00
|
|
|
cy.contains("Save Column").click()
|
2020-10-05 12:13:09 +02:00
|
|
|
cy.contains("nameupdated").should("have.text", "nameupdated")
|
2020-09-25 14:12:16 +02:00
|
|
|
})
|
|
|
|
|
2020-10-09 20:10:28 +02:00
|
|
|
it("edits a row", () => {
|
2020-09-25 14:12:16 +02:00
|
|
|
cy.get("tbody .ri-more-line").click()
|
|
|
|
cy.get("[data-cy=edit-row]").click()
|
2020-10-05 12:13:09 +02:00
|
|
|
cy.get(".modal input").type("Updated")
|
2020-09-25 14:12:16 +02:00
|
|
|
cy.contains("Save").click()
|
|
|
|
cy.contains("RoverUpdated").should("have.text", "RoverUpdated")
|
|
|
|
})
|
|
|
|
|
2020-10-09 20:10:28 +02:00
|
|
|
it("deletes a row", () => {
|
2020-09-25 14:12:16 +02:00
|
|
|
cy.get("tbody .ri-more-line").click()
|
|
|
|
cy.get("[data-cy=delete-row]").click()
|
|
|
|
cy.contains("Delete Row").click()
|
|
|
|
cy.contains("RoverUpdated").should("not.exist")
|
|
|
|
})
|
|
|
|
|
|
|
|
it("deletes a column", () => {
|
|
|
|
cy.contains("name").click()
|
|
|
|
cy.get("[data-cy='delete-column-header']").click()
|
2020-10-05 12:13:09 +02:00
|
|
|
cy.contains("Delete Column").click()
|
2020-09-25 14:12:16 +02:00
|
|
|
cy.contains("nameupdated").should("not.exist")
|
|
|
|
})
|
|
|
|
|
|
|
|
it("deletes a table", () => {
|
|
|
|
cy.contains("div", "dog")
|
|
|
|
.get(".ri-more-line")
|
|
|
|
.click()
|
|
|
|
cy.get("[data-cy=delete-table]").click()
|
|
|
|
cy.contains("Delete Table").click()
|
|
|
|
cy.contains("dog").should("not.exist")
|
|
|
|
})
|
2020-08-07 19:31:40 +02:00
|
|
|
})
|