mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
* [ADF-3597] Create automated test to cover Error Log on Form component * Removing double quotes * Removing console log * Changing capital letter * Creating pages for each widget * Minor changes on spaces and namings * fix rebase
47 lines
1.6 KiB
TypeScript
47 lines
1.6 KiB
TypeScript
/*!
|
|
* @license
|
|
* Copyright 2016 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 { element, by, protractor } from 'protractor';
|
|
import Util = require('../../../../util/util');
|
|
|
|
export class NumberWidget {
|
|
|
|
numberWidgetLabel4 = element(by.id('field-label4-container'));
|
|
numberWidgetInput = element(by.css('div[id="field-label4-container"] input[id="label4"]'));
|
|
|
|
checkLabel4IsDisplayed() {
|
|
return Util.waitUntilElementIsVisible(this.numberWidgetLabel4);
|
|
}
|
|
|
|
addIntoNumberWidget(input) {
|
|
Util.waitUntilElementIsVisible(this.numberWidgetLabel4);
|
|
this.numberWidgetInput.click();
|
|
this.numberWidgetInput.sendKeys(input);
|
|
return this.numberWidgetInput.sendKeys(protractor.Key.ENTER);
|
|
}
|
|
|
|
removeFromNumberWidget() {
|
|
Util.waitUntilElementIsVisible(this.numberWidgetLabel4);
|
|
|
|
this.numberWidgetInput.getAttribute('value').then((result) => {
|
|
for (let i = result.length; i >= 0; i--) {
|
|
this.numberWidgetInput.sendKeys(protractor.Key.BACK_SPACE);
|
|
}
|
|
});
|
|
}
|
|
}
|