mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-09-17 14:21:14 +00:00
[ACS-8688] export playwright shared lib (#4068)
* [ACS-8688] export playwright shared lib * [ACS-8688] changes name * [ACS-8688] changes name * [ACS-8688] add lint file and fix lint issue * [ACS-8688] test fix * added ng package file
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export type ApiResultPredicate<T> = (result: T) => boolean;
|
||||
@@ -40,7 +40,12 @@ export async function waitForApi<T>(apiCall: ApiCall<T>, predicate: ApiResultPre
|
||||
|
||||
function retryCall(fn: () => Promise<any>, retry: number = 30, delay: number = 1000): Promise<string> {
|
||||
const pause = (duration) => new Promise((res) => setTimeout(res, duration));
|
||||
const run = (retries) => fn().catch((err) => (retries > 1 ? pause(delay).then(() => run(retries - 1)) : Promise.reject(new Error(`API call did not satisfy predicate: ${JSON.stringify(err)}`))));
|
||||
const run = (retries) =>
|
||||
fn().catch((err) =>
|
||||
retries > 1
|
||||
? pause(delay).then(() => run(retries - 1))
|
||||
: Promise.reject(new Error(`API call did not satisfy predicate: ${JSON.stringify(err)}`))
|
||||
);
|
||||
|
||||
return run(retry);
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export const APP_ROUTES = {
|
||||
|
@@ -23,7 +23,6 @@
|
||||
*/
|
||||
|
||||
export const errorStrings = {
|
||||
|
||||
errorMessageNotPresent: 'Error message is not displayed',
|
||||
nameIsRequiredError: 'Name is required',
|
||||
nameWithSpecialCharactersError: `Name can't contain these characters * " < > \\ / ? : |`,
|
||||
@@ -38,4 +37,4 @@ export const errorStrings = {
|
||||
folderNameCantContainTheseCharacters: `Folder name can't contain these characters`,
|
||||
folderNameCantContainOnlySpaces: `Folder name can't contain only spaces`,
|
||||
thereIsAlreadyAFolderWithThisName: `There's already a folder with this name. Try a different name.`
|
||||
}
|
||||
};
|
||||
|
@@ -1,20 +1,36 @@
|
||||
/*
|
||||
* Copyright © 2005 - 2021 Alfresco Software, Ltd. All rights reserved.
|
||||
/*!
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. 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.
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export const getExcludedTestsRegExpArray = (excludedJson: any, projectName: string) => {
|
||||
const prefix = `[ 🎭 Playwright Excludes - ${projectName} ]`;
|
||||
const objectKeys = Object.keys(excludedJson);
|
||||
const prefix = `[ 🎭 Playwright Excludes - ${projectName} ]`;
|
||||
const objectKeys = Object.keys(excludedJson);
|
||||
|
||||
if (!objectKeys.length) {
|
||||
console.info(`${prefix} ✅ No excluded tests 🎉 `);
|
||||
} else {
|
||||
console.warn(`${prefix} ❌ Tests excluded because of 🐛 : ${objectKeys}`);
|
||||
}
|
||||
if (!objectKeys.length) {
|
||||
console.info(`${prefix} ✅ No excluded tests 🎉 `);
|
||||
} else {
|
||||
console.warn(`${prefix} ❌ Tests excluded because of 🐛 : ${objectKeys}`);
|
||||
}
|
||||
|
||||
return objectKeys.map((key) => new RegExp(key));
|
||||
return objectKeys.map((key) => new RegExp(key));
|
||||
};
|
||||
|
@@ -24,6 +24,6 @@
|
||||
|
||||
export const libraryErrors = {
|
||||
libraryIdIsNotAvailable: "This Library ID isn't available. Try a different Library ID.",
|
||||
libraryIdIsAlreadyUsed: "This Library ID is already used. Check the trashcan.",
|
||||
useNumbersAndLettersOnly: "Use numbers and letters only"
|
||||
}
|
||||
libraryIdIsAlreadyUsed: 'This Library ID is already used. Check the trashcan.',
|
||||
useNumbersAndLettersOnly: 'Use numbers and letters only'
|
||||
};
|
||||
|
@@ -25,9 +25,9 @@
|
||||
const rootFolder = 'e2e-output';
|
||||
|
||||
export const paths = {
|
||||
rootFolder,
|
||||
allData: `${rootFolder}/playwright-data`,
|
||||
files: `${rootFolder}/playwright-data/downloads`,
|
||||
report: `${rootFolder}/playwright-data/report`,
|
||||
userStates: `${rootFolder}/playwright-data/user-states`,
|
||||
rootFolder,
|
||||
allData: `${rootFolder}/playwright-data`,
|
||||
files: `${rootFolder}/playwright-data/downloads`,
|
||||
report: `${rootFolder}/playwright-data/report`,
|
||||
userStates: `${rootFolder}/playwright-data/user-states`
|
||||
};
|
||||
|
@@ -22,13 +22,12 @@
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
import { resolve } from 'path';
|
||||
import { paths } from '.';
|
||||
import { users } from '../base-config';
|
||||
|
||||
export function getUserState(user: UserType) {
|
||||
return resolve(process.cwd(), `${paths.userStates}/${user}UserState.json`);
|
||||
return resolve(process.cwd(), `${paths.userStates}/${user}UserState.json`);
|
||||
}
|
||||
|
||||
type UserType = keyof typeof users;
|
||||
|
Reference in New Issue
Block a user