mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-3931]Fix share and lock files automated tests (#4195)
* Fix share-files tests * Moved a locator to a page object * Fix lock-file tests * no message * Fix lock-file * Excluded viewer tests * Fix unshare tests.
This commit is contained in:
committed by
Eugenio Romano
parent
54a1a90083
commit
e63aa9a684
@@ -65,6 +65,10 @@ export class ContentServicesPage {
|
||||
searchInputElement = element(by.css('input[data-automation-id="content-node-selector-search-input"]'));
|
||||
shareNodeButton = element(by.cssContainingText('mat-icon', ' share '));
|
||||
|
||||
getUploadAreaDocumentList() {
|
||||
return new ContentListPage(element(by.css('adf-upload-drag-area')));
|
||||
}
|
||||
|
||||
clickFileHyperlink(fileName) {
|
||||
let hyperlink = this.contentList.getFileHyperlink(fileName);
|
||||
Util.waitUntilElementIsClickable(hyperlink);
|
||||
|
@@ -15,12 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, by, element, protractor } from 'protractor';
|
||||
import { ElementFinder, browser, by, element, protractor } from 'protractor';
|
||||
import { DataTablePage } from '../dataTablePage';
|
||||
import { Util } from '../../../util/util';
|
||||
|
||||
export class ContentListPage {
|
||||
|
||||
rootElement: ElementFinder;
|
||||
dataTable = new DataTablePage();
|
||||
deleteContentElement = element(by.css('button[data-automation-id*="DELETE"]'));
|
||||
metadataAction = element(by.css('button[data-automation-id*="METADATA"]'));
|
||||
@@ -44,6 +45,10 @@ export class ContentListPage {
|
||||
table = element.all(by.css('adf-datatable')).first();
|
||||
tableBody = element.all(by.css('adf-document-list div[class="adf-datatable-body"]')).first();
|
||||
|
||||
constructor(rootElement: ElementFinder = element(by.css('adf-document-list'))) {
|
||||
this.rootElement = rootElement;
|
||||
}
|
||||
|
||||
getFileHyperlink(fileName) {
|
||||
return this.dataTable.getFileHyperlink(fileName);
|
||||
}
|
||||
@@ -62,11 +67,22 @@ export class ContentListPage {
|
||||
return row;
|
||||
}
|
||||
|
||||
getRowsNameWithRoot(content) {
|
||||
let row = this.rootElement.all(by.css(`adf-datatable span[title='${content}']`)).first();
|
||||
Util.waitUntilElementIsVisible(row);
|
||||
return row;
|
||||
}
|
||||
|
||||
getRowByRowName(content) {
|
||||
Util.waitUntilElementIsVisible(this.getRowsName(content).element(this.rowByRowName));
|
||||
return this.getRowsName(content).element(this.rowByRowName);
|
||||
}
|
||||
|
||||
getRowByRowNameWithRoot(content) {
|
||||
Util.waitUntilElementIsVisible(this.getRowsNameWithRoot(content).element(this.rowByRowName));
|
||||
return this.getRowsNameWithRoot(content).element(this.rowByRowName);
|
||||
}
|
||||
|
||||
getCellByNameAndColumn(content, columnName) {
|
||||
return this.getRowByRowName(content).element(by.css(`div[title='${columnName}']`));
|
||||
}
|
||||
@@ -103,6 +119,12 @@ export class ContentListPage {
|
||||
this.deleteContentElement.click();
|
||||
}
|
||||
|
||||
deleteContentWithRoot(content) {
|
||||
this.clickOnActionMenuWithRoot(content);
|
||||
this.waitForContentOptions();
|
||||
this.deleteContentElement.click();
|
||||
}
|
||||
|
||||
checkDeleteIsDisabled(content) {
|
||||
this.clickOnActionMenu(content);
|
||||
this.waitForContentOptions();
|
||||
@@ -133,7 +155,7 @@ export class ContentListPage {
|
||||
}
|
||||
|
||||
lockContent(content) {
|
||||
this.clickOnActionMenu(content);
|
||||
this.clickOnActionMenuWithRoot(content);
|
||||
this.lockContentElement.click();
|
||||
}
|
||||
|
||||
@@ -151,6 +173,13 @@ export class ContentListPage {
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnActionMenuWithRoot(content) {
|
||||
this.getRowByRowNameWithRoot(content).element(this.optionButton).click();
|
||||
Util.waitUntilElementIsVisible(this.actionMenu);
|
||||
browser.sleep(500);
|
||||
return this;
|
||||
}
|
||||
|
||||
sortByColumn(sortOrder, locator) {
|
||||
Util.waitUntilElementIsVisible(element(locator));
|
||||
return element(locator).getAttribute('class').then(function (result) {
|
||||
@@ -323,6 +352,11 @@ export class ContentListPage {
|
||||
Util.waitUntilElementIsVisible(isRowSelected);
|
||||
}
|
||||
|
||||
checkRowIsSelectedWithRoot(content) {
|
||||
let isRowSelected = this.getRowsNameWithRoot(content).element(by.xpath(`ancestor::div[contains(@class, 'is-selected')]`));
|
||||
Util.waitUntilElementIsVisible(isRowSelected);
|
||||
}
|
||||
|
||||
checkContentIsDisplayed(content) {
|
||||
Util.waitUntilElementIsVisible(this.getRowByRowName(content));
|
||||
return this;
|
||||
@@ -366,6 +400,13 @@ export class ContentListPage {
|
||||
return this;
|
||||
}
|
||||
|
||||
clickRowToSelectWithRoot(rowName) {
|
||||
let row = this.getRowByRowNameWithRoot(rowName);
|
||||
browser.actions().keyDown(protractor.Key.COMMAND).click(row).perform();
|
||||
this.checkRowIsSelectedWithRoot(rowName);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkLockedIcon(content) {
|
||||
let lockIcon = element(by.cssContainingText('div[filename="' + content + '"] mat-icon', 'lock'));
|
||||
Util.waitUntilElementIsVisible(lockIcon);
|
||||
|
Reference in New Issue
Block a user