mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACS-6798] protractor to playwright e2e test suites search results libraries (#3690)
* [ACS-6798] seach results libraries migrated * [ACS-6798] added infoDrawer and search to PW tests in PRs * [ACS-6798] excluded tests + sonar fix * [ACS-6798] sonar fix 2 * [ACS-6798] sonar fix 3 * [ACS-6798] sonar fix 3 * [ACS-6798] login and delete methods added to Utils for sonar cloud duplication code * [ACS-6798] review fixes * Revert "[ci:force][auto-commit] Update dependencies ADF:6.8.0-8186121470 JS:7.7.0-8186121470 (#3693)" This reverts commit 29b1bf99d4ff8734342b94907d6bb2676a407e2e. * Revert "Release 4.4.1 (#3688)" This reverts commit 6dd3ad66d0d96054beb4f70fee5b2b550cc23efc. * [ACS-6798] review fixes pt2 * [ACS-6798] review fixes pt 3 * [ACS-6798] review fixes pt4 * [ACS-6798] review fixes pt4.1
This commit is contained in:
@@ -52,6 +52,9 @@ export class DataTableComponent extends BaseComponent {
|
||||
emptyListTest = this.getChild('adf-custom-empty-content-template');
|
||||
paginationButton = this.page.locator('.adf-pagination__block button').nth(0);
|
||||
paginationOptions = this.page.locator('#cdk-overlay-0 button');
|
||||
sitesVisibility = this.page.locator('.adf-datatable-body [data-automation-id*="datatable-row"] [aria-label="Visibility"]');
|
||||
sitesName = this.page.locator('.adf-datatable-body [data-automation-id*="datatable-row"] [aria-label="Name"]');
|
||||
sitesRole = this.page.locator('.adf-datatable-body [data-automation-id*="datatable-row"] [aria-label="My Role"]');
|
||||
|
||||
/** Locator for row (or rows) */
|
||||
getRowLocator = this.getChild(`adf-datatable-row`);
|
||||
@@ -327,4 +330,47 @@ export class DataTableComponent extends BaseComponent {
|
||||
await this.paginationButton.click();
|
||||
await this.paginationOptions.getByText("50").click();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method used to create objects from names and visibility of sites from datatable
|
||||
*
|
||||
* @returns an object with sites' names and their corresponding visibility values
|
||||
*/
|
||||
async getSitesNameAndVisibility(): Promise<{ [siteName: string]: string }> {
|
||||
const rowsCount = await this.sitesName.count();
|
||||
let sitesInfo: { [siteName: string]: string } = {};
|
||||
for (let i = 0; i < rowsCount; i++) {
|
||||
let siteVisibilityText = await this.sitesVisibility.nth(i).textContent();
|
||||
let siteNameText = await this.sitesName.nth(i).textContent();
|
||||
siteVisibilityText = siteVisibilityText.trim().toUpperCase();
|
||||
siteNameText = siteNameText.trim();
|
||||
sitesInfo[siteNameText] = siteVisibilityText;
|
||||
}
|
||||
return sitesInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method used to create objects from names and roles of sites from datatable
|
||||
*
|
||||
* @returns an object with sites' names and their corresponding role values
|
||||
*/
|
||||
async getSitesNameAndRole(): Promise<{ [siteName: string]: string }> {
|
||||
const rowsCount = await this.sitesName.count();
|
||||
let sitesInfo: { [siteName: string]: string } = {};
|
||||
for (let i = 0; i < rowsCount; i++) {
|
||||
let siteNameText = await this.sitesName.nth(i).textContent();
|
||||
let siteRoleText = await this.sitesRole.nth(i).textContent();
|
||||
siteNameText = siteNameText.trim();
|
||||
siteRoleText = siteRoleText.trim();
|
||||
sitesInfo[siteNameText] = siteRoleText;
|
||||
}
|
||||
return sitesInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method used to wait for values to be loaded in the table
|
||||
*/
|
||||
async waitForTable(): Promise<void> {
|
||||
await this.getRowLocator.nth(0).waitFor({timeout:5000});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user