2020-09-25 14:12:16 +02:00
|
|
|
context("Create a Table", () => {
|
|
|
|
before(() => {
|
2021-04-15 19:29:11 +02:00
|
|
|
cy.login()
|
2021-03-05 15:36:38 +01:00
|
|
|
cy.createTestApp()
|
2020-09-25 14:12:16 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
it("should create a new Table", () => {
|
|
|
|
cy.createTable("dog")
|
|
|
|
|
|
|
|
// Check if Table exists
|
2020-10-27 16:26:07 +01:00
|
|
|
cy.get(".table-title h1").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", () => {
|
2021-05-25 19:06:56 +02:00
|
|
|
cy.get(".title").click()
|
|
|
|
cy.get(".spectrum-Table-editIcon > use").click()
|
|
|
|
cy.get("input")
|
|
|
|
.eq(1)
|
|
|
|
.type("updated", { force: true })
|
2020-10-15 09:17:26 +02:00
|
|
|
// Unset table display column
|
2021-05-25 19:06:56 +02:00
|
|
|
cy.get(".spectrum-Switch-input").eq(1).click()
|
2020-09-25 14:12:16 +02:00
|
|
|
cy.contains("Save Column").click()
|
2021-05-25 19:06:56 +02:00
|
|
|
cy.contains("nameupdated ").should("contain", "nameupdated")
|
2020-09-25 14:12:16 +02:00
|
|
|
})
|
|
|
|
|
2020-10-09 20:10:28 +02:00
|
|
|
it("edits a row", () => {
|
2020-10-28 17:05:19 +01:00
|
|
|
cy.contains("button", "Edit").click({ force: true })
|
|
|
|
cy.wait(1000)
|
2021-05-25 19:06:56 +02:00
|
|
|
cy.get(".spectrum-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", () => {
|
2021-05-25 19:06:56 +02:00
|
|
|
cy.get(".spectrum-Checkbox-input").check({ force: true })
|
2020-10-27 17:01:27 +01:00
|
|
|
cy.contains("Delete 1 row(s)").click()
|
2021-05-25 19:06:56 +02:00
|
|
|
cy.get(".spectrum-Modal")
|
2021-03-05 15:36:38 +01:00
|
|
|
.contains("Delete")
|
|
|
|
.click()
|
2020-09-25 14:12:16 +02:00
|
|
|
cy.contains("RoverUpdated").should("not.exist")
|
|
|
|
})
|
|
|
|
|
|
|
|
it("deletes a column", () => {
|
2021-05-25 19:06:56 +02:00
|
|
|
cy.get(".title").click()
|
|
|
|
cy.get(".spectrum-Table-editIcon > use").click()
|
2020-10-28 10:50:05 +01:00
|
|
|
cy.contains("Delete").click()
|
2020-10-27 17:01:27 +01:00
|
|
|
cy.wait(50)
|
2021-05-25 19:06:56 +02:00
|
|
|
cy.contains("Delete Column")
|
2021-03-05 15:36:38 +01:00
|
|
|
.click()
|
2020-09-25 14:12:16 +02:00
|
|
|
cy.contains("nameupdated").should("not.exist")
|
|
|
|
})
|
|
|
|
|
|
|
|
it("deletes a table", () => {
|
2021-03-05 15:36:38 +01:00
|
|
|
cy.get(".ri-more-line")
|
|
|
|
.first()
|
|
|
|
.click({ force: true })
|
2020-09-25 14:12:16 +02:00
|
|
|
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
|
|
|
})
|