From e9e3b99e280fc003941fe59bda1decc09d805a40 Mon Sep 17 00:00:00 2001 From: Carlos Camacho Date: Thu, 30 Nov 2023 23:40:26 -0400 Subject: [PATCH] add openAcordeon method and update tests --- tests/e2e/specs/Builder.spec.js | 1 + tests/e2e/specs/ComputedFields.spec.js | 2 ++ .../e2e/specs/ComputedFieldsReadOnly.spec.js | 1 + tests/e2e/specs/CustomCss.spec.js | 6 ++++++ tests/e2e/specs/DatePicker.spec.js | 1 + tests/e2e/specs/DatePickerTimezone.spec.js | 1 + tests/e2e/specs/DefaultValues.spec.js | 7 +++++++ .../specs/DeviceVisivilityInspector.spec.js | 19 +++++++++++++++++-- tests/e2e/specs/FileUpload.spec.js | 2 ++ tests/e2e/specs/FormImage.spec.js | 2 ++ tests/e2e/specs/FormInput.spec.js | 12 ++++++++++++ tests/e2e/specs/FormSelectList.spec.js | 1 + tests/e2e/specs/FormTextArea.spec.js | 11 +++++++++++ tests/e2e/specs/Loop.spec.js | 2 ++ tests/e2e/specs/MediaQuery.spec.js | 1 + tests/e2e/specs/MultiColumn.spec.js | 2 ++ .../specs/MultiInstanceLoopContext.spec.js | 1 + tests/e2e/specs/NestedScreen.spec.js | 1 + tests/e2e/specs/Pages.spec.js | 1 + tests/e2e/specs/Pagination.spec.js | 1 + tests/e2e/specs/ResponsivePreview.spec.js | 2 +- tests/e2e/specs/RichText.spec.js | 2 ++ tests/e2e/specs/ScreenWarnings.spec.js | 1 + .../SelectListDependentCollection.spec.js | 1 + tests/e2e/specs/UndoRedo.spec.js | 2 ++ tests/e2e/specs/VariableNames.js | 3 +++ tests/e2e/specs/VisibilityRule.spec.js | 3 +++ tests/e2e/specs/WrongConfigurationErrors.js | 4 +++- tests/e2e/support/commands.js | 15 +++++++++++++++ 29 files changed, 104 insertions(+), 4 deletions(-) diff --git a/tests/e2e/specs/Builder.spec.js b/tests/e2e/specs/Builder.spec.js index 4b9e2b59e..0e83722c3 100644 --- a/tests/e2e/specs/Builder.spec.js +++ b/tests/e2e/specs/Builder.spec.js @@ -1,6 +1,7 @@ describe('Screen Builder', () => { beforeEach(() => { cy.visit('/'); + cy.openAllAcordeon(); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); }); diff --git a/tests/e2e/specs/ComputedFields.spec.js b/tests/e2e/specs/ComputedFields.spec.js index 00edb7f94..3d3fb1217 100644 --- a/tests/e2e/specs/ComputedFields.spec.js +++ b/tests/e2e/specs/ComputedFields.spec.js @@ -88,6 +88,7 @@ describe('Computed fields', () => { }); it('Create a javascript computed field', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); // Add an input field cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); // Add a second input field @@ -118,6 +119,7 @@ describe('Computed fields', () => { it('Create a computed field with formula', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); // Add an input field cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); // Add a second input field diff --git a/tests/e2e/specs/ComputedFieldsReadOnly.spec.js b/tests/e2e/specs/ComputedFieldsReadOnly.spec.js index aee2e397c..cee1920a9 100644 --- a/tests/e2e/specs/ComputedFieldsReadOnly.spec.js +++ b/tests/e2e/specs/ComputedFieldsReadOnly.spec.js @@ -139,6 +139,7 @@ describe('Computed fields', () => { it.only('The user should not be able to change a FormDatePicker assigned to a computed property', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); // Add an input field cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); diff --git a/tests/e2e/specs/CustomCss.spec.js b/tests/e2e/specs/CustomCss.spec.js index 0b5b920ba..266c69c44 100644 --- a/tests/e2e/specs/CustomCss.spec.js +++ b/tests/e2e/specs/CustomCss.spec.js @@ -1,6 +1,7 @@ describe('Custom CSS', () => { it('Shows Modal', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -11,6 +12,7 @@ describe('Custom CSS', () => { it('Closes Modal', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -24,6 +26,7 @@ describe('Custom CSS', () => { it('Does Not Save Custom CSS', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -39,6 +42,7 @@ describe('Custom CSS', () => { it('Saves Custom CSS', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -55,6 +59,7 @@ describe('Custom CSS', () => { it('Does not add styling to element in design mode', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -70,6 +75,7 @@ describe('Custom CSS', () => { it('Adds styling to element in preview mode', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); diff --git a/tests/e2e/specs/DatePicker.spec.js b/tests/e2e/specs/DatePicker.spec.js index 97cbac028..fef38736f 100644 --- a/tests/e2e/specs/DatePicker.spec.js +++ b/tests/e2e/specs/DatePicker.spec.js @@ -5,6 +5,7 @@ moment.tz.setDefault('UTC'); describe('Date Picker', () => { beforeEach(() => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.window().then((win) => { win.ProcessMaker.user.timezone = 'UTC'; }); diff --git a/tests/e2e/specs/DatePickerTimezone.spec.js b/tests/e2e/specs/DatePickerTimezone.spec.js index 414d6ac56..53d3e5d10 100644 --- a/tests/e2e/specs/DatePickerTimezone.spec.js +++ b/tests/e2e/specs/DatePickerTimezone.spec.js @@ -6,6 +6,7 @@ moment.tz.setDefault(timezoneTest); describe("Date Picker", () => { beforeEach(() => { cy.visit("/"); + cy.openAcordeon("collapse-1"); cy.window().then((win) => { win.ProcessMaker.user.timezone = timezoneTest; }); diff --git a/tests/e2e/specs/DefaultValues.spec.js b/tests/e2e/specs/DefaultValues.spec.js index 6d4912eac..3fdfacea0 100644 --- a/tests/e2e/specs/DefaultValues.spec.js +++ b/tests/e2e/specs/DefaultValues.spec.js @@ -1,6 +1,7 @@ describe('Default values', () => { it('Basic default value', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -14,6 +15,7 @@ describe('Default values', () => { it('Text Input Default value if the variable has the next format "people.firstName"', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=inspector-name]').clear().type('people.firstName'); @@ -30,6 +32,7 @@ describe('Default values', () => { it('Select List- Default if the variable has the next format "numbers.int"', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormSelectList]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=inspector-name]').clear().type('number.int'); @@ -63,6 +66,7 @@ describe('Default values', () => { it('Javascript default value', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.setPreviewDataInput({name: 'world'}); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); @@ -78,6 +82,7 @@ describe('Default values', () => { }); it('Initially checked checkbox', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormCheckbox]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=inspector-initiallyChecked]').click(); @@ -89,6 +94,7 @@ describe('Default values', () => { }); it('Dynamic Basic default value', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); // Add an input field cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); // Add a second input field @@ -110,6 +116,7 @@ describe('Default values', () => { }); it('Dynamic Javascript default value', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); // Add an input field cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); // Add a second input field diff --git a/tests/e2e/specs/DeviceVisivilityInspector.spec.js b/tests/e2e/specs/DeviceVisivilityInspector.spec.js index 293adeb9a..8e5eb22f7 100644 --- a/tests/e2e/specs/DeviceVisivilityInspector.spec.js +++ b/tests/e2e/specs/DeviceVisivilityInspector.spec.js @@ -11,6 +11,7 @@ import {nodeControls} from '../support/constants.js' describe('Device Visiblility Inspector', () => { it('Verify if an input has device visiblility settings', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -24,6 +25,7 @@ describe('Device Visiblility Inspector', () => { }); it('Verify if a checkbox has device visiblility settings', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormCheckbox]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -37,6 +39,7 @@ describe('Device Visiblility Inspector', () => { }); it('Verify if a datePicker has device visiblility settings', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -50,6 +53,7 @@ describe('Device Visiblility Inspector', () => { }); it('Verify if a FileDownload has device visiblility settings', () => { cy.visit('/'); + cy.openAcordeon("collapse-4"); cy.get('[data-cy=controls-FileDownload]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -63,6 +67,7 @@ describe('Device Visiblility Inspector', () => { }); it('Verify if a FileUpload has device visiblility settings', () => { cy.visit('/'); + cy.openAcordeon("collapse-4"); cy.get('[data-cy=controls-FileUpload]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -76,6 +81,7 @@ describe('Device Visiblility Inspector', () => { }); it('Verify if a FormImage has device visiblility settings', () => { cy.visit('/'); + cy.openAcordeon("collapse-2"); cy.get('[data-cy=controls-FormImage]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -89,6 +95,7 @@ describe('Device Visiblility Inspector', () => { }); it('Verify if a FormLoop has device visiblility settings', () => { cy.visit('/'); + cy.openAcordeon("collapse-2"); cy.get('[data-cy=controls-FormLoop]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -102,6 +109,7 @@ describe('Device Visiblility Inspector', () => { }); it('Verify if a FormMultiColumn has device visiblility settings', () => { cy.visit('/'); + cy.openAcordeon("collapse-2"); cy.get('[data-cy=controls-FormMultiColumn]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -115,6 +123,7 @@ describe('Device Visiblility Inspector', () => { }); it('Verify if a FormNestedScreen has device visiblility settings', () => { cy.visit('/'); + cy.openAcordeon("collapse-2"); cy.get('[data-cy=controls-FormNestedScreen]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -128,6 +137,7 @@ describe('Device Visiblility Inspector', () => { }); it('Verify if a FormButton has device visiblility settings', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormButton]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -141,6 +151,7 @@ describe('Device Visiblility Inspector', () => { }); it('Verify if a FormRecordList has device visiblility settings', () => { cy.visit('/'); + cy.openAcordeon("collapse-2"); cy.get('[data-cy=controls-FormRecordList]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -154,6 +165,7 @@ describe('Device Visiblility Inspector', () => { }); it('Verify if a FormHtmlViewer has device visiblility settings', () => { cy.visit('/'); + cy.openAcordeon("collapse-2"); cy.get('[data-cy=controls-FormHtmlViewer]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -167,6 +179,7 @@ describe('Device Visiblility Inspector', () => { }); it('Verify if a FormSelectList has device visiblility settings', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormSelectList]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -180,6 +193,7 @@ describe('Device Visiblility Inspector', () => { }); it('Verify if a FormTextArea has device visiblility settings', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -193,6 +207,7 @@ describe('Device Visiblility Inspector', () => { }); it('Enabled device visiblility', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -313,6 +328,7 @@ describe('Device Visiblility Inspector', () => { it('Verify Device Visibility of controls inside a table', () => { cy.visit('/'); + cy.openAcordeon("collapse-2"); //Step 1: Add Loop addControl('Multicolumn / Table'); @@ -340,7 +356,7 @@ describe('Device Visiblility Inspector', () => { it('Verify Device Visibility of controls inside a table mobile', () => { cy.visit('/'); - + cy.openAcordeon("collapse-2"); //Step 1: Add Table addControl('Multicolumn / Table'); @@ -368,7 +384,6 @@ describe('Device Visiblility Inspector', () => { it('Verify Device Visibility of a control and Visibility Rule', () => { cy.visit("/"); - //Step 1: Add line input control addControl('Line Input'); diff --git a/tests/e2e/specs/FileUpload.spec.js b/tests/e2e/specs/FileUpload.spec.js index 0c16b396c..b8d878e59 100644 --- a/tests/e2e/specs/FileUpload.spec.js +++ b/tests/e2e/specs/FileUpload.spec.js @@ -1,6 +1,8 @@ describe('File Upload', () => { it('Automatically sets a variable name', () => { cy.visit('/'); + cy.openAcordeon("collapse-4"); + //cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FileUpload]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); diff --git a/tests/e2e/specs/FormImage.spec.js b/tests/e2e/specs/FormImage.spec.js index 3f5440a83..01a215e0c 100644 --- a/tests/e2e/specs/FormImage.spec.js +++ b/tests/e2e/specs/FormImage.spec.js @@ -1,6 +1,7 @@ describe('Form Image', () => { it('Upload image to show', () => { cy.visit('/'); + cy.openAcordeon("collapse-2"); cy.get('[data-cy=controls-FormImage]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.uploadFile('[data-cy=inspector-image] input[type=file]', 'avatar.jpeg', 'image/jpeg'); @@ -15,6 +16,7 @@ describe('Form Image', () => { it('Image by variable', () => { cy.visit('/'); + cy.openAcordeon("collapse-2"); cy.get('[data-cy=controls-FormImage]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=inspector-renderImage]').click(); diff --git a/tests/e2e/specs/FormInput.spec.js b/tests/e2e/specs/FormInput.spec.js index a5d7b045d..910986d4d 100644 --- a/tests/e2e/specs/FormInput.spec.js +++ b/tests/e2e/specs/FormInput.spec.js @@ -1,6 +1,7 @@ describe('Form Input', () => { it('Default properties', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=mode-preview]').click(); @@ -11,6 +12,7 @@ describe('Form Input', () => { }); it('Variable properties', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=inspector-name]').clear().type('firstname'); @@ -24,6 +26,7 @@ describe('Form Input', () => { }); it('Data type Integer', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Integer'); @@ -35,6 +38,7 @@ describe('Form Input', () => { }); it('Data type Currency', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Currency'); @@ -47,6 +51,7 @@ describe('Form Input', () => { }); it('Data type Currency with initial data', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.setPreviewDataInput('{"form_input_1":1234}'); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); @@ -59,6 +64,7 @@ describe('Form Input', () => { }); it('Data type Currency when backspacing a decimal digit', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Currency'); @@ -73,6 +79,7 @@ describe('Form Input', () => { }); it('Validation rule', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=inspector-readonly]').click(); @@ -81,6 +88,7 @@ describe('Form Input', () => { }); it('Placeholder', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Configuration]').click(); @@ -90,6 +98,7 @@ describe('Form Input', () => { }); it('Data type Percentage', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Percentage'); @@ -102,6 +111,7 @@ describe('Form Input', () => { }); it('Data type Datetime', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Datetime'); @@ -114,6 +124,7 @@ describe('Form Input', () => { }); it('Data type Date', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Date', 1); @@ -126,6 +137,7 @@ describe('Form Input', () => { }); it('Data type password', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.setMultiselect('[data-cy=inspector-dataFormat]', 'Password'); diff --git a/tests/e2e/specs/FormSelectList.spec.js b/tests/e2e/specs/FormSelectList.spec.js index dc45a03e9..706683f81 100644 --- a/tests/e2e/specs/FormSelectList.spec.js +++ b/tests/e2e/specs/FormSelectList.spec.js @@ -1,6 +1,7 @@ describe('Form Select List', () => { beforeEach(() => { cy.visit('/'); + cy.openAcordeon("collapse-1"); // Add loop control cy.get('[data-cy=controls-FormSelectList]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); diff --git a/tests/e2e/specs/FormTextArea.spec.js b/tests/e2e/specs/FormTextArea.spec.js index 576297cbb..5fcb88845 100644 --- a/tests/e2e/specs/FormTextArea.spec.js +++ b/tests/e2e/specs/FormTextArea.spec.js @@ -1,6 +1,7 @@ describe('Form Text Area Field', () => { it('Default properties', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=mode-preview]').click(); @@ -11,6 +12,7 @@ describe('Form Text Area Field', () => { }); it('Variable properties', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=inspector-name]').clear().type('comments'); @@ -24,6 +26,7 @@ describe('Form Text Area Field', () => { }); it('Read Only', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=inspector-name]').clear().type('comments'); @@ -37,6 +40,7 @@ describe('Form Text Area Field', () => { //Configuration it('Placeholder', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Configuration]').click(); @@ -46,6 +50,7 @@ describe('Form Text Area Field', () => { }); it('Helper Text', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Configuration]').click(); @@ -55,6 +60,7 @@ describe('Form Text Area Field', () => { }); it('Rich Text', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Configuration]').click(); @@ -67,6 +73,7 @@ describe('Form Text Area Field', () => { }); it('Rows', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Configuration]').click(); @@ -76,6 +83,7 @@ describe('Form Text Area Field', () => { }); it('Default Value', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -87,6 +95,7 @@ describe('Form Text Area Field', () => { }); it('CSS Selector Name', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -96,6 +105,7 @@ describe('Form Text Area Field', () => { }); it('Aria Label', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -105,6 +115,7 @@ describe('Form Text Area Field', () => { }); it('Tab Order', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormTextArea]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); diff --git a/tests/e2e/specs/Loop.spec.js b/tests/e2e/specs/Loop.spec.js index c577a2b18..27e540040 100644 --- a/tests/e2e/specs/Loop.spec.js +++ b/tests/e2e/specs/Loop.spec.js @@ -1,6 +1,7 @@ describe('Loop control', () => { it('Input inside loop', () => { cy.visit('/'); + cy.openAcordeon("collapse-2"); // Add loop control cy.get('[data-cy=controls-FormLoop]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); @@ -56,6 +57,7 @@ describe('Loop control', () => { it('Verify validation on visible fields', () => { cy.visit('/'); + cy.openAcordeon("collapse-2"); // Add loop control cy.get('[data-cy=controls-FormLoop]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); diff --git a/tests/e2e/specs/MediaQuery.spec.js b/tests/e2e/specs/MediaQuery.spec.js index fa9a4e7e6..2fd1a60be 100644 --- a/tests/e2e/specs/MediaQuery.spec.js +++ b/tests/e2e/specs/MediaQuery.spec.js @@ -9,6 +9,7 @@ describe('Media Query CSS', () => { before(() => { // run these tests as if in a desktop cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); diff --git a/tests/e2e/specs/MultiColumn.spec.js b/tests/e2e/specs/MultiColumn.spec.js index e81070cae..0496e2850 100644 --- a/tests/e2e/specs/MultiColumn.spec.js +++ b/tests/e2e/specs/MultiColumn.spec.js @@ -2,6 +2,7 @@ describe('MultiColumns', () => { it('Configure using JSON', () => { cy.visit('/'); + cy.openAcordeon("collapse-2"); cy.get('[data-cy=controls-FormMultiColumn]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-element-container] .column-draggable:empty'); @@ -30,6 +31,7 @@ describe('MultiColumns', () => { it('Configure using columns configuration', () => { cy.visit('/'); + cy.openAcordeon("collapse-2"); cy.get('[data-cy=controls-FormMultiColumn]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); diff --git a/tests/e2e/specs/MultiInstanceLoopContext.spec.js b/tests/e2e/specs/MultiInstanceLoopContext.spec.js index 5d92d0948..18894843e 100644 --- a/tests/e2e/specs/MultiInstanceLoopContext.spec.js +++ b/tests/e2e/specs/MultiInstanceLoopContext.spec.js @@ -65,6 +65,7 @@ describe("FOUR-3375 FileUpload inside MultiInstance Task", () => { fileUploadId: 1 }) ).as("uploadMainFile"); + cy.openAcordeon("collapse-4"); cy.uploadFile( "[data-cy='screen-field-rootUpload'] input[type=file]", "avatar.jpeg", diff --git a/tests/e2e/specs/NestedScreen.spec.js b/tests/e2e/specs/NestedScreen.spec.js index af22ff80b..acbc3e1d4 100644 --- a/tests/e2e/specs/NestedScreen.spec.js +++ b/tests/e2e/specs/NestedScreen.spec.js @@ -78,6 +78,7 @@ describe('Nested screen', () => { it('Without a variable defined', () => { cy.visit('/'); + cy.openAcordeon("collapse-2"); cy.get('[data-cy=controls-FormNestedScreen]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=inspector-screen] div.multiselect').click(); diff --git a/tests/e2e/specs/Pages.spec.js b/tests/e2e/specs/Pages.spec.js index 53c3b1cb8..8be102dc8 100644 --- a/tests/e2e/specs/Pages.spec.js +++ b/tests/e2e/specs/Pages.spec.js @@ -1,6 +1,7 @@ describe('Pages and navigations', () => { it('Basic default value', () => { cy.visit('/'); + cy.openAllAcordeon(); cy.get('[data-cy=toolbar-add]').click(); // Define Page 2 cy.get('[data-cy=add-page-name]').clear().type('Page 2'); diff --git a/tests/e2e/specs/Pagination.spec.js b/tests/e2e/specs/Pagination.spec.js index 2b103be2a..d7e892535 100644 --- a/tests/e2e/specs/Pagination.spec.js +++ b/tests/e2e/specs/Pagination.spec.js @@ -56,6 +56,7 @@ const data = { beforeEach(() => { cy.visit('/'); + cy.openAcordeon("collapse-2"); cy.get('[data-cy=controls-FormRecordList]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=toolbar-add]').click({force: true}); cy.get('[data-cy=add-page-name]').type('page2'); diff --git a/tests/e2e/specs/ResponsivePreview.spec.js b/tests/e2e/specs/ResponsivePreview.spec.js index bc2c12cb3..8552f4c66 100644 --- a/tests/e2e/specs/ResponsivePreview.spec.js +++ b/tests/e2e/specs/ResponsivePreview.spec.js @@ -10,7 +10,7 @@ describe('Responsive Preview test', () => { beforeEach(() => { cy.visit('/'); - + cy.openAcordeon("collapse-1"); cy.get(controlInputSelector).drag(screenDropZoneSelector, 'bottom'); cy.get('[data-cy=controls-FormSelectList]').drag(screenContainerSelector, 'bottom'); }); diff --git a/tests/e2e/specs/RichText.spec.js b/tests/e2e/specs/RichText.spec.js index dd048a915..01e20225a 100644 --- a/tests/e2e/specs/RichText.spec.js +++ b/tests/e2e/specs/RichText.spec.js @@ -1,6 +1,7 @@ describe('Rich Text control', () => { it('Rich text with mustache', () => { cy.visit('/'); + cy.openAcordeon("collapse-2"); cy.get('[data-cy=controls-FormHtmlViewer]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=inspector-content]').focus().clear().type('

Hello {{ name }}

', {parseSpecialCharSequences: false}); @@ -11,6 +12,7 @@ describe('Rich Text control', () => { it('Rich text render HTML from a Variable', () => { cy.visit('/'); + cy.openAcordeon("collapse-2"); cy.get('[data-cy=controls-FormHtmlViewer]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=inspector-content]').focus().clear().type('{{ name }}', {parseSpecialCharSequences: false}); diff --git a/tests/e2e/specs/ScreenWarnings.spec.js b/tests/e2e/specs/ScreenWarnings.spec.js index bb1a9edf7..851692b69 100644 --- a/tests/e2e/specs/ScreenWarnings.spec.js +++ b/tests/e2e/specs/ScreenWarnings.spec.js @@ -13,6 +13,7 @@ describe('Screen Warnings', () => { }); it('Use script warning', () => { + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy="topbar-watchers"]').click(); cy.get('[data-cy="watchers-add-watcher"]').click(); diff --git a/tests/e2e/specs/SelectListDependentCollection.spec.js b/tests/e2e/specs/SelectListDependentCollection.spec.js index b1848c445..0fb19e3a3 100644 --- a/tests/e2e/specs/SelectListDependentCollection.spec.js +++ b/tests/e2e/specs/SelectListDependentCollection.spec.js @@ -76,6 +76,7 @@ describe('select list dependent collection', () => { }); it('Configure collection select list', () => { + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormSelectList]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-DataSource]').click(); diff --git a/tests/e2e/specs/UndoRedo.spec.js b/tests/e2e/specs/UndoRedo.spec.js index 5b36a4bd1..2b456ebbd 100644 --- a/tests/e2e/specs/UndoRedo.spec.js +++ b/tests/e2e/specs/UndoRedo.spec.js @@ -1,6 +1,7 @@ describe('Undo and Redo', () => { it('Can Undo', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=toolbar-undo]').click(); cy.get('[data-cy=screen-drop-zone]').should('contain.text', 'Place your controls here.'); @@ -8,6 +9,7 @@ describe('Undo and Redo', () => { it('Can Redo', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=toolbar-undo]').click(); cy.get('[data-cy=toolbar-redo]').click(); diff --git a/tests/e2e/specs/VariableNames.js b/tests/e2e/specs/VariableNames.js index c0ecb12f2..3ade38388 100644 --- a/tests/e2e/specs/VariableNames.js +++ b/tests/e2e/specs/VariableNames.js @@ -1,6 +1,7 @@ describe('Default values', () => { it('Variable names with dots 2 levels', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=inspector-name]').clear().type('user.address'); @@ -13,6 +14,7 @@ describe('Default values', () => { }); it('Variable names with dots 3 levels', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=inspector-name]').clear().type('user.address.city'); @@ -28,6 +30,7 @@ describe('Default values', () => { }); it('Variable names with dots and one attribute same as the name', () => { cy.visit('/'); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=inspector-name]').clear().type('address.address.city'); diff --git a/tests/e2e/specs/VisibilityRule.spec.js b/tests/e2e/specs/VisibilityRule.spec.js index 2f1ae2add..f3e8ab92a 100644 --- a/tests/e2e/specs/VisibilityRule.spec.js +++ b/tests/e2e/specs/VisibilityRule.spec.js @@ -2,6 +2,7 @@ describe('Default values', () => { it('Check visible', () => { cy.visit('/'); cy.setPreviewDataInput({name: 'world'}); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -12,6 +13,7 @@ describe('Default values', () => { it('Check hidden', () => { cy.visit('/'); cy.setPreviewDataInput({name: ''}); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); cy.get('[data-cy=screen-element-container]').click(); cy.get('[data-cy=accordion-Advanced]').click(); @@ -22,6 +24,7 @@ describe('Default values', () => { it('Check dynamic visibility rule', () => { cy.visit('/'); cy.setPreviewDataInput({name: ''}); + cy.openAcordeon("collapse-1"); cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-drop-zone]', 'bottom'); // Add a second input field cy.get('[data-cy=controls-FormInput]').drag('[data-cy=screen-element-container]', 'bottom'); diff --git a/tests/e2e/specs/WrongConfigurationErrors.js b/tests/e2e/specs/WrongConfigurationErrors.js index 0edfe7257..b053664ff 100644 --- a/tests/e2e/specs/WrongConfigurationErrors.js +++ b/tests/e2e/specs/WrongConfigurationErrors.js @@ -6,6 +6,7 @@ describe("Wrong Configuration Errors", () => { cy.stub(win.console, "error").as("consoleError"); } }); + cy.openAcordeon("collapse-1"); cy.get("[data-cy=controls-FormInput]").drag( "[data-cy=screen-drop-zone]", "bottom" @@ -20,13 +21,14 @@ describe("Wrong Configuration Errors", () => { ); }); - it("Screen with rendering problem in a component should not show a warning after the problematic component is deleted", () => { + it.only("Screen with rendering problem in a component should not show a warning after the problematic component is deleted", () => { cy.visit("/", { onBeforeLoad(win) { cy.stub(win.console, "warn").as("consoleWarn"); cy.stub(win.console, "error").as("consoleError"); } }); + cy.openAcordeon("collapse-1"); cy.get("[data-cy=controls-FormInput]").drag( "[data-cy=screen-drop-zone]", "bottom" diff --git a/tests/e2e/support/commands.js b/tests/e2e/support/commands.js index f8d6c49e7..4d9ee78f6 100644 --- a/tests/e2e/support/commands.js +++ b/tests/e2e/support/commands.js @@ -223,3 +223,18 @@ Cypress.Commands.add('showValidationOnLoad', () => { win.vueInstance.$children[0].$refs.renderer.showValidationOnLoad(true); }); }) + +Cypress.Commands.add("openAcordeon", (name) => { + cy.get(`button[aria-controls='${name}']`).should("be.visible"); + cy.get(`div[id='${name}']`).invoke("attr", "style").should("eq", "display: none;"); + cy.get(`button[aria-controls='${name}']`).click(); + cy.get(`div[id='${name}']`).invoke("attr", "style").should("not.equal", "display: none;"); +}); + +Cypress.Commands.add("openAllAcordeon", () => { + cy.openAcordeon("collapse-5"); + cy.openAcordeon("collapse-4"); + cy.openAcordeon("collapse-3"); + cy.openAcordeon("collapse-2"); + cy.openAcordeon("collapse-1"); +});