From 1631aa698bfcef5cb0af6dbdd425609018bf5bf8 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 25 May 2021 16:52:35 +0100 Subject: [PATCH] Updating binding tests. --- .../cypress/integration/createBinding.spec.js | 6 ++++-- packages/builder/cypress/support/commands.js | 12 +++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/builder/cypress/integration/createBinding.spec.js b/packages/builder/cypress/integration/createBinding.spec.js index b32584924d..571c6d6326 100644 --- a/packages/builder/cypress/integration/createBinding.spec.js +++ b/packages/builder/cypress/integration/createBinding.spec.js @@ -36,7 +36,9 @@ context("Create Bindings", () => { it("should add a binding with a handlebars helper", () => { cy.addComponent("Elements", "Paragraph").then(componentId => { // Cypress needs to escape curly brackets - addSettingBinding("text", "{{}{{} add 1 2 {}}{}}", false) + cy.get("[data-cy=setting-text] input") + .type("{{}{{} add 1 2 {}}{}}") + .blur() cy.getComponent(componentId).should("have.text", "3") }) }) @@ -51,6 +53,6 @@ const addSettingBinding = (setting, bindingText, clickOption = true) => { } else { cy.get("textarea").type(bindingText) } - cy.get("button").click() + cy.contains("Save").click() }) } diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 46b9349220..7790d5dfd0 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -150,17 +150,15 @@ Cypress.Commands.add("getComponent", componentId => { }) Cypress.Commands.add("navigateToFrontend", () => { - cy.contains("design").click() + cy.contains("Design").click() }) Cypress.Commands.add("createScreen", (screenName, route) => { - cy.get("[data-cy=new-screen]").click() + cy.get("[aria-label=AddCircle]").click() cy.get(".spectrum-Modal").within(() => { - cy.get("input").eq(0).type(screenName).blur() - if (route) { - cy.get("input").eq(1).type(route).blur() - } - cy.contains("Create Screen").click() + cy.get("input").first().type(screenName) + cy.get("input").eq(1).type(route) + cy.get(".spectrum-Button--cta").click() }) cy.get(".nav-items-container").within(() => { cy.contains(route).should("exist")