[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:
Akash Rathod
2024-09-03 14:16:02 +02:00
committed by GitHub
parent 14bb6b3155
commit 56c2c55daf
66 changed files with 406 additions and 295 deletions

View File

@@ -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);
}