mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-30 18:15:11 +00:00
[ADF-4837] - Automation checkbox visibility e2e tests (#5010)
This commit is contained in:
parent
73601dfcfb
commit
8c159babe0
@ -21,7 +21,7 @@ import { browser } from 'protractor';
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { FormCloudDemoPage } from '../../pages/adf/demo-shell/process-services-cloud/cloudFormDemoPage';
|
||||
import { checkboxVisibilityForm } from '../../resources/forms/checkbox-visibility-condition';
|
||||
import { checkboxVisibilityForm, multipleCheckboxVisibilityForm } from '../../resources/forms/checkbox-visibility-condition';
|
||||
|
||||
describe('Visibility conditions - cloud', () => {
|
||||
|
||||
@ -31,6 +31,7 @@ describe('Visibility conditions - cloud', () => {
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const formCloudDemoPage = new FormCloudDemoPage();
|
||||
const checkboxVisibilityFormJson = JSON.parse(checkboxVisibilityForm);
|
||||
const multipleCheckboxVisibilityFormJson = JSON.parse(multipleCheckboxVisibilityForm);
|
||||
const widget = new Widget();
|
||||
|
||||
let visibleCheckbox;
|
||||
@ -51,7 +52,8 @@ describe('Visibility conditions - cloud', () => {
|
||||
checkboxFieldVariable: 'CheckboxFieldVariable',
|
||||
checkboxFieldField: 'CheckboxFieldField',
|
||||
checkboxVariableValue: 'CheckboxVariableValue',
|
||||
checkboxVariableVariable: 'CheckboxVariableVariable'
|
||||
checkboxVariableVariable: 'CheckboxVariableVariable',
|
||||
checkbox1: 'Checkbox1'
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
@ -160,4 +162,22 @@ describe('Visibility conditions - cloud', () => {
|
||||
visibleCheckbox.formRepresentation.formDefinition.variables[1].value = value.displayCheckbox;
|
||||
await formCloudDemoPage.setConfigToEditor(visibleCheckbox);
|
||||
});
|
||||
|
||||
it('[C312400] Should be able to see Checkbox widget when has visibility condition related to checkbox', async () => {
|
||||
await formCloudDemoPage.setConfigToEditor(multipleCheckboxVisibilityFormJson);
|
||||
|
||||
await widget.checkboxWidget().clickCheckboxInput('Checkbox2');
|
||||
await widget.checkboxWidget().clickCheckboxInput('Checkbox3');
|
||||
await widget.checkboxWidget().isCheckboxHidden(checkbox.checkbox1);
|
||||
|
||||
await widget.checkboxWidget().clickCheckboxInput('Checkbox2');
|
||||
await widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkbox1);
|
||||
|
||||
await widget.checkboxWidget().clickCheckboxInput('Checkbox2');
|
||||
await widget.checkboxWidget().clickCheckboxInput('Checkbox3');
|
||||
await widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkbox1);
|
||||
|
||||
await widget.checkboxWidget().clickCheckboxInput('Checkbox2');
|
||||
await widget.checkboxWidget().isCheckboxHidden(checkbox.checkbox1);
|
||||
});
|
||||
});
|
||||
|
@ -210,3 +210,77 @@ export const checkboxVisibilityForm = `{
|
||||
}
|
||||
}
|
||||
}`;
|
||||
|
||||
export const multipleCheckboxVisibilityForm = `{
|
||||
"formRepresentation": {
|
||||
"id": "form-589a5b5d-da10-4af7-a5be-7dad2482dc19",
|
||||
"name": "newtestform",
|
||||
"description": "",
|
||||
"version": 0,
|
||||
"standAlone": true,
|
||||
"formDefinition": {
|
||||
"tabs": [],
|
||||
"fields": [
|
||||
{
|
||||
"id": "438a9089-2641-498d-8e84-ffad51ea8379",
|
||||
"name": "Label",
|
||||
"type": "container",
|
||||
"tab": null,
|
||||
"numberOfColumns": 2,
|
||||
"fields": {
|
||||
"1": [
|
||||
{
|
||||
"id": "Checkbox1",
|
||||
"name": "Checkbox1",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"colspan": 1,
|
||||
"visibilityCondition": {
|
||||
"leftType": "field",
|
||||
"leftValue": "Checkbox2",
|
||||
"operator": "!=",
|
||||
"rightValue": "Checkbox3",
|
||||
"rightType": "field",
|
||||
"nextConditionOperator": "",
|
||||
"nextCondition": null
|
||||
},
|
||||
"params": {
|
||||
"existingColspan": 1,
|
||||
"maxColspan": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "Checkbox2",
|
||||
"name": "Checkbox2",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"colspan": 1,
|
||||
"visibilityCondition": null,
|
||||
"params": {
|
||||
"existingColspan": 1,
|
||||
"maxColspan": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "Checkbox3",
|
||||
"name": "Checkbox3",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"colspan": 1,
|
||||
"visibilityCondition": null,
|
||||
"params": {
|
||||
"existingColspan": 1,
|
||||
"maxColspan": 2
|
||||
}
|
||||
}
|
||||
],
|
||||
"2": []
|
||||
}
|
||||
}
|
||||
],
|
||||
"outcomes": [],
|
||||
"metadata": {},
|
||||
"variables": []
|
||||
}
|
||||
}
|
||||
}`;
|
||||
|
Loading…
x
Reference in New Issue
Block a user