2020-09-21 14:49:34 +02:00
|
|
|
context("Create a automation", () => {
|
2020-09-14 14:29:32 +02:00
|
|
|
before(() => {
|
2021-04-15 19:29:11 +02:00
|
|
|
cy.login()
|
2021-03-05 15:36:38 +01:00
|
|
|
cy.createTestApp()
|
2020-09-14 14:29:32 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
// https://on.cypress.io/interacting-with-elements
|
2020-09-21 14:49:34 +02:00
|
|
|
it("should create a automation", () => {
|
2020-09-14 14:29:32 +02:00
|
|
|
cy.createTestTableWithData()
|
|
|
|
|
2020-09-21 14:49:34 +02:00
|
|
|
cy.contains("automate").click()
|
2020-10-27 16:26:07 +01:00
|
|
|
cy.get("[data-cy=new-automation]").click()
|
2020-10-05 12:13:09 +02:00
|
|
|
cy.get(".modal").within(() => {
|
2020-10-09 20:10:28 +02:00
|
|
|
cy.get("input").type("Add Row")
|
2021-02-23 15:28:05 +01:00
|
|
|
cy.get(".buttons")
|
|
|
|
.contains("Create")
|
|
|
|
.click()
|
2020-10-05 12:13:09 +02:00
|
|
|
})
|
2020-09-14 14:29:32 +02:00
|
|
|
|
|
|
|
// Add trigger
|
2020-10-27 16:26:07 +01:00
|
|
|
cy.contains("Trigger").click()
|
2021-02-23 15:28:05 +01:00
|
|
|
cy.contains("Row Created").click()
|
2020-10-27 16:26:07 +01:00
|
|
|
cy.get(".setup").within(() => {
|
2021-02-23 15:28:05 +01:00
|
|
|
cy.get("select")
|
|
|
|
.first()
|
|
|
|
.select("dog")
|
2020-09-18 17:13:42 +02:00
|
|
|
})
|
2020-09-14 14:29:32 +02:00
|
|
|
|
|
|
|
// Create action
|
2020-10-27 16:26:07 +01:00
|
|
|
cy.contains("Action").click()
|
|
|
|
cy.contains("Create Row").click()
|
|
|
|
cy.get(".setup").within(() => {
|
2021-02-23 15:28:05 +01:00
|
|
|
cy.get("select")
|
|
|
|
.first()
|
|
|
|
.select("dog")
|
|
|
|
cy.get("input")
|
|
|
|
.first()
|
|
|
|
.type("goodboy")
|
|
|
|
cy.get("input")
|
|
|
|
.eq(1)
|
|
|
|
.type("11")
|
2020-09-18 17:13:42 +02:00
|
|
|
})
|
2020-09-14 14:29:32 +02:00
|
|
|
|
|
|
|
// Save
|
2020-09-21 14:49:34 +02:00
|
|
|
cy.contains("Save Automation").click()
|
2020-09-14 14:29:32 +02:00
|
|
|
|
2020-09-21 14:49:34 +02:00
|
|
|
// Activate Automation
|
|
|
|
cy.get("[data-cy=activate-automation]").click()
|
2020-10-27 16:26:07 +01:00
|
|
|
cy.get(".ri-stop-circle-fill.highlighted").should("be.visible")
|
2020-09-14 14:29:32 +02:00
|
|
|
})
|
|
|
|
|
2020-10-09 20:10:28 +02:00
|
|
|
it("should add row when a new row is added", () => {
|
2020-10-27 16:26:07 +01:00
|
|
|
cy.contains("data").click()
|
2020-10-09 20:10:28 +02:00
|
|
|
cy.addRow(["Rover", 15])
|
2020-09-14 14:29:32 +02:00
|
|
|
cy.reload()
|
|
|
|
cy.contains("goodboy").should("have.text", "goodboy")
|
|
|
|
})
|
|
|
|
})
|