[ADF-4059] - Move Copy Folders with Load more- take2 (#4562)

* C260132 automated

* debbugging

* in progress

* done

* review comments.

* in progress

* Update content-node-selector-dialog.page.ts

* fix the locators

* code review comments

* removed the datatablecomponentPage call directly from hte test.
This commit is contained in:
gmandakini
2019-04-10 19:41:16 +01:00
committed by Eugenio Romano
parent 558ee4c031
commit 1bda3c914c
11 changed files with 511 additions and 175 deletions
@@ -0,0 +1,42 @@
/*!
* @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 { element, by } from 'protractor';
import { BrowserVisibility } from '@alfresco/adf-testing';
export class BreadCrumbDropdownPage {
breadCrumb = element(by.css(`adf-dropdown-breadcrumb[data-automation-id='content-node-selector-content-breadcrumb']`));
parentFolder = this.breadCrumb.element(by.css(`button[data-automation-id='dropdown-breadcrumb-trigger']`));
breadCrumbDropdown = element(by.css(`div[class*='mat-select-panel']`));
choosePath(pathName) {
const path = this.breadCrumbDropdown.element(by.cssContainingText(`mat-option[data-automation-class='dropdown-breadcrumb-path-option'] span[class='mat-option-text']`,
pathName));
BrowserVisibility.waitUntilElementIsVisible(path);
return path.click();
}
clickParentFolder() {
BrowserVisibility.waitUntilElementIsVisible(this.parentFolder);
return this.parentFolder.click();
}
checkBreadCrumbDropdownIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.breadCrumbDropdown);
}
}
@@ -0,0 +1,32 @@
/*!
* @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 { element, by } from 'protractor';
import { BrowserVisibility } from '@alfresco/adf-testing';
export class BreadCrumbPage {
breadCrumb = element(by.css(`adf-breadcrumb nav[data-automation-id='breadcrumb']`));
chooseBreadCrumb(breadCrumbItem) {
const path = this.breadCrumb.element(by.css(`a[data-automation-id='breadcrumb_${breadCrumbItem}']`));
BrowserVisibility.waitUntilElementIsVisible(path);
return path.click();
}
}
@@ -1,91 +0,0 @@
/*!
* @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, ElementFinder, browser } from 'protractor';
import { DataTableComponentPage } from '@alfresco/adf-testing';
import { BrowserVisibility } from '@alfresco/adf-testing';
export class DocumentListPage {
rootElement: ElementFinder;
actionMenu = element(by.css('div[role="menu"]'));
optionButton = by.css('button[data-automation-id*="action_menu_"]');
tableBody;
dataTable;
constructor(rootElement: ElementFinder = element.all(by.css('adf-document-list')).first()) {
this.rootElement = rootElement;
this.dataTable = new DataTableComponentPage(this.rootElement);
this.tableBody = rootElement.all(by.css('div[class="adf-datatable-body"]')).first();
}
checkLockedIcon(content) {
const row = this.dataTable.getRow('Display name', content);
const lockIcon = row.element(by.cssContainingText('div[title="Lock"] mat-icon', 'lock'));
BrowserVisibility.waitUntilElementIsVisible(lockIcon);
return this;
}
checkUnlockedIcon(content) {
const row = this.dataTable.getRow('Display name', content);
const lockIcon = row.element(by.cssContainingText('div[title="Lock"] mat-icon', 'lock_open'));
BrowserVisibility.waitUntilElementIsVisible(lockIcon);
return this;
}
waitForTableBody() {
return BrowserVisibility.waitUntilElementIsVisible(this.tableBody);
}
getTooltip(nodeName) {
return this.dataTable.getTooltip('Display name', nodeName);
}
selectRow(nodeName) {
return this.dataTable.selectRow('Display name', nodeName);
}
rightClickOnRow(nodeName) {
return this.dataTable.rightClickOnRow('Display name', nodeName);
}
clickOnActionMenu(content) {
const row = this.dataTable.getRow('Display name', content);
row.element(this.optionButton).click();
BrowserVisibility.waitUntilElementIsVisible(this.actionMenu);
browser.sleep(500);
return this;
}
checkActionMenuIsNotDisplayed() {
BrowserVisibility.waitUntilElementIsNotVisible(this.actionMenu);
return this;
}
dataTablePage() {
return new DataTableComponentPage(this.rootElement);
}
getAllRowsColumnValues(column) {
return this.dataTable.getAllRowsColumnValues(column);
}
doubleClickRow(nodeName) {
this.dataTable.doubleClickRow('Display name', nodeName);
return this;
}
}
+1 -19
View File
@@ -16,7 +16,6 @@
*/
import TestConfig = require('../../test.config');
import { DocumentListPage } from './content-services/documentListPage';
import { CreateFolderDialog } from './dialog/createFolderDialog';
import { CreateLibraryDialog } from './dialog/createLibraryDialog';
import { DropActions } from '../../actions/drop.actions';
@@ -24,7 +23,7 @@ import { by, element, protractor, $$, browser } from 'protractor';
import path = require('path');
import { DateUtil } from '../../util/dateUtil';
import { BrowserVisibility } from '@alfresco/adf-testing';
import { BrowserVisibility, DocumentListPage } from '@alfresco/adf-testing';
export class ContentServicesPage {
@@ -658,23 +657,6 @@ export class ContentServicesPage {
BrowserVisibility.waitUntilElementIsVisible(row);
}
typeIntoNodeSelectorSearchField(text) {
BrowserVisibility.waitUntilElementIsVisible(this.searchInputElement);
this.searchInputElement.sendKeys(text);
}
clickContentNodeSelectorResult(name) {
const resultElement = element.all(by.css(`div[data-automation-id="content-node-selector-content-list"] div[data-automation-id="${name}"`)).first();
BrowserVisibility.waitUntilElementIsVisible(resultElement);
BrowserVisibility.waitUntilElementIsClickable(resultElement);
resultElement.click();
}
clickChooseButton() {
BrowserVisibility.waitUntilElementIsClickable(this.chooseButton);
this.chooseButton.click();
}
clickShareButton() {
BrowserVisibility.waitUntilElementIsClickable(this.shareNodeButton);
this.shareNodeButton.click();