2020-09-22 00:49:34 +12:00
|
|
|
context("Create a automation", () => {
|
2020-09-15 00:29:32 +12:00
|
|
|
before(() => {
|
2021-04-16 05:29:11 +12:00
|
|
|
cy.login()
|
2021-03-06 03:36:38 +13:00
|
|
|
cy.createTestApp()
|
2020-09-15 00:29:32 +12:00
|
|
|
})
|
|
|
|
|
|
|
|
// https://on.cypress.io/interacting-with-elements
|
2020-09-22 00:49:34 +12:00
|
|
|
it("should create a automation", () => {
|
2020-09-15 00:29:32 +12:00
|
|
|
cy.createTestTableWithData()
|
|
|
|
|
2021-05-26 02:57:38 +12:00
|
|
|
cy.contains("Automate").click()
|
|
|
|
cy.get("[data-cy='new-screen'] > .spectrum-Icon").click()
|
|
|
|
cy.get(".spectrum-Dialog-grid").within(() => {
|
2020-10-10 07:10:28 +13:00
|
|
|
cy.get("input").type("Add Row")
|
2021-05-26 02:57:38 +12:00
|
|
|
cy.get(".spectrum-Button--cta").click()
|
2020-10-05 23:13:09 +13:00
|
|
|
})
|
2020-09-15 00:29:32 +12:00
|
|
|
|
|
|
|
// Add trigger
|
2020-10-28 04:26:07 +13:00
|
|
|
cy.contains("Trigger").click()
|
2021-02-24 03:28:05 +13:00
|
|
|
cy.contains("Row Created").click()
|
2020-10-28 04:26:07 +13:00
|
|
|
cy.get(".setup").within(() => {
|
2021-05-26 02:57:38 +12:00
|
|
|
cy.get(".spectrum-Picker-label").click()
|
|
|
|
cy.contains("dog").click()
|
2020-09-19 03:13:42 +12:00
|
|
|
})
|
2020-09-15 00:29:32 +12:00
|
|
|
|
|
|
|
// Create action
|
2021-09-14 23:40:19 +12:00
|
|
|
cy.contains("Internal").click()
|
2020-10-28 04:26:07 +13:00
|
|
|
cy.contains("Create Row").click()
|
|
|
|
cy.get(".setup").within(() => {
|
2021-05-26 02:57:38 +12:00
|
|
|
cy.get(".spectrum-Picker-label").click()
|
|
|
|
cy.contains("dog").click()
|
2021-07-28 09:48:06 +12:00
|
|
|
cy.get(".spectrum-Textfield-input")
|
2021-02-24 03:28:05 +13:00
|
|
|
.first()
|
|
|
|
.type("goodboy")
|
2021-07-28 09:48:06 +12:00
|
|
|
cy.get(".spectrum-Textfield-input")
|
2021-02-24 03:28:05 +13:00
|
|
|
.eq(1)
|
|
|
|
.type("11")
|
2020-09-19 03:13:42 +12:00
|
|
|
})
|
2020-09-15 00:29:32 +12:00
|
|
|
|
|
|
|
// Save
|
2020-09-22 00:49:34 +12:00
|
|
|
cy.contains("Save Automation").click()
|
2020-09-15 00:29:32 +12:00
|
|
|
|
2020-09-22 00:49:34 +12:00
|
|
|
// Activate Automation
|
2021-07-28 09:48:06 +12:00
|
|
|
cy.get("[data-cy=activate-automation]").click()
|
2020-09-15 00:29:32 +12:00
|
|
|
})
|
|
|
|
|
2020-10-10 07:10:28 +13:00
|
|
|
it("should add row when a new row is added", () => {
|
2021-05-26 02:57:38 +12:00
|
|
|
cy.contains("Data").click()
|
2020-10-10 07:10:28 +13:00
|
|
|
cy.addRow(["Rover", 15])
|
2020-09-15 00:29:32 +12:00
|
|
|
cy.reload()
|
|
|
|
cy.contains("goodboy").should("have.text", "goodboy")
|
|
|
|
})
|
|
|
|
})
|