From 7b687df638d2d8ab6d79ea341b63229a0a23ed5a Mon Sep 17 00:00:00 2001 From: MihailHadzhiev2022 Date: Tue, 31 May 2022 17:01:11 +0300 Subject: [PATCH] Small fixes --- .../integration/addMultiOptionDatatype.spec.js | 2 +- .../cypress/integration/createComponents.spec.js | 12 ++++++------ packages/builder/cypress/support/interact.js | 9 +++++---- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js b/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js index 3e0ba92ba4..38ae881db8 100644 --- a/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js +++ b/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js @@ -41,7 +41,7 @@ filterTests(['all'], () => { } // Check items have been selected cy.getComponent(componentId) - .find(interact.SPECTRUM_Picker_LABEL) + .find(interact.SPECTRUM_PICKER_LABEL) .contains("(5)") }) }) diff --git a/packages/builder/cypress/integration/createComponents.spec.js b/packages/builder/cypress/integration/createComponents.spec.js index d44991f085..43a76c700e 100644 --- a/packages/builder/cypress/integration/createComponents.spec.js +++ b/packages/builder/cypress/integration/createComponents.spec.js @@ -32,7 +32,7 @@ filterTests(['all'], () => { it("should change the text of the headline", () => { const text = "Lorem ipsum dolor sit amet." - cy.get(interact.DATA_CY_SETTINGS).click() + cy.get(interact.SETTINGS).click() cy.get(interact.SETTINGS_INPUT) .type(text) .blur() @@ -40,16 +40,16 @@ filterTests(['all'], () => { }) it("should change the size of the headline", () => { - cy.get(interact.DATA_CY_DESIGN).click() + cy.get(interact.DESIGN).click() cy.contains("Typography").click() - cy.get(interact.DATA_CY_FSPCONTROL).click() + cy.get(interact.FONT_SIZE_PROP_CONTROL).click() cy.contains("60px").click() cy.getComponent(headlineId).should("have.css", "font-size", "60px") }) it("should create a form and reset to match schema", () => { cy.addComponent("Form", "Form").then(() => { - cy.get(interact.DATA_CY_SETTINGS).click() + cy.get(interact.SETTINGS).click() cy.get(interact.DATA_CY_DATASOURCE) .contains("Choose option") .click() @@ -57,7 +57,7 @@ filterTests(['all'], () => { .contains("dog") .click() cy.addComponent("Form", "Field Group").then(fieldGroupId => { - cy.get(interact.DATA_CY_SETTINGS).click() + cy.get(interact.SETTINGS).click() cy.contains("Update Form Fields").click() cy.get(".modal") .get("button.primary") @@ -71,7 +71,7 @@ filterTests(['all'], () => { .find("input") .should("have.length", 2) cy.getComponent(fieldGroupId) - .find(".spectrum-Picker") + .find(interact.SPECTRUM_PICKER) .should("have.length", 1) }) }) diff --git a/packages/builder/cypress/support/interact.js b/packages/builder/cypress/support/interact.js index 082ce3eca9..3ed4da2244 100644 --- a/packages/builder/cypress/support/interact.js +++ b/packages/builder/cypress/support/interact.js @@ -17,7 +17,7 @@ export const CATEGORY_DATA = '[data-cy="category-Data"]' export const COMPONENT_DATA_PROVIDER = '[data-cy="component-Data Provider"]' export const DATASOURCE_PROP_CONTROL = '[data-cy="dataSource-prop-control"]' export const DROPDOWN = ".dropdown" -export const SPECTRUM_Picker_LABEL = ".spectrum-Picker-label" +export const SPECTRUM_PICKER_LABEL = ".spectrum-Picker-label" export const DATASOURCE_FIELD_CONTROL = '[data-cy="field-prop-control"]' export const OPTION_TYPE_PROP_CONTROL = '[data-cy="optionsType-prop-control' @@ -36,9 +36,10 @@ export const SPECTRUM_BUTTON = ".spectrum-Button" export const TOPRIGHTNAV_BUTTON_SPECTRUM = ".toprightnav button.spectrum-Button" //createComponents -export const DATA_CY_SETTINGS = "[data-cy=Settings]" +export const SETTINGS = "[data-cy=Settings]" export const SETTINGS_INPUT = "[data-cy=setting-text] input" -export const DATA_CY_DESIGN = "[data-cy=Design]" -export const DATA_CY_FSPCONTROL = "[data-cy=font-size-prop-control]" +export const DESIGN = "[data-cy=Design]" +export const FONT_SIZE_PROP_CONTRO = "[data-cy=font-size-prop-control]" export const DATA_CY_DATASOURCE = "[data-cy=setting-dataSource]" export const DROPDOWN_CONTAINER = ".dropdown-container" +export const SPECTRUM_PICKER = ".spectrum-Picker"