mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4329][ASD-5330] plus Improve e2e (#6580)
Improve e2e Fix SSO user avatar Fix Priority for APS1
This commit is contained in:
@@ -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>;
|
||||
|
||||
|
@@ -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> {
|
||||
|
@@ -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> {
|
||||
|
@@ -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';
|
||||
|
70
lib/testing/src/lib/core/utils/wait-actions.ts
Normal file
70
lib/testing/src/lib/core/utils/wait-actions.ts
Normal 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);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user