mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4390]Added copyContent datatable cell tests (#4614)
* Modified data-table page on demo-shell to make copyClipboard possible to test * Add a new page in demo-shell. Add copyContent automated tests.
This commit is contained in:
committed by
Eugenio Romano
parent
550c0006c9
commit
bcdfcee397
@@ -112,4 +112,8 @@ export class BrowserVisibility {
|
||||
return browser.wait(until.presenceOf(elementToCheck), waitTimeout, 'Element is not present ' + elementToCheck.locator());
|
||||
}
|
||||
|
||||
static waitUntilElementIsNotPresent(elementToCheck, waitTimeout: number = DEFAULT_TIMEOUT) {
|
||||
return browser.wait(until.not(until.presenceOf(elementToCheck)), waitTimeout, 'Element is not in the page ' + elementToCheck.locator());
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -31,6 +31,7 @@ export class DataTableComponentPage {
|
||||
selectedRowNumber;
|
||||
allSelectedRows;
|
||||
selectAll;
|
||||
copyColumnTooltip;
|
||||
|
||||
constructor(rootElement: ElementFinder = element.all(by.css('adf-datatable')).first()) {
|
||||
this.rootElement = rootElement;
|
||||
@@ -42,6 +43,7 @@ export class DataTableComponentPage {
|
||||
this.selectedRowNumber = this.rootElement.element(by.css(`div[class*='is-selected'] div[data-automation-id*='text_']`));
|
||||
this.allSelectedRows = this.rootElement.all(by.css(`div[class*='is-selected']`));
|
||||
this.selectAll = this.rootElement.element(by.css(`div[class*='adf-datatable-header'] mat-checkbox`));
|
||||
this.copyColumnTooltip = this.rootElement.element(by.css(`adf-datatable-copy-content-tooltip span`));
|
||||
}
|
||||
|
||||
checkAllRowsButtonIsDisplayed() {
|
||||
@@ -306,4 +308,29 @@ export class DataTableComponentPage {
|
||||
BrowserVisibility.waitUntilElementIsClickable(resultElement);
|
||||
resultElement.click();
|
||||
}
|
||||
|
||||
getCopyContentTooltip() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.copyColumnTooltip);
|
||||
return this.copyColumnTooltip.getText();
|
||||
}
|
||||
|
||||
copyContentTooltipIsNotDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsNotPresent(this.copyColumnTooltip);
|
||||
return this;
|
||||
}
|
||||
|
||||
mouseOverColumn(columnName, columnValue) {
|
||||
const column = this.getRowElement(columnName, columnValue);
|
||||
BrowserVisibility.waitUntilElementIsVisible(column);
|
||||
browser.actions().mouseMove(column).perform();
|
||||
return this;
|
||||
}
|
||||
|
||||
clickColumn(columnName, columnValue) {
|
||||
const column = this.getRowElement(columnName, columnValue);
|
||||
BrowserVisibility.waitUntilElementIsVisible(column);
|
||||
BrowserVisibility.waitUntilElementIsClickable(column);
|
||||
column.click();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user