mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
enable prefer-const rule for tslint, fix issues (#4409)
* enable prefer-const rule for tslint, fix issues * Update content-node-selector.component.spec.ts * Update content-node-selector.component.spec.ts * fix const * fix lint issues * update tests * update tests * update tests * fix code * fix page class
This commit is contained in:
committed by
Eugenio Romano
parent
26c5982a1a
commit
a7a48e8b2b
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { browser, protractor } from 'protractor';
|
||||
let until = protractor.ExpectedConditions;
|
||||
const until = protractor.ExpectedConditions;
|
||||
|
||||
const DEFAULT_TIMEOUT = 40000;
|
||||
|
||||
|
@@ -49,18 +49,18 @@ export class HeaderPage {
|
||||
}
|
||||
|
||||
clickShowMenuButton() {
|
||||
let checkBox = element.all(by.css('mat-checkbox'));
|
||||
const checkBox = element.all(by.css('mat-checkbox'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(checkBox);
|
||||
return checkBox.get(0).click();
|
||||
}
|
||||
|
||||
changeHeaderColor(color) {
|
||||
let headerColor = element(by.css('option[value="' + color + '"]'));
|
||||
const headerColor = element(by.css('option[value="' + color + '"]'));
|
||||
return headerColor.click();
|
||||
}
|
||||
|
||||
checkAppTitle(name) {
|
||||
let title = element(by.cssContainingText('.adf-app-title', name));
|
||||
const title = element(by.cssContainingText('.adf-app-title', name));
|
||||
return BrowserVisibility.waitUntilElementIsVisible(title);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ export class HeaderPage {
|
||||
}
|
||||
|
||||
checkIconIsDisplayed(url) {
|
||||
let icon = element(by.css('img[src="' + url + '"]'));
|
||||
const icon = element(by.css('img[src="' + url + '"]'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(icon);
|
||||
}
|
||||
|
||||
|
@@ -55,19 +55,19 @@ export class UserInfoPage {
|
||||
}
|
||||
|
||||
clickOnContentServicesTab() {
|
||||
let tabsPage = new TabsPage();
|
||||
const tabsPage = new TabsPage();
|
||||
tabsPage.clickTabByTitle('Content Services');
|
||||
return this;
|
||||
}
|
||||
|
||||
checkProcessServicesTabIsSelected() {
|
||||
let tabsPage = new TabsPage;
|
||||
const tabsPage = new TabsPage;
|
||||
tabsPage.checkTabIsSelectedByTitle('Process Services');
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnProcessServicesTab() {
|
||||
let tabsPage = new TabsPage;
|
||||
const tabsPage = new TabsPage;
|
||||
tabsPage.clickTabByTitle('Process Services');
|
||||
return this;
|
||||
}
|
||||
|
@@ -21,13 +21,13 @@ import { BrowserVisibility } from '../core/browser-visibility';
|
||||
export class TabsPage {
|
||||
|
||||
clickTabByTitle(tabTitle) {
|
||||
let tab = element(by.cssContainingText("div[id*='mat-tab-label']", tabTitle));
|
||||
const tab = element(by.cssContainingText("div[id*='mat-tab-label']", tabTitle));
|
||||
BrowserVisibility.waitUntilElementIsVisible(tab);
|
||||
tab.click();
|
||||
}
|
||||
|
||||
checkTabIsSelectedByTitle(tabTitle) {
|
||||
let tab = element(by.cssContainingText("div[id*='mat-tab-label']", tabTitle));
|
||||
const tab = element(by.cssContainingText("div[id*='mat-tab-label']", tabTitle));
|
||||
tab.getAttribute('aria-selected').then((result) => {
|
||||
expect(result).toBe('true');
|
||||
});
|
||||
|
@@ -27,7 +27,7 @@ export class TestingAlfrescoApiService extends AlfrescoApiService {
|
||||
|
||||
constructor(public appConfig: AppConfigService) {
|
||||
super(null, null);
|
||||
let oauth = Object.assign({}, this.appConfig.get<any>(AppConfigValues.OAUTHCONFIG, null));
|
||||
const oauth = Object.assign({}, this.appConfig.get<any>(AppConfigValues.OAUTHCONFIG, null));
|
||||
this.config = new AlfrescoApiConfig({
|
||||
provider: this.appConfig.get<string>(AppConfigValues.PROVIDERS),
|
||||
hostEcm: this.appConfig.get<string>(AppConfigValues.ECMHOST),
|
||||
|
@@ -27,18 +27,18 @@ export class AppListCloudPage {
|
||||
}
|
||||
|
||||
goToApp(applicationName) {
|
||||
let app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(app);
|
||||
app.click();
|
||||
}
|
||||
|
||||
checkAppIsNotDisplayed(applicationName) {
|
||||
let app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
return BrowserVisibility.waitUntilElementIsNotOnPage(app);
|
||||
}
|
||||
|
||||
checkAppIsDisplayed(applicationName) {
|
||||
let app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
return BrowserVisibility.waitUntilElementIsVisible(app);
|
||||
}
|
||||
|
||||
|
@@ -34,53 +34,53 @@ export class FormFieldsPage {
|
||||
errorMessage = by.css('.adf-error-text-container .adf-error-text');
|
||||
|
||||
setFieldValue(locator, field, value) {
|
||||
let fieldElement: any = element(locator(field));
|
||||
const fieldElement: any = element(locator(field));
|
||||
BrowserVisibility.waitUntilElementIsVisible(fieldElement);
|
||||
fieldElement.clear().sendKeys(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkWidgetIsVisible(fieldId) {
|
||||
let fieldElement = element.all(by.css(`adf-form-field div[id='field-${fieldId}-container']`)).first();
|
||||
const fieldElement = element.all(by.css(`adf-form-field div[id='field-${fieldId}-container']`)).first();
|
||||
BrowserVisibility.waitUntilElementIsVisible(fieldElement);
|
||||
}
|
||||
|
||||
checkWidgetIsHidden(fieldId) {
|
||||
let hiddenElement = element(by.css(`adf-form-field div[id='field-${fieldId}-container'][hidden]`));
|
||||
const hiddenElement = element(by.css(`adf-form-field div[id='field-${fieldId}-container'][hidden]`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(hiddenElement);
|
||||
}
|
||||
|
||||
getWidget(fieldId) {
|
||||
let widget = element(by.css(`adf-form-field div[id='field-${fieldId}-container']`));
|
||||
const widget = element(by.css(`adf-form-field div[id='field-${fieldId}-container']`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(widget);
|
||||
return widget;
|
||||
}
|
||||
|
||||
getFieldValue(fieldId, valueLocatorParam) {
|
||||
let value = this.getWidget(fieldId).element(valueLocatorParam || this.valueLocator);
|
||||
const value = this.getWidget(fieldId).element(valueLocatorParam || this.valueLocator);
|
||||
BrowserVisibility.waitUntilElementIsVisible(value);
|
||||
return value.getAttribute('value');
|
||||
}
|
||||
|
||||
getFieldLabel(fieldId, labelLocatorParam) {
|
||||
let label = this.getWidget(fieldId).all(labelLocatorParam || this.labelLocator).first();
|
||||
const label = this.getWidget(fieldId).all(labelLocatorParam || this.labelLocator).first();
|
||||
BrowserVisibility.waitUntilElementIsVisible(label);
|
||||
return label.getText();
|
||||
}
|
||||
|
||||
getFieldErrorMessage(fieldId) {
|
||||
let error = this.getWidget(fieldId).element(this.errorMessage);
|
||||
const error = this.getWidget(fieldId).element(this.errorMessage);
|
||||
return error.getText();
|
||||
}
|
||||
|
||||
getFieldText(fieldId, labelLocatorParam) {
|
||||
let label = this.getWidget(fieldId).element(labelLocatorParam || this.labelLocator);
|
||||
const label = this.getWidget(fieldId).element(labelLocatorParam || this.labelLocator);
|
||||
BrowserVisibility.waitUntilElementIsVisible(label);
|
||||
return label.getText();
|
||||
}
|
||||
|
||||
getFieldPlaceHolder(fieldId, locator = 'input') {
|
||||
let placeHolderLocator = element(by.css(`${locator}#${fieldId}`)).getAttribute('placeholder');
|
||||
const placeHolderLocator = element(by.css(`${locator}#${fieldId}`)).getAttribute('placeholder');
|
||||
BrowserVisibility.waitUntilElementIsVisible(placeHolderLocator);
|
||||
return placeHolderLocator;
|
||||
}
|
||||
@@ -138,14 +138,14 @@ export class FormFieldsPage {
|
||||
}
|
||||
|
||||
selectFormFromDropDown(formName) {
|
||||
let formNameElement = element(by.cssContainingText('span', formName));
|
||||
const formNameElement = element(by.cssContainingText('span', formName));
|
||||
BrowserVisibility.waitUntilElementIsVisible(formNameElement);
|
||||
formNameElement.click();
|
||||
}
|
||||
|
||||
checkWidgetIsReadOnlyMode(fieldId) {
|
||||
let widget = element(by.css(`adf-form-field div[id='field-${fieldId}-container']`));
|
||||
let widgetReadOnly = widget.element(by.css('div[class*="adf-readonly"]'));
|
||||
const widget = element(by.css(`adf-form-field div[id='field-${fieldId}-container']`));
|
||||
const widgetReadOnly = widget.element(by.css('div[class*="adf-readonly"]'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(widgetReadOnly);
|
||||
return widgetReadOnly;
|
||||
}
|
||||
@@ -156,7 +156,7 @@ export class FormFieldsPage {
|
||||
}
|
||||
|
||||
setValueInInputById(fieldId, value) {
|
||||
let input: any = element(by.id(fieldId));
|
||||
const input: any = element(by.id(fieldId));
|
||||
BrowserVisibility.waitUntilElementIsVisible(input);
|
||||
input.clear().sendKeys(value);
|
||||
return this;
|
||||
|
Reference in New Issue
Block a user