[ADF-4329][ASD-5330] plus Improve e2e (#6580)

Improve e2e
Fix SSO user avatar 
Fix Priority for APS1
This commit is contained in:
Eugenio Romano
2021-02-05 15:18:30 +00:00
committed by GitHub
parent e4990f4b0c
commit f4976a1949
72 changed files with 649 additions and 442 deletions

View File

@@ -15,14 +15,6 @@
* limitations under the License.
*/
/*
* Copyright 2005-2019 Alfresco Software, Ltd. All rights reserved.
*
* License rights for this program may be obtained from Alfresco Software, Ltd.
* pursuant to a written agreement and any use of this program without such an
* agreement is prohibited.
*/
export type ApiResultPredicate<T> = (result: T) => boolean;
export type ApiCall<T> = () => Promise<T>;

View File

@@ -94,7 +94,7 @@ export class LoginPage {
await this.enterPassword(password);
await this.clickLoginButton();
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
await BrowserVisibility.waitUntilElementIsVisible(this.header);
await BrowserVisibility.waitUntilElementIsVisible(this.header, BrowserVisibility.DEFAULT_TIMEOUT * 2);
}
async loginBasicAuth(username: string, password: string): Promise<void> {

View File

@@ -43,7 +43,7 @@ export class BrowserActions {
}
};
return ApiUtil.waitForApi(apiCall, predicate, 5, 2000);
return ApiUtil.waitForApi(apiCall, predicate, 10, 2000);
}
static async click(elementToClick: ElementFinder): Promise<void> {

View File

@@ -24,4 +24,5 @@ export * from './local-storage.util';
export * from './file-browser.util';
export * from './form.util';
export * from './date-util';
export * from './wait-actions';
export * from './logger';

View File

@@ -0,0 +1,70 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* 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 { NodeEntry } from '@alfresco/js-api';
import { ApiService } from '../actions/api.service';
import { ApiUtil } from '../actions/api.util';
import { Logger } from './logger';
export class WaitActions {
DELAY_API_CALL = 5000;
apiService: ApiService;
constructor(apiService: ApiService) {
this.apiService = apiService;
}
async nodeIsPresent(nodeId: string): Promise<NodeEntry | null> {
const predicate = (result) => {
return result.entry.id === nodeId;
};
const apiCall = async () => {
try {
return this.apiService.getInstance().core.nodesApi.getNode(nodeId);
} catch (error) {
Logger.error('Node not present');
return null;
}
};
return ApiUtil.waitForApi(apiCall, predicate, this.DELAY_API_CALL);
}
async nodeIsUnlock(nodeId: string): Promise<NodeEntry | null> {
const predicate = (result) => {
return result.entry.isLocked === false;
};
const apiCall = async () => {
try {
return this.apiService.getInstance().core.nodesApi.getNode(nodeId);
} catch (error) {
Logger.error('Node not present');
return null;
}
};
return ApiUtil.waitForApi(apiCall, predicate, this.DELAY_API_CALL);
}
}