Skip to content

Commit

Permalink
Merge pull request #1490 from ProcessMaker/fix_openAcordeon
Browse files Browse the repository at this point in the history
add openAcordeon method and update tests
  • Loading branch information
pmoskrojas authored Dec 5, 2023
2 parents d0acd54 + e9e3b99 commit 7e30f16
Show file tree
Hide file tree
Showing 29 changed files with 104 additions and 4 deletions.
1 change: 1 addition & 0 deletions tests/e2e/specs/Builder.spec.js
Original file line number Diff line number Diff line change
@@ -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();
});
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/specs/ComputedFields.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/specs/ComputedFieldsReadOnly.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/specs/CustomCss.spec.js
Original file line number Diff line number Diff line change
@@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/specs/DatePicker.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
});
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/specs/DatePickerTimezone.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down
7 changes: 7 additions & 0 deletions tests/e2e/specs/DefaultValues.spec.js
Original file line number Diff line number Diff line change
@@ -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();
Expand All @@ -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');
Expand All @@ -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');
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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
Expand All @@ -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
Expand Down
19 changes: 17 additions & 2 deletions tests/e2e/specs/DeviceVisivilityInspector.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand Down Expand Up @@ -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');

Expand Down Expand Up @@ -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');

Expand Down Expand Up @@ -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');

Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/specs/FileUpload.spec.js
Original file line number Diff line number Diff line change
@@ -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();

Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/specs/FormImage.spec.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7e30f16

Please sign in to comment.