[ADF-3723]Add visibility conditions on tabs - form rendering component tests (#5022)

* Add visibility conditions on tabs - form rendering component tests

* no message

* Moved the suite to process-services-cloud folder

* no message
This commit is contained in:
cristinaj
2019-08-30 14:16:28 +03:00
committed by Denys Vuika
parent 505e8204e2
commit 31bec59a16
6 changed files with 938 additions and 0 deletions

View File

@@ -44,6 +44,11 @@ export class FormFields {
await BrowserVisibility.waitUntilElementIsVisible(fieldElement);
}
async checkWidgetIsClickable(fieldId): Promise<void> {
const fieldElement = element.all(by.css(`adf-form-field div[id='field-${fieldId}-container']`)).first();
await BrowserVisibility.waitUntilElementIsClickable(fieldElement);
}
async checkWidgetIsHidden(fieldId): Promise<void> {
const hiddenElement = element(by.css(`adf-form-field div[id='field-${fieldId}-container'][hidden]`));
await BrowserVisibility.waitUntilElementIsNotVisible(hiddenElement);

View File

@@ -0,0 +1,36 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { by, element, browser } from 'protractor';
import { BrowserActions, BrowserVisibility } from '../../../utils/public-api';
export class Tab {
async clickTabByLabel(tabLabel): Promise<void> {
const user = element(by.cssContainingText('.mat-tab-label-content', tabLabel));
await BrowserActions.click(user);
await browser.sleep(300);
}
async checkTabIsDisplayedByLabel(tabLabel): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText('.mat-tab-label-content', tabLabel)));
}
async checkTabIsNotDisplayedByLabel(tabLabel): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.cssContainingText('.mat-tab-label-content', tabLabel)));
}
}

View File

@@ -48,6 +48,10 @@ export class TextWidget {
await this.formFields.checkWidgetIsVisible(fieldId);
}
async isWidgetClickable(fieldId): Promise<void> {
await this.formFields.checkWidgetIsClickable(fieldId);
}
async isWidgetNotVisible(fieldId): Promise<void> {
await this.formFields.checkWidgetIsHidden(fieldId);
}

View File

@@ -32,6 +32,7 @@ import { NumberWidget } from './numberWidget';
import { AmountWidget } from './amountWidget';
import { ContainerWidget } from './containerWidget';
import { PeopleWidget } from './peopleWidget';
import { Tab } from './tab';
import { DocumentWidget } from './documentWidget';
import { AttachFileWidgetCloud } from './attachFileWidgetCloud';
@@ -112,4 +113,8 @@ export class Widget {
peopleWidget(): PeopleWidget {
return new PeopleWidget();
}
tab(): Tab {
return new Tab();
}
}