mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4089] Refactoring ContentListPage (#4162)
* [ADF-NO-ISSUE] Refactoring ContentListPage * Applying changes * [ADF-4089] contentListPage refactoring * Fixing missing dependencies * Fixing core and search failing tests * Fix tooltip document-list tests * no message
This commit is contained in:
committed by
Eugenio Romano
parent
88ef01011e
commit
27c6e18a10
@@ -17,7 +17,7 @@
|
||||
|
||||
import { Util } from '../../../util/util';
|
||||
import { element, by } from 'protractor';
|
||||
import { ContentListPage } from '../dialog/contentListPage';
|
||||
import { DataTableComponentPage } from '../dataTableComponentPage';
|
||||
import { NavigationBarPage } from '../navigationBarPage';
|
||||
|
||||
let source = {
|
||||
@@ -38,7 +38,7 @@ let column = {
|
||||
|
||||
export class CustomSources {
|
||||
|
||||
contentList = new ContentListPage();
|
||||
dataTable = new DataTableComponentPage();
|
||||
navigationBarPage = new NavigationBarPage();
|
||||
|
||||
toolbar = element(by.css('app-custom-sources .adf-toolbar-title'));
|
||||
@@ -67,13 +67,13 @@ export class CustomSources {
|
||||
}
|
||||
|
||||
checkRowIsDisplayed(rowName) {
|
||||
let row = this.contentList.getRowsName(rowName);
|
||||
Util.waitUntilElementIsVisible(row);
|
||||
return this.dataTable.checkContentIsDisplayed('Name', rowName);
|
||||
}
|
||||
|
||||
getStatusCell(rowName) {
|
||||
Util.waitUntilElementIsVisible(this.contentList.getCellByNameAndColumn(rowName, column.status));
|
||||
return this.contentList.getCellByNameAndColumn(rowName, column.status).getText();
|
||||
let cell = this.dataTable.getCellByRowAndColumn('Name', rowName, column.status);
|
||||
Util.waitUntilElementIsVisible(cell);
|
||||
return cell.getText();
|
||||
}
|
||||
|
||||
}
|
||||
|
127
e2e/pages/adf/demo-shell/dataTablePage.ts
Normal file
127
e2e/pages/adf/demo-shell/dataTablePage.ts
Normal file
@@ -0,0 +1,127 @@
|
||||
/*!
|
||||
* @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 { browser, by, element, protractor } from 'protractor';
|
||||
import { DataTableComponentPage } from '../dataTableComponentPage';
|
||||
import { Util } from '../../../util/util';
|
||||
|
||||
export class DataTablePage {
|
||||
|
||||
dataTable = new DataTableComponentPage();
|
||||
multiSelect = element(by.css(`div[data-automation-id='multiselect'] label > div[class='mat-checkbox-inner-container']`));
|
||||
reset = element(by.xpath(`//span[contains(text(),'Reset to default')]/..`));
|
||||
selectionButton = element(by.css(`div[class='mat-select-arrow']`));
|
||||
selectionDropDown = element(by.css(`div[class*='ng-trigger-transformPanel']`));
|
||||
allSelectedRows = element.all(by.css(`div[class*='is-selected']`));
|
||||
selectedRowNumber = element(by.css(`div[class*='is-selected'] div[data-automation-id*='text_']`));
|
||||
selectAll = element(by.css(`div[class*='header'] label`));
|
||||
addRowElement = element(by.xpath(`//span[contains(text(),'Add row')]/..`));
|
||||
replaceRowsElement = element(by.xpath(`//span[contains(text(),'Replace rows')]/..`));
|
||||
replaceColumnsElement = element(by.xpath(`//span[contains(text(),'Replace columns')]/..`));
|
||||
createdOnColumn = element(by.css(`div[data-automation-id='auto_id_createdOn']`));
|
||||
|
||||
insertFilter(filterText) {
|
||||
let inputFilter = element(by.css(`#adf-datatable-filter-input`));
|
||||
inputFilter.clear();
|
||||
return inputFilter.sendKeys(filterText);
|
||||
}
|
||||
|
||||
addRow() {
|
||||
Util.waitUntilElementIsVisible(this.addRowElement);
|
||||
this.addRowElement.click();
|
||||
}
|
||||
|
||||
replaceRows(id) {
|
||||
let rowID = this.dataTable.getRow('Id', id);
|
||||
Util.waitUntilElementIsVisible(rowID);
|
||||
this.replaceRowsElement.click();
|
||||
Util.waitUntilElementIsNotVisible(rowID);
|
||||
}
|
||||
|
||||
replaceColumns() {
|
||||
Util.waitUntilElementIsVisible(this.replaceColumnsElement);
|
||||
this.replaceColumnsElement.click();
|
||||
Util.waitUntilElementIsNotOnPage(this.createdOnColumn);
|
||||
}
|
||||
|
||||
clickMultiSelect() {
|
||||
Util.waitUntilElementIsVisible(this.multiSelect);
|
||||
this.multiSelect.click();
|
||||
}
|
||||
|
||||
clickReset() {
|
||||
Util.waitUntilElementIsVisible(this.reset);
|
||||
this.reset.click();
|
||||
}
|
||||
|
||||
checkRowIsNotSelected(rowNumber) {
|
||||
let isRowSelected = this.dataTable.getRow('Id', rowNumber)
|
||||
.element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row custom-row-style ng-star-inserted is-selected')]`));
|
||||
Util.waitUntilElementIsNotOnPage(isRowSelected);
|
||||
}
|
||||
|
||||
checkNoRowIsSelected() {
|
||||
Util.waitUntilElementIsNotOnPage(this.selectedRowNumber);
|
||||
}
|
||||
|
||||
checkAllRows() {
|
||||
Util.waitUntilElementIsVisible(this.selectAll);
|
||||
this.selectAll.click();
|
||||
}
|
||||
|
||||
checkRowIsChecked(rowNumber) {
|
||||
Util.waitUntilElementIsVisible(this.getRowCheckbox(rowNumber));
|
||||
}
|
||||
|
||||
checkRowIsNotChecked(rowNumber) {
|
||||
Util.waitUntilElementIsNotOnPage(this.getRowCheckbox(rowNumber));
|
||||
}
|
||||
|
||||
getNumberOfSelectedRows() {
|
||||
return this.allSelectedRows.count();
|
||||
}
|
||||
|
||||
clickCheckbox(rowNumber) {
|
||||
let checkbox = this.dataTable.getRow('Id', rowNumber).element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row')]//mat-checkbox/label`));
|
||||
Util.waitUntilElementIsVisible(checkbox);
|
||||
checkbox.click();
|
||||
}
|
||||
|
||||
selectRow(rowNumber) {
|
||||
let locator = this.dataTable.getRow('Id', rowNumber);
|
||||
Util.waitUntilElementIsVisible(locator);
|
||||
Util.waitUntilElementIsClickable(locator);
|
||||
locator.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
selectRowWithKeyboard(rowNumber) {
|
||||
let row = this.dataTable.getRow('Id', rowNumber);
|
||||
browser.actions().sendKeys(protractor.Key.COMMAND).click(row).perform();
|
||||
}
|
||||
|
||||
selectSelectionMode(selectionMode) {
|
||||
let selectMode = element(by.cssContainingText(`span[class='mat-option-text']`, selectionMode));
|
||||
this.selectionButton.click();
|
||||
Util.waitUntilElementIsVisible(this.selectionDropDown);
|
||||
selectMode.click();
|
||||
}
|
||||
|
||||
getRowCheckbox(rowNumber) {
|
||||
return this.dataTable.getRow('Id', rowNumber).element(by.xpath(`ancestor::div/div/mat-checkbox[contains(@class, 'mat-checkbox-checked')]`));
|
||||
}
|
||||
}
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Util } from '../../../../util/util';
|
||||
import { DataTablePage } from '../../dataTablePage';
|
||||
import { DataTableComponentPage } from '../../dataTableComponentPage';
|
||||
import { element, by, protractor } from 'protractor';
|
||||
|
||||
export class ProcessListDemoPage {
|
||||
@@ -29,10 +29,10 @@ export class ProcessListDemoPage {
|
||||
stateSelector = element(by.css('mat-select[data-automation-id="state"'));
|
||||
sortSelector = element(by.css('mat-select[data-automation-id="sort"'));
|
||||
|
||||
dataTable = new DataTablePage();
|
||||
dataTable = new DataTableComponentPage();
|
||||
|
||||
getDisplayedProcessesNames() {
|
||||
return this.dataTable.getAllRowsNameColumn();
|
||||
return this.dataTable.getAllRowsColumnValues('Name');
|
||||
}
|
||||
|
||||
selectSorting(sort) {
|
||||
@@ -76,11 +76,11 @@ export class ProcessListDemoPage {
|
||||
}
|
||||
|
||||
checkProcessIsNotDisplayed(processName) {
|
||||
return this.dataTable.checkRowIsNotDisplayedByName(processName);
|
||||
return this.dataTable.checkContentIsNotDisplayed('Name', processName);
|
||||
}
|
||||
|
||||
checkProcessIsDisplayed(processName) {
|
||||
return this.dataTable.checkRowIsDisplayedByName(processName);
|
||||
return this.dataTable.checkContentIsDisplayed('Name', processName);
|
||||
}
|
||||
|
||||
checkAppIdFieldIsDisplayed() {
|
||||
|
Reference in New Issue
Block a user