2020-09-26 00:12:16 +12:00
|
|
|
context("Create a Table", () => {
|
|
|
|
before(() => {
|
2021-02-04 05:09:48 +13:00
|
|
|
cy.visit(`localhost:${Cypress.env("PORT")}/_builder`)
|
2020-09-26 00:12:16 +12:00
|
|
|
cy.createApp("Table App", "Table App Description")
|
|
|
|
})
|
|
|
|
|
|
|
|
it("should create a new Table", () => {
|
|
|
|
cy.createTable("dog")
|
|
|
|
|
|
|
|
// Check if Table exists
|
2020-10-28 04:26:07 +13:00
|
|
|
cy.get(".table-title h1").should("have.text", "dog")
|
2020-09-26 00:12:16 +12:00
|
|
|
})
|
|
|
|
|
|
|
|
it("adds a new column to the table", () => {
|
2020-10-05 23:13:09 +13:00
|
|
|
cy.addColumn("dog", "name", "Text")
|
2020-09-26 00:12:16 +12:00
|
|
|
cy.contains("name").should("be.visible")
|
|
|
|
})
|
|
|
|
|
2020-10-10 07:10:28 +13:00
|
|
|
it("creates a row in the table", () => {
|
|
|
|
cy.addRow(["Rover"])
|
2020-09-26 00:12:16 +12:00
|
|
|
cy.contains("Rover").should("be.visible")
|
|
|
|
})
|
|
|
|
|
|
|
|
it("updates a column on the table", () => {
|
2020-10-28 22:50:05 +13:00
|
|
|
cy.contains("header", "name")
|
|
|
|
.trigger("mouseover")
|
|
|
|
.find(".ri-pencil-line")
|
|
|
|
.click({ force: true })
|
2020-10-28 04:26:07 +13:00
|
|
|
cy.get(".actions input").first().type("updated")
|
2020-10-15 20:17:26 +13:00
|
|
|
// Unset table display column
|
|
|
|
cy.contains("display column").click()
|
2020-09-26 00:12:16 +12:00
|
|
|
cy.contains("Save Column").click()
|
2020-10-05 23:13:09 +13:00
|
|
|
cy.contains("nameupdated").should("have.text", "nameupdated")
|
2020-09-26 00:12:16 +12:00
|
|
|
})
|
|
|
|
|
2020-10-10 07:10:28 +13:00
|
|
|
it("edits a row", () => {
|
2020-10-29 05:05:19 +13:00
|
|
|
cy.contains("button", "Edit").click({ force: true })
|
|
|
|
cy.wait(1000)
|
2020-10-05 23:13:09 +13:00
|
|
|
cy.get(".modal input").type("Updated")
|
2020-09-26 00:12:16 +12:00
|
|
|
cy.contains("Save").click()
|
|
|
|
cy.contains("RoverUpdated").should("have.text", "RoverUpdated")
|
|
|
|
})
|
|
|
|
|
2020-10-10 07:10:28 +13:00
|
|
|
it("deletes a row", () => {
|
2020-10-28 05:01:27 +13:00
|
|
|
cy.get(".ag-checkbox-input").check({ force: true })
|
|
|
|
cy.contains("Delete 1 row(s)").click()
|
|
|
|
cy.get(".modal").contains("Delete").click()
|
2020-09-26 00:12:16 +12:00
|
|
|
cy.contains("RoverUpdated").should("not.exist")
|
|
|
|
})
|
|
|
|
|
|
|
|
it("deletes a column", () => {
|
2020-10-29 04:20:56 +13:00
|
|
|
cy.contains("header", "name")
|
|
|
|
.trigger("mouseover")
|
|
|
|
.find(".ri-pencil-line")
|
|
|
|
.click({ force: true })
|
2020-10-28 22:50:05 +13:00
|
|
|
cy.contains("Delete").click()
|
2020-10-28 05:01:27 +13:00
|
|
|
cy.wait(50)
|
2020-10-28 22:50:05 +13:00
|
|
|
cy.get(".buttons").contains("Delete").click()
|
2020-09-26 00:12:16 +12:00
|
|
|
cy.contains("nameupdated").should("not.exist")
|
|
|
|
})
|
|
|
|
|
|
|
|
it("deletes a table", () => {
|
2021-02-07 11:41:27 +13:00
|
|
|
cy.get(".ri-more-line").first().click({ force: true })
|
2020-09-26 00:12:16 +12:00
|
|
|
cy.get("[data-cy=delete-table]").click()
|
|
|
|
cy.contains("Delete Table").click()
|
|
|
|
cy.contains("dog").should("not.exist")
|
|
|
|
})
|
2020-08-08 05:31:40 +12:00
|
|
|
})
|