1
0
Fork 0
mirror of synced 2024-07-06 23:10:57 +12:00
budibase/packages/builder/cypress/integration/createAutomation.spec.js

54 lines
1.3 KiB
JavaScript
Raw Normal View History

context("Create a automation", () => {
2020-09-15 00:29:32 +12:00
before(() => {
2021-04-16 05:29:11 +12:00
cy.login()
cy.createTestApp()
2020-09-15 00:29:32 +12:00
})
// https://on.cypress.io/interacting-with-elements
it("should create a automation", () => {
2020-09-15 00:29:32 +12:00
cy.createTestTableWithData()
cy.contains("Automate").click()
cy.get("[data-cy='new-screen'] > .spectrum-Icon").click()
cy.get(".spectrum-Dialog-grid").within(() => {
cy.get("input").type("Add Row")
cy.get(".spectrum-Button--cta").click()
})
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(() => {
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
2020-10-28 04:26:07 +13:00
cy.contains("Action").click()
cy.contains("Create Row").click()
cy.get(".setup").within(() => {
cy.get(".spectrum-Picker-label").click()
cy.contains("dog").click()
2021-02-24 03:28:05 +13:00
cy.get("input")
.first()
.type("goodboy")
cy.get("input")
.eq(1)
.type("11")
2020-09-19 03:13:42 +12:00
})
2020-09-15 00:29:32 +12:00
// Save
cy.contains("Save Automation").click()
2020-09-15 00:29:32 +12:00
// Activate Automation
cy.get("[aria-label=PlayCircle]").click()
2020-09-15 00:29:32 +12:00
})
it("should add row when a new row is added", () => {
cy.contains("Data").click()
cy.addRow(["Rover", 15])
2020-09-15 00:29:32 +12:00
cy.reload()
cy.contains("goodboy").should("have.text", "goodboy")
})
})