mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
@@ -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);
|
||||
|
36
lib/testing/src/lib/core/pages/form/widgets/tab.ts
Normal file
36
lib/testing/src/lib/core/pages/form/widgets/tab.ts
Normal 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)));
|
||||
}
|
||||
}
|
@@ -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);
|
||||
}
|
||||
|
@@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user