diff --git a/packages/builder/cypress/integration/createAutomation.spec.js b/packages/builder/cypress/integration/createAutomation.spec.js
index 10556989de..26af4fac71 100644
--- a/packages/builder/cypress/integration/createAutomation.spec.js
+++ b/packages/builder/cypress/integration/createAutomation.spec.js
@@ -15,8 +15,12 @@ context("Create a automation", () => {
cy.contains("automate").click()
cy.contains("Create New Automation").click()
- cy.get("input").type("Add Record")
- cy.contains("Save").click()
+ cy.get(".modal").within(() => {
+ cy.get("input").type("Add Record")
+ cy.get(".buttons")
+ .contains("Create")
+ .click()
+ })
// Add trigger
cy.get("[data-cy=add-automation-component]").click()
@@ -46,7 +50,6 @@ context("Create a automation", () => {
// Activate Automation
cy.get("[data-cy=activate-automation]").click()
- cy.contains("Add Record").should("be.visible")
cy.get(".stop-button.highlighted").should("be.visible")
})
diff --git a/packages/builder/cypress/integration/createTable.spec.js b/packages/builder/cypress/integration/createTable.spec.js
index 6958eb5d37..d7ae805b27 100644
--- a/packages/builder/cypress/integration/createTable.spec.js
+++ b/packages/builder/cypress/integration/createTable.spec.js
@@ -1,70 +1,65 @@
-context('Create a Table', () => {
- before(() => {
- cy.visit('localhost:4001/_builder')
- cy.createApp('Table App', 'Table App Description')
- })
+context("Create a Table", () => {
+ before(() => {
+ cy.visit("localhost:4001/_builder")
+ cy.createApp("Table App", "Table App Description")
+ })
- it('should create a new Table', () => {
- cy.createTable('dog')
+ it("should create a new Table", () => {
+ cy.createTable("dog")
- // Check if Table exists
- cy.get('.title').should('contain.text', 'dog')
- })
+ // Check if Table exists
+ cy.get(".title span").should("have.text", "dog")
+ })
- it('adds a new column to the table', () => {
- cy.addColumn('dog', 'name', 'Plain Text')
+ it("adds a new column to the table", () => {
+ cy.addColumn("dog", "name", "Text")
+ cy.contains("name").should("be.visible")
+ })
- cy.contains('name').should("be.visible")
- })
+ it("creates a record in the table", () => {
+ cy.addRecord(["Rover"])
+ cy.contains("Rover").should("be.visible")
+ })
- it('creates a record in the table', () => {
- cy.addRecord(["Rover"])
+ it("updates a column on the table", () => {
+ cy.contains("name").click()
+ cy.get("[data-cy='edit-column-header']").click()
+ cy.get(".actions input")
+ .first()
+ .type("updated")
+ cy.get("select").select("Text")
+ cy.contains("Save Column").click()
+ cy.contains("nameupdated").should("have.text", "nameupdated")
+ })
- cy.contains('Rover').should("be.visible")
- })
+ it("edits a record", () => {
+ cy.get("tbody .ri-more-line").click()
+ cy.get("[data-cy=edit-row]").click()
+ cy.get(".modal input").type("Updated")
+ cy.contains("Save").click()
+ cy.contains("RoverUpdated").should("have.text", "RoverUpdated")
+ })
- it('updates a column on the table', () => {
- cy.contains("name").click()
- cy.get("[data-cy='edit-column-header']").click()
+ it("deletes a record", () => {
+ cy.get("tbody .ri-more-line").click()
+ cy.get("[data-cy=delete-row]").click()
+ cy.contains("Delete Row").click()
+ cy.contains("RoverUpdated").should("not.exist")
+ })
- cy.get("[placeholder=Name]").type("updated")
- cy.get("select").select("Plain Text")
-
- cy.contains("Save Column").click()
-
- cy.contains('nameupdated').should('have.text', 'nameupdated ')
- })
-
- it('edits a record', () => {
- cy.get("tbody .ri-more-line").click()
- cy.get("[data-cy=edit-row]").click()
- cy.get(".actions input").type("Updated")
- cy.contains("Save").click()
-
- cy.contains('RoverUpdated').should('have.text', 'RoverUpdated')
- })
-
- it('deletes a record', () => {
- cy.get("tbody .ri-more-line").click()
- cy.get("[data-cy=delete-row]").click()
- cy.get(".modal-actions").contains("Delete").click()
-
- cy.contains('RoverUpdated').should('not.exist')
- })
-
- it('deletes a column', () => {
- cy.contains("name").click()
- cy.get("[data-cy='delete-column-header']").click()
-
- cy.contains('nameupdated').should('not.exist')
- })
-
- it('deletes a table', () => {
- cy.contains("div", "dog").get(".ri-more-line").click()
- cy.get("[data-cy=delete-table]").click()
- cy.get(".modal-actions").contains("Delete").click()
-
- cy.contains('dog').should('not.exist')
- })
+ it("deletes a column", () => {
+ cy.contains("name").click()
+ cy.get("[data-cy='delete-column-header']").click()
+ cy.contains("Delete Column").click()
+ cy.contains("nameupdated").should("not.exist")
+ })
+ it("deletes a table", () => {
+ cy.contains("div", "dog")
+ .get(".ri-more-line")
+ .click()
+ cy.get("[data-cy=delete-table]").click()
+ cy.contains("Delete Table").click()
+ cy.contains("dog").should("not.exist")
+ })
})
diff --git a/packages/builder/cypress/integration/createView.spec.js b/packages/builder/cypress/integration/createView.spec.js
index 81af40c7f7..8f0c9565c8 100644
--- a/packages/builder/cypress/integration/createView.spec.js
+++ b/packages/builder/cypress/integration/createView.spec.js
@@ -1,91 +1,100 @@
+context("Create a View", () => {
+ before(() => {
+ cy.visit("localhost:4001/_builder")
+ cy.createApp("View App", "View App Description")
+ cy.createTable("data")
+ cy.addColumn("data", "group", "Text")
+ cy.addColumn("data", "age", "Number")
+ cy.addColumn("data", "rating", "Number")
-context('Create a View', () => {
- before(() => {
- cy.visit('localhost:4001/_builder')
- cy.createApp('View App', 'View App Description')
- cy.createTable('data')
- cy.addColumn('data', 'group', 'Plain Text')
- cy.addColumn('data', 'age', 'Number')
- cy.addColumn('data', 'rating', 'Number')
+ // 6 Records
+ cy.addRecord(["Students", 25, 1])
+ cy.addRecord(["Students", 20, 3])
+ cy.addRecord(["Students", 18, 6])
+ cy.addRecord(["Students", 25, 2])
+ cy.addRecord(["Teachers", 49, 5])
+ cy.addRecord(["Teachers", 36, 3])
+ })
- // 6 Records
- cy.addRecord(["Students", 25, 1])
- cy.addRecord(["Students", 20, 3])
- cy.addRecord(["Students", 18, 6])
- cy.addRecord(["Students", 25, 2])
- cy.addRecord(["Teachers", 49, 5])
- cy.addRecord(["Teachers", 36, 3])
- })
-
- it('creates a view', () => {
- cy.contains("Create New View").click()
- cy.get("[placeholder='View Name']").type("Test View")
+ it("creates a view", () => {
+ cy.contains("Create New View").click()
+ cy.get(".menu-container").within(() => {
+ cy.get("input").type("Test View")
cy.contains("Save View").click()
- cy.get(".title").contains("Test View")
- cy.get("thead th").should(($headers) => {
- expect($headers).to.have.length(3)
- const headers = $headers.map((i, header) => Cypress.$(header).text())
- expect(headers.get()).to.deep.eq([
- "group",
- "age",
- "rating"
- ])
- })
- });
-
- it('filters the view by age over 10', () => {
- cy.contains("Filter").click()
- cy.contains("Add Filter").click()
- cy.get(".menu-container").find("select").first().select("age")
- cy.get(".menu-container").find("select").eq(1).select("More Than")
- cy.get("input[placeholder='age']").type(18)
- cy.contains("Save").click()
- cy.get("tbody tr").should(($values) => {
- expect($values).to.have.length(5)
- })
- });
-
- it('creates a stats calculation view based on age', () => {
- cy.contains("Calculate").click()
- // we may reinstate this - have commented this dropdown for now as there is only one option
- //cy.get(".menu-container").find("select").first().select("Statistics")
- cy.get(".menu-container").find("select").eq(0).select("age")
- cy.contains("Save").click()
- cy.get("thead th").should(($headers) => {
- expect($headers).to.have.length(7)
- const headers = $headers.map((i, header) => Cypress.$(header).text())
- expect(headers.get()).to.deep.eq([
- "field",
- "sum",
- "min",
- "max",
- "count",
- "sumsqr",
- "avg",
- ])
- })
- cy.get("tbody td").should(($values) => {
- const values = $values.map((i, value) => Cypress.$(value).text())
- expect(values.get()).to.deep.eq([
- "age",
- "155",
- "20",
- "49",
- "5",
- "5347",
- "31"
- ])
- })
})
+ cy.get(".title").contains("Test View")
+ cy.get("thead th div").should($headers => {
+ expect($headers).to.have.length(3)
+ const headers = $headers.map((i, header) => Cypress.$(header).text())
+ expect(headers.get()).to.deep.eq(["group", "age", "rating"])
+ })
+ })
- it('groups the view by group', () => {
- cy.contains("Group By").click()
- cy.get("select").select("group")
- cy.contains("Save").click()
- cy.contains("Students").should("be.visible")
- cy.contains("Teachers").should("be.visible")
+ it("filters the view by age over 10", () => {
+ cy.contains("Filter").click()
+ cy.contains("Add Filter").click()
+ cy.get(".menu-container")
+ .find("select")
+ .first()
+ .select("age")
+ cy.get(".menu-container")
+ .find("select")
+ .eq(1)
+ .select("More Than")
+ cy.get("input").type(18)
+ cy.contains("Save").click()
+ cy.get("tbody tr").should($values => {
+ expect($values).to.have.length(5)
+ })
+ })
- cy.get("tbody tr").first().find("td").should(($values) => {
+ it("creates a stats calculation view based on age", () => {
+ cy.contains("Calculate").click()
+ // we may reinstate this - have commented this dropdown for now as there is only one option
+ //cy.get(".menu-container").find("select").first().select("Statistics")
+ cy.get(".menu-container")
+ .find("select")
+ .eq(0)
+ .select("age")
+ cy.contains("Save").click()
+ cy.get("thead th div").should($headers => {
+ expect($headers).to.have.length(7)
+ const headers = $headers.map((i, header) => Cypress.$(header).text())
+ expect(headers.get()).to.deep.eq([
+ "field",
+ "sum",
+ "min",
+ "max",
+ "count",
+ "sumsqr",
+ "avg",
+ ])
+ })
+ cy.get("tbody td").should($values => {
+ const values = $values.map((i, value) => Cypress.$(value).text())
+ expect(values.get()).to.deep.eq([
+ "age",
+ "155",
+ "20",
+ "49",
+ "5",
+ "5347",
+ "31",
+ ])
+ })
+ })
+
+ it("groups the view by group", () => {
+ cy.contains("Group By").click()
+ cy.get("select").select("group")
+ cy.contains("Save").click()
+ cy.contains("Students").should("be.visible")
+ cy.contains("Teachers").should("be.visible")
+
+ cy.get("tbody tr")
+ .first()
+ .find("td")
+ .should($values => {
const values = $values.map((i, value) => Cypress.$(value).text())
expect(values.get()).to.deep.eq([
"Students",
@@ -94,24 +103,30 @@ context('Create a View', () => {
"25",
"3",
"1650",
- "23.333333333333332"
+ "23.333333333333332",
])
})
- })
+ })
- it('renames a view', () => {
- cy.contains("[data-cy=model-nav-item]", "Test View").find(".ri-more-line").click()
- cy.contains("Edit").click()
- cy.get("[placeholder='View Name']").type(" Updated")
+ it("renames a view", () => {
+ cy.contains("[data-cy=model-nav-item]", "Test View")
+ .find(".ri-more-line")
+ .click()
+ cy.contains("Edit").click()
+ cy.get(".menu-container").within(() => {
+ cy.get("input").type(" Updated")
cy.contains("Save").click()
- cy.contains("Test View Updated").should("be.visible")
})
+ cy.contains("Test View Updated").should("be.visible")
+ })
- it('deletes a view', () => {
- cy.contains("[data-cy=model-nav-item]", "Test View Updated").click()
- cy.contains("[data-cy=model-nav-item]", "Test View Updated").find(".ri-more-line").click()
- cy.contains("Delete").click()
- cy.get(".content").contains("button", "Delete").click()
- cy.contains("TestView Updated").should("not.be.visible")
- })
+ it("deletes a view", () => {
+ cy.contains("[data-cy=model-nav-item]", "Test View Updated").click()
+ cy.contains("[data-cy=model-nav-item]", "Test View Updated")
+ .find(".ri-more-line")
+ .click()
+ cy.contains("Delete").click()
+ cy.contains("Delete View").click()
+ cy.contains("TestView Updated").should("not.be.visible")
+ })
})
diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js
index 82f87032fa..79fd83875d 100644
--- a/packages/builder/cypress/support/commands.js
+++ b/packages/builder/cypress/support/commands.js
@@ -59,16 +59,21 @@ Cypress.Commands.add("createApp", name => {
Cypress.Commands.add("createTestTableWithData", () => {
cy.createTable("dog")
- cy.addColumn("dog", "name", "Plain Text")
+ cy.addColumn("dog", "name", "Text")
cy.addColumn("dog", "age", "Number")
})
Cypress.Commands.add("createTable", tableName => {
// Enter model name
cy.contains("Create New Table").click()
- cy.get("[placeholder='Table Name']").type(tableName)
-
- cy.contains("Save").click()
+ cy.get(".modal").within(() => {
+ cy.get("input")
+ .first()
+ .type(tableName)
+ cy.get(".buttons")
+ .contains("Create")
+ .click()
+ })
cy.contains(tableName).should("be.visible")
})
@@ -77,25 +82,31 @@ Cypress.Commands.add("addColumn", (tableName, columnName, type) => {
cy.contains(tableName).click()
cy.contains("Create New Column").click()
- cy.get("[placeholder=Name]").type(columnName)
- cy.get("select").select(type)
-
- cy.contains("Save Column")
-
- cy.contains("Save").click()
+ // Configure column
+ cy.get(".menu-container").within(() => {
+ cy.get("input")
+ .first()
+ .type(columnName)
+ cy.get("select").select(type)
+ cy.contains("Save").click()
+ })
})
Cypress.Commands.add("addRecord", values => {
cy.contains("Create New Row").click()
- for (let i = 0; i < values.length; i++) {
- cy.get(".actions input")
- .eq(i)
- .type(values[i])
- }
+ cy.get(".modal").within(() => {
+ for (let i = 0; i < values.length; i++) {
+ cy.get("input")
+ .eq(i)
+ .type(values[i])
+ }
- // Save
- cy.contains("Save").click()
+ // Save
+ cy.get(".buttons")
+ .contains("Create")
+ .click()
+ })
})
Cypress.Commands.add("createUser", (username, password, accessLevel) => {
@@ -114,7 +125,9 @@ Cypress.Commands.add("createUser", (username, password, accessLevel) => {
.select(accessLevel)
// Save
- cy.get(".create-button > button").click()
+ cy.get(".inputs")
+ .contains("Create")
+ .click()
})
Cypress.Commands.add("addHeadlineComponent", text => {
@@ -138,12 +151,12 @@ Cypress.Commands.add("navigateToFrontend", () => {
})
Cypress.Commands.add("createScreen", (screenName, route) => {
- cy.get(".newscreen").click()
- cy.get("[data-cy=new-screen-dialog] input:first").type(screenName)
- if (route) {
- cy.get("[data-cy=new-screen-dialog] input:last").type(route)
- }
- cy.get("[data-cy=create-screen-footer]").within(() => {
+ cy.contains("Create New Screen").click()
+ cy.get(".modal").within(() => {
+ cy.get("input:first").type(screenName)
+ if (route) {
+ cy.get("input:last").type(route)
+ }
cy.contains("Create Screen").click()
})
cy.get(".nav-items-container").within(() => {
diff --git a/packages/builder/package.json b/packages/builder/package.json
index d34472e353..0fb2d5a6f0 100644
--- a/packages/builder/package.json
+++ b/packages/builder/package.json
@@ -63,7 +63,7 @@
}
},
"dependencies": {
- "@budibase/bbui": "^1.34.6",
+ "@budibase/bbui": "^1.41.0",
"@budibase/client": "^0.1.25",
"@budibase/colorpicker": "^1.0.1",
"@fortawesome/fontawesome-free": "^5.14.0",
@@ -79,7 +79,6 @@
"shortid": "^2.2.15",
"svelte-loading-spinners": "^0.1.1",
"svelte-portal": "^0.1.0",
- "svelte-simple-modal": "^0.4.2",
"yup": "^0.29.2"
},
"devDependencies": {
@@ -113,7 +112,7 @@
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-url": "^2.2.2",
"start-server-and-test": "^1.11.0",
- "svelte": "^3.24.1",
+ "svelte": "^3.29.0",
"svelte-jester": "^1.0.6"
},
"gitHead": "115189f72a850bfb52b65ec61d932531bf327072"
diff --git a/packages/builder/src/App.svelte b/packages/builder/src/App.svelte
index 16156d7af7..a5016db114 100644
--- a/packages/builder/src/App.svelte
+++ b/packages/builder/src/App.svelte
@@ -1,9 +1,8 @@
+{#if automationCount === 0}
+ Create your first automation to get started
+{:else if automation == null}
+ Select an automation to edit
+{:else if !blocks.length}
+ Add some steps to your automation to get started
+{/if}
Where
- {:else} -