fix content service document list action test (#5027)

* fix content service document list action test

* restore build.sh

* perform twice movement mosue for right click for avoid bug in non headless chrome

* change sso ref element present

* change sso ref element present
This commit is contained in:
Eugenio Romano
2019-08-28 23:25:06 +01:00
committed by GitHub
parent 09d3710bcf
commit 609ae3a3ff
9 changed files with 77 additions and 66 deletions

View File

@@ -101,7 +101,6 @@ describe('Document List Component - Actions', () => {
beforeEach(async () => {
await navigationBarPage.clickContentServicesButton();
});
describe('File Actions', () => {
@@ -288,21 +287,26 @@ describe('Document List Component - Actions', () => {
});
it('[C260132] Move action on folder with - Load more', async () => {
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
await contentServicesPage.checkContextActionIsVisible('Move');
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await expect(await contentNodeSelector.getDialogHeaderText()).toBe('Move \'' + 'A' + folderModel1.name + '\' to...');
await contentNodeSelector.checkSearchInputIsDisplayed();
await expect(await contentNodeSelector.getSearchLabel()).toBe('Search');
await contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
await contentNodeSelector.checkCancelButtonIsDisplayed();
await contentNodeSelector.checkMoveCopyButtonIsDisplayed();
await expect(await contentNodeSelector.getMoveCopyButtonText()).toBe('MOVE');
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(5);
await infinitePaginationPage.clickLoadMoreButton();
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(6);
await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
@@ -336,7 +340,6 @@ describe('Document List Component - Actions', () => {
await breadCrumbPage.chooseBreadCrumb(contentServicesUser.id);
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
});
it('[C305051] Copy action on folder with - Load more', async () => {

View File

@@ -22,14 +22,13 @@ export class BreadCrumbDropdownPage {
breadCrumb: ElementFinder = 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: ElementFinder = element(by.css(`div[class*='mat-select-panel']`));
breadCrumbDropdown: ElementFinder = element.all(by.css(`div[class*='mat-select-panel']`)).first();
currentFolder = this.breadCrumb.element(by.css(`div span[data-automation-id="current-folder"]`));
async choosePath(pathName): Promise<void> {
const path = this.breadCrumbDropdown.element(by.cssContainingText(`mat-option[data-automation-class='dropdown-breadcrumb-path-option'] span[class='mat-option-text']`,
pathName));
await BrowserActions.click(path);
}
async clickParentFolder(): Promise<void> {

View File

@@ -83,7 +83,7 @@ export class DataTablePage {
await BrowserActions.click(this.reset);
}
async checkRowIsNotSelected(rowNumber): Promise<void> {
async checkRowIsNotSelected(rowNumber: string): Promise<void> {
const isRowSelected = this.dataTable.getCellElementByValue(this.columns.id, rowNumber)
.element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row custom-row-style ng-star-inserted is-selected')]`));
await BrowserVisibility.waitUntilElementIsNotVisible(isRowSelected);
@@ -97,11 +97,11 @@ export class DataTablePage {
await BrowserActions.click(this.selectAll);
}
async checkRowIsChecked(rowNumber): Promise<void> {
async checkRowIsChecked(rowNumber: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.getRowCheckbox(rowNumber));
}
async checkRowIsNotChecked(rowNumber): Promise<void> {
async checkRowIsNotChecked(rowNumber: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.getRowCheckbox(rowNumber));
}
@@ -109,19 +109,19 @@ export class DataTablePage {
return this.allSelectedRows.count();
}
async clickCheckbox(rowNumber): Promise<void> {
async clickCheckbox(rowNumber: string): Promise<void> {
await BrowserActions.closeMenuAndDialogs();
const checkbox = this.dataTable.getCellElementByValue(this.columns.id, rowNumber)
.element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row')]//mat-checkbox/label`));
await BrowserActions.click(checkbox);
}
async selectRow(rowNumber): Promise<void> {
async selectRow(rowNumber: string): Promise<void> {
const row = this.dataTable.getCellElementByValue(this.columns.id, rowNumber);
await BrowserActions.click(row);
}
async selectRowWithKeyboard(rowNumber): Promise<void> {
async selectRowWithKeyboard(rowNumber: string): Promise<void> {
await browser.actions().sendKeys(protractor.Key.COMMAND).perform();
await this.selectRow(rowNumber);
await browser.actions().sendKeys(protractor.Key.NULL).perform();
@@ -133,7 +133,7 @@ export class DataTablePage {
await BrowserActions.click(selectMode);
}
getRowCheckbox(rowNumber): ElementFinder {
getRowCheckbox(rowNumber: string): ElementFinder {
return this.dataTable.getCellElementByValue(this.columns.id, rowNumber).element(by.xpath(`ancestor::div/div/mat-checkbox[contains(@class, 'mat-checkbox-checked')]`));
}
@@ -141,23 +141,25 @@ export class DataTablePage {
return await this.dataTable.getCopyContentTooltip();
}
async mouseOverNameColumn(name): Promise<void> {
async mouseOverNameColumn(name: string): Promise<void> {
await this.dataTable.mouseOverColumn(this.columns.name, name);
}
async mouseOverCreatedByColumn(name): Promise<void> {
async mouseOverCreatedByColumn(name: string): Promise<void> {
await this.dataTable.mouseOverColumn(this.columns.createdBy, name);
}
async mouseOverIdColumn(name): Promise<void> {
async mouseOverIdColumn(name: string): Promise<void> {
await this.dataTable.mouseOverColumn(this.columns.id, name);
}
async mouseOverJsonColumn(rowNumber): Promise<void> {
await this.dataTable.mouseOverElement(this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.json));
async mouseOverJsonColumn(rowNumber: number): Promise<void> {
const cell = this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.json);
await BrowserVisibility.waitUntilElementIsVisible(cell);
await browser.actions().mouseMove(cell).perform();
}
getDropTargetIdColumnCell(rowNumber): ElementFinder {
getDropTargetIdColumnCell(rowNumber: number): ElementFinder {
return this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.id);
}
@@ -165,11 +167,11 @@ export class DataTablePage {
return this.idColumnHeader;
}
async clickOnIdColumn(name): Promise<void> {
async clickOnIdColumn(name: string): Promise<void> {
await this.dataTable.clickColumn(this.columns.id, name);
}
async clickOnJsonColumn(rowNumber): Promise<void> {
async clickOnJsonColumn(rowNumber: number): Promise<void> {
await BrowserActions.click(this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.json));
}