From 27da6ea4ab766b0f215956a840730812b464e5a2 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 8 Dec 2021 10:14:30 +0000 Subject: [PATCH 1/2] account for integer type from JSON schema --- .../automation/SetupPanel/AutomationBlockSetup.svelte | 2 +- packages/server/src/api/controllers/webhook.js | 4 ++++ packages/server/src/integrations/oracle.ts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index e7208518d5..6c4f84936b 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -241,7 +241,7 @@ value={inputData[key]} /> - {:else if value.type === "string" || value.type === "number"} + {:else if value.type === "string" || value.type === "number" || value.type === "integer"} {#if isTestModal} { let automation = await db.get(webhook.action.target) const autoOutputs = automation.definition.trigger.schema.outputs let properties = webhook.bodySchema.properties + // reset webhook outputs + autoOutputs.properties = { + body: autoOutputs.properties.body, + } for (let prop of Object.keys(properties)) { autoOutputs.properties[prop] = { type: properties[prop].type, diff --git a/packages/server/src/integrations/oracle.ts b/packages/server/src/integrations/oracle.ts index afaa902655..f602a97591 100644 --- a/packages/server/src/integrations/oracle.ts +++ b/packages/server/src/integrations/oracle.ts @@ -450,7 +450,7 @@ module OracleModule { }) return lastRow.rows } else { - return [{ [ operation.toLowerCase() ]: true }] + return [{ [operation.toLowerCase()]: true }] } } } From cd5d4a5df4d7a5e8401a064437d3e14c32319c1a Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 8 Dec 2021 11:32:28 +0000 Subject: [PATCH 2/2] updating cypress test to cover automation creation --- .../cypress/integration/createAutomation.spec.js | 10 +++++++--- .../AutomationBuilder/FlowChart/TestDataModal.svelte | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/builder/cypress/integration/createAutomation.spec.js b/packages/builder/cypress/integration/createAutomation.spec.js index 6ff013cd7a..efd3c7d023 100644 --- a/packages/builder/cypress/integration/createAutomation.spec.js +++ b/packages/builder/cypress/integration/createAutomation.spec.js @@ -35,19 +35,20 @@ context("Create a automation", () => { cy.contains("dog").click() cy.get(".spectrum-Textfield-input") .first() - .type("goodboy") + .type("{{ trigger.row.name }}", { parseSpecialCharSequences: false }) cy.get(".spectrum-Textfield-input") .eq(1) .type("11") + cy.contains("Finish and test automation").click() - cy.contains("Run test").click() cy.get(".modal-inner-wrapper").within(() => { cy.wait(1000) cy.get(".spectrum-Picker-label").click() cy.contains("dog").click() + cy.wait(1000) cy.get(".spectrum-Textfield-input") .first() - .type("goodboy") + .type("automationGoodboy") cy.get(".spectrum-Textfield-input") .eq(1) .type("11") @@ -57,6 +58,9 @@ context("Create a automation", () => { cy.get(".spectrum-Textfield-input") .eq(3) .type("123456") + cy.contains("Test").click() }) + cy.contains("Data").click() + cy.contains("automationGoodboy") }) }) diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte index 3c75c9963d..e43729edbe 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte @@ -25,7 +25,7 @@ // Check the schema to see if required fields have been entered $: isError = !trigger.schema.outputs.required.every( - required => testData[required] + required => testData[required] || required !== "row" ) function parseTestJSON(e) {