mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Protractor cleanup for demo shell (#9019)
* [ci:force] cleanup protractor tests * [ci:force] cleanup insights test * [ci:force] cleanup dead demo shell e2e * [ci:force] cleanup e2e * [ci:force] cleanup e2e * cleanup files component * [ci:force] cleanup e2e * [ci:force] remove user info SSO protractor e2e * [ci:force] remove viewer e2e already covered by other tests * [ci:force] remove custom font from demo shell * [ci:force] demo shell viewer cleanup * [ci:force] cleanup viewer in demo shell * [ci:force] rollback model changes * [ci:force] remove site picker from content demo * [ci:force] cleanup files demo shell component * [ci:force] cleanup e2e and dead code * [ci:force] cleanup dead code * [ci:force] fix linting * [ci:force] standalone home component * [ci:force] cleanup demo shell app layout * [ci:force] cleanup css * [ci:force] cleanup demo shell logout * Update demo-shell/src/app/components/app-layout/app-layout.component.html Co-authored-by: Mykyta Maliarchuk <84377976+nikita-web-ua@users.noreply.github.com> --------- Co-authored-by: Mykyta Maliarchuk <84377976+nikita-web-ua@users.noreply.github.com>
This commit is contained in:
@@ -1,97 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* 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 {
|
||||
AddPermissionsDialogPage,
|
||||
BrowserActions,
|
||||
DataTableComponentPage,
|
||||
DropdownPage,
|
||||
TestElement
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
export class PermissionsPage {
|
||||
|
||||
dataTableComponentPage = new DataTableComponentPage();
|
||||
addPermissionsDialog = new AddPermissionsDialogPage();
|
||||
|
||||
rootElement = 'adf-permission-manager-card';
|
||||
inheritedButton = '[data-automation-id="adf-inherit-toggle-button"]';
|
||||
errorElement = TestElement.byId('adf-permission-manager-error');
|
||||
localPermissionList = TestElement.byCss('[data-automation-id="adf-locally-set-permission"]');
|
||||
addPermissionButton = TestElement.byCss('button[data-automation-id=\'adf-add-permission-button\']');
|
||||
|
||||
async changePermission(name: string, role: string): Promise<void> {
|
||||
await browser.sleep(1000);
|
||||
await this.clickRoleDropdownByUserOrGroupName(name);
|
||||
await new DropdownPage().selectOption(role);
|
||||
await this.dataTableComponentPage.checkRowByContentIsNotSelected(name);
|
||||
}
|
||||
|
||||
async checkUserIsAdded(id: string) {
|
||||
const userOrGroupName = TestElement.byCss('div[data-automation-id="' + id + '"]');
|
||||
await userOrGroupName.waitPresent();
|
||||
}
|
||||
|
||||
async getRoleCellValue(username: string): Promise<string> {
|
||||
const locator = this.dataTableComponentPage.getCellByRowContentAndColumn('Users and Groups', username, 'Role');
|
||||
return BrowserActions.getText(locator);
|
||||
}
|
||||
|
||||
async clickRoleDropdownByUserOrGroupName(name: string): Promise<void> {
|
||||
const row = this.dataTableComponentPage.getRow('Users and Groups', name);
|
||||
await row.click();
|
||||
await BrowserActions.click(row.$('[id="adf-select-role-permission"] .mat-select-trigger'));
|
||||
await TestElement.byCss('.mat-select-panel').waitVisible();
|
||||
}
|
||||
|
||||
async clickDeletePermissionButton(username: string): Promise<void> {
|
||||
const userOrGroupName = TestElement.byCss(`[data-automation-id="adf-delete-permission-button-${username}"]`);
|
||||
await userOrGroupName.waitPresent();
|
||||
await userOrGroupName.click();
|
||||
}
|
||||
|
||||
async checkUserIsDeleted(username: string): Promise<void> {
|
||||
const userOrGroupName = TestElement.byCss('div[data-automation-id="' + username + '"]');
|
||||
await userOrGroupName.waitNotPresent();
|
||||
}
|
||||
|
||||
async noPermissionContent(): Promise<string> {
|
||||
const noPermission = TestElement.byCss('.adf-no-permission__template--text');
|
||||
return noPermission.getText();
|
||||
}
|
||||
|
||||
async checkPermissionManagerDisplayed(): Promise<void> {
|
||||
await TestElement.byId(this.rootElement).waitVisible();
|
||||
}
|
||||
|
||||
async checkPermissionListDisplayed(): Promise<void> {
|
||||
await browser.sleep(500);
|
||||
await this.localPermissionList.waitVisible();
|
||||
}
|
||||
|
||||
async isInherited(): Promise<boolean> {
|
||||
const inheritButton = TestElement.byCss(this.inheritedButton);
|
||||
await inheritButton.waitVisible();
|
||||
return (await inheritButton.getAttribute('class')).indexOf('mat-checked') !== -1;
|
||||
}
|
||||
|
||||
async toggleInheritPermission(): Promise<void> {
|
||||
const inheritButton = TestElement.byCss(`${this.inheritedButton} label`);
|
||||
await inheritButton.click();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user