mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +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
@@ -34,15 +34,15 @@ export class DocumentListPage {
|
||||
}
|
||||
|
||||
checkLockedIcon(content) {
|
||||
let row = this.dataTable.getRowParentElement('Display name', content);
|
||||
let lockIcon = row.element(by.cssContainingText('div[title="Lock"] mat-icon', 'lock'));
|
||||
const row = this.dataTable.getRowParentElement('Display name', content);
|
||||
const lockIcon = row.element(by.cssContainingText('div[title="Lock"] mat-icon', 'lock'));
|
||||
Util.waitUntilElementIsVisible(lockIcon);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkUnlockedIcon(content) {
|
||||
let row = this.dataTable.getRowParentElement('Display name', content);
|
||||
let lockIcon = row.element(by.cssContainingText('div[title="Lock"] mat-icon', 'lock_open'));
|
||||
const row = this.dataTable.getRowParentElement('Display name', content);
|
||||
const lockIcon = row.element(by.cssContainingText('div[title="Lock"] mat-icon', 'lock_open'));
|
||||
Util.waitUntilElementIsVisible(lockIcon);
|
||||
return this;
|
||||
}
|
||||
@@ -64,7 +64,7 @@ export class DocumentListPage {
|
||||
}
|
||||
|
||||
clickOnActionMenu(content) {
|
||||
let row = this.dataTable.getRowParentElement('Display name', content);
|
||||
const row = this.dataTable.getRowParentElement('Display name', content);
|
||||
row.element(this.optionButton).click();
|
||||
Util.waitUntilElementIsVisible(this.actionMenu);
|
||||
browser.sleep(500);
|
||||
|
@@ -48,7 +48,7 @@ export class DateRangeFilterPage {
|
||||
}
|
||||
|
||||
getFromCalendarSelectedDate() {
|
||||
let selectedDate = this.openFromDatePicker().getSelectedDate();
|
||||
const selectedDate = this.openFromDatePicker().getSelectedDate();
|
||||
new DatePickerPage().closeDatePicker();
|
||||
return selectedDate;
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ export class SearchCheckListPage {
|
||||
|
||||
clickCheckListOption(option) {
|
||||
Util.waitUntilElementIsVisible(this.filter);
|
||||
let result = this.filter.all(by.css(`mat-checkbox[data-automation-id*='-${option}'] .mat-checkbox-inner-container`)).first();
|
||||
const result = this.filter.all(by.css(`mat-checkbox[data-automation-id*='-${option}'] .mat-checkbox-inner-container`)).first();
|
||||
Util.waitUntilElementIsVisible(result);
|
||||
Util.waitUntilElementIsClickable(result);
|
||||
result.click();
|
||||
@@ -49,7 +49,7 @@ export class SearchCheckListPage {
|
||||
}
|
||||
|
||||
removeFilterOption(option) {
|
||||
let cancelChipButton = element(by.cssContainingText('mat-chip', option)).element(by.css('mat-icon'));
|
||||
const cancelChipButton = element(by.cssContainingText('mat-chip', option)).element(by.css('mat-icon'));
|
||||
Util.waitUntilElementIsClickable(cancelChipButton);
|
||||
cancelChipButton.click();
|
||||
return this;
|
||||
@@ -69,7 +69,7 @@ export class SearchCheckListPage {
|
||||
|
||||
searchInFilter(option) {
|
||||
Util.waitUntilElementIsClickable(this.filter);
|
||||
let inputElement = this.filter.all(this.inputBy).first();
|
||||
const inputElement = this.filter.all(this.inputBy).first();
|
||||
Util.waitUntilElementIsClickable(inputElement);
|
||||
|
||||
inputElement.clear();
|
||||
@@ -122,11 +122,11 @@ export class SearchCheckListPage {
|
||||
}
|
||||
|
||||
getBucketNumberOfFilterType(option) {
|
||||
let fileTypeFilter = this.filter.all(by.css('mat-checkbox[data-automation-id*=".' + option + '"] span')).first();
|
||||
const fileTypeFilter = this.filter.all(by.css('mat-checkbox[data-automation-id*=".' + option + '"] span')).first();
|
||||
Util.waitUntilElementIsVisible(fileTypeFilter);
|
||||
let bucketNumber = fileTypeFilter.getText().then((valueOfBucket) => {
|
||||
let numberOfBucket = valueOfBucket.split('(')[1];
|
||||
let totalNumberOfBucket = numberOfBucket.split(')')[0];
|
||||
const bucketNumber = fileTypeFilter.getText().then((valueOfBucket) => {
|
||||
const numberOfBucket = valueOfBucket.split('(')[1];
|
||||
const totalNumberOfBucket = numberOfBucket.split(')')[0];
|
||||
return totalNumberOfBucket.trim();
|
||||
});
|
||||
|
||||
@@ -135,38 +135,38 @@ export class SearchCheckListPage {
|
||||
|
||||
checkCheckListOptionIsDisplayed(option) {
|
||||
Util.waitUntilElementIsVisible(this.filter);
|
||||
let result = this.filter.element(by.css(`mat-checkbox[data-automation-id*='-${option}']`));
|
||||
const result = this.filter.element(by.css(`mat-checkbox[data-automation-id*='-${option}']`));
|
||||
return Util.waitUntilElementIsVisible(result);
|
||||
}
|
||||
|
||||
checkCheckListOptionIsNotSelected(option) {
|
||||
Util.waitUntilElementIsVisible(this.filter);
|
||||
let result = this.filter.element(by.css(`mat-checkbox[data-automation-id*='-${option}'][class*='checked']`));
|
||||
const result = this.filter.element(by.css(`mat-checkbox[data-automation-id*='-${option}'][class*='checked']`));
|
||||
return Util.waitUntilElementIsNotVisible(result);
|
||||
}
|
||||
|
||||
checkCheckListOptionIsSelected(option) {
|
||||
Util.waitUntilElementIsVisible(this.filter);
|
||||
let result = this.filter.element(by.css(`mat-checkbox[data-automation-id*='-${option}'][class*='checked']`));
|
||||
const result = this.filter.element(by.css(`mat-checkbox[data-automation-id*='-${option}'][class*='checked']`));
|
||||
return Util.waitUntilElementIsVisible(result);
|
||||
}
|
||||
|
||||
checkClearAllButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.filter);
|
||||
let result = this.filter.element(this.clearAllButton);
|
||||
const result = this.filter.element(this.clearAllButton);
|
||||
return Util.waitUntilElementIsVisible(result);
|
||||
}
|
||||
|
||||
clickClearAllButton() {
|
||||
Util.waitUntilElementIsVisible(this.filter);
|
||||
let result = this.filter.element(this.clearAllButton);
|
||||
const result = this.filter.element(this.clearAllButton);
|
||||
Util.waitUntilElementIsVisible(result);
|
||||
return result.click();
|
||||
}
|
||||
|
||||
getCheckListOptionsNumberOnPage() {
|
||||
Util.waitUntilElementIsVisible(this.filter);
|
||||
let checkListOptions = this.filter.all(by.css('div[class="checklist"] mat-checkbox'));
|
||||
const checkListOptions = this.filter.all(by.css('div[class="checklist"] mat-checkbox'));
|
||||
return checkListOptions.count();
|
||||
}
|
||||
|
||||
|
@@ -29,12 +29,12 @@ export class SearchRadioPage {
|
||||
}
|
||||
|
||||
checkFilterRadioButtonIsDisplayed(filterName) {
|
||||
let filterType = element(by.css('mat-radio-button[data-automation-id="search-radio-' + filterName + '"]'));
|
||||
const filterType = element(by.css('mat-radio-button[data-automation-id="search-radio-' + filterName + '"]'));
|
||||
return Util.waitUntilElementIsVisible(filterType);
|
||||
}
|
||||
|
||||
checkFilterRadioButtonIsChecked(filterName) {
|
||||
let selectedFilterType = element(by.css('mat-radio-button[data-automation-id="search-radio-' + filterName + '"][class*="checked"]'));
|
||||
const selectedFilterType = element(by.css('mat-radio-button[data-automation-id="search-radio-' + filterName + '"][class*="checked"]'));
|
||||
return Util.waitUntilElementIsVisible(selectedFilterType);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ export class SearchRadioPage {
|
||||
}
|
||||
|
||||
getRadioButtonsNumberOnPage() {
|
||||
let radioButtons = element.all(by.css('mat-radio-button'));
|
||||
const radioButtons = element.all(by.css('mat-radio-button'));
|
||||
return radioButtons.count();
|
||||
}
|
||||
|
||||
|
@@ -28,7 +28,7 @@ export class SearchSortingPickerPage {
|
||||
Util.waitUntilElementIsClickable(this.sortingSelector);
|
||||
this.sortingSelector.click();
|
||||
|
||||
let selectedSortingOption = element(by.cssContainingText('span[class="mat-option-text"]', sortType));
|
||||
const selectedSortingOption = element(by.cssContainingText('span[class="mat-option-text"]', sortType));
|
||||
Util.waitUntilElementIsClickable(selectedSortingOption);
|
||||
selectedSortingOption.click();
|
||||
|
||||
@@ -51,7 +51,7 @@ export class SearchSortingPickerPage {
|
||||
}
|
||||
|
||||
clickSortingOption(option) {
|
||||
let selectedSortingOption = element(by.cssContainingText('span[class="mat-option-text"]', option));
|
||||
const selectedSortingOption = element(by.cssContainingText('span[class="mat-option-text"]', option));
|
||||
Util.waitUntilElementIsClickable(selectedSortingOption);
|
||||
selectedSortingOption.click();
|
||||
return this;
|
||||
@@ -64,13 +64,13 @@ export class SearchSortingPickerPage {
|
||||
}
|
||||
|
||||
checkOptionIsDisplayed(option) {
|
||||
let optionSelector = this.optionsDropdown.element(by.cssContainingText('span[class="mat-option-text"]', option));
|
||||
const optionSelector = this.optionsDropdown.element(by.cssContainingText('span[class="mat-option-text"]', option));
|
||||
Util.waitUntilElementIsVisible(optionSelector);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkOptionIsNotDisplayed(option) {
|
||||
let optionSelector = this.optionsDropdown.element(by.cssContainingText('span[class="mat-option-text"]', option));
|
||||
const optionSelector = this.optionsDropdown.element(by.cssContainingText('span[class="mat-option-text"]', option));
|
||||
Util.waitUntilElementIsNotVisible(optionSelector);
|
||||
return this;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ export class SearchSortingPickerPage {
|
||||
}
|
||||
|
||||
checkOrderArrowIsDownward() {
|
||||
let deferred = protractor.promise.defer();
|
||||
const deferred = protractor.promise.defer();
|
||||
Util.waitUntilElementIsVisible(this.orderArrow);
|
||||
this.orderArrow.getText().then((result) => {
|
||||
deferred.fulfill(result !== 'arrow_upward');
|
||||
|
@@ -62,7 +62,7 @@ export class SearchCategoriesPage {
|
||||
}
|
||||
|
||||
clickFilterHeader(filter: ElementFinder) {
|
||||
let fileSizeFilterHeader = filter.element(by.css('mat-expansion-panel-header'));
|
||||
const fileSizeFilterHeader = filter.element(by.css('mat-expansion-panel-header'));
|
||||
Util.waitUntilElementIsClickable(fileSizeFilterHeader);
|
||||
fileSizeFilterHeader.click();
|
||||
return this;
|
||||
|
@@ -35,28 +35,28 @@ export class TreeViewPage {
|
||||
}
|
||||
|
||||
clickNode(nodeName) {
|
||||
let node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"] button'));
|
||||
const node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"] button'));
|
||||
Util.waitUntilElementIsClickable(node);
|
||||
return node.click();
|
||||
}
|
||||
|
||||
checkNodeIsDisplayedAsClosed(nodeName) {
|
||||
let node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="false"]'));
|
||||
const node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="false"]'));
|
||||
return Util.waitUntilElementIsVisible(node);
|
||||
}
|
||||
|
||||
checkNodeIsDisplayedAsOpen(nodeName) {
|
||||
let node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="true"]'));
|
||||
const node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="true"]'));
|
||||
return Util.waitUntilElementIsVisible(node);
|
||||
}
|
||||
|
||||
checkClickedNodeName(nodeName) {
|
||||
let clickedNode = element(by.cssContainingText('span', ' CLICKED NODE: ' + nodeName + ''));
|
||||
const clickedNode = element(by.cssContainingText('span', ' CLICKED NODE: ' + nodeName + ''));
|
||||
return Util.waitUntilElementIsVisible(clickedNode);
|
||||
}
|
||||
|
||||
checkNodeIsNotDisplayed(nodeName) {
|
||||
let node = element(by.id('' + nodeName + '-tree-child-node'));
|
||||
const node = element(by.id('' + nodeName + '-tree-child-node'));
|
||||
return Util.waitUntilElementIsNotVisible(node);
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ export class TreeViewPage {
|
||||
}
|
||||
|
||||
checkErrorMessageIsDisplayed() {
|
||||
let clickedNode = element(by.cssContainingText('span', 'An Error Occurred '));
|
||||
const clickedNode = element(by.cssContainingText('span', 'An Error Occurred '));
|
||||
return Util.waitUntilElementIsVisible(clickedNode);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user