Rework the "ProjectTree.waitProjectImported" method for avoiding project import rejecting (#18531)

Signed-off-by: Ihor Okhrimenko <iokhrime@redhat.com>
7.24.x
Igor Ohrimenko 2020-12-07 11:02:32 +02:00 committed by GitHub
parent f7822d20de
commit 3af8a5b090
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -93,6 +93,11 @@ export const TimeoutConstants = {
*/
TS_EXPAND_PROJECT_TREE_ITEM_TIMEOUT: Number(process.env.TS_EXPAND_PROJECT_TREE_ITEM_TIMEOUT) || 5_000,
/**
* Timeout for waiting workspace sample import, 50_000 by default.
*/
TS_IMPORT_PROJECT_DEFAULT_POLLING: Number(process.env.TS_SELENIUM_DEFAULT_POLLING) || 50_000,
// -------------------------------------------- EDITOR --------------------------------------------
/**

View File

@ -222,7 +222,7 @@ export class ProjectTree {
async waitProjectImported(projectName: string,
rootSubItem: string,
attempts: number = TestConstants.TS_SELENIUM_DEFAULT_ATTEMPTS,
visibilityItemPolling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING * 5,
visibilityItemPolling: number = TimeoutConstants.TS_IMPORT_PROJECT_DEFAULT_POLLING,
triesPolling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING * 30) {
Logger.debug(`ProjectTree.waitProjectImported "${projectName}" rootSubItem: "${rootSubItem}"`);
@ -238,7 +238,6 @@ export class ProjectTree {
if (!isProjectFolderVisible) {
Logger.trace(`ProjectTree.waitProjectImported project not located, reloading page.`);
await this.driverHelper.reloadPage();
await this.driverHelper.wait(triesPolling);
await this.ide.waitAndSwitchToIdeFrame();
await this.ide.waitIde();
await this.openProjectTreeContainer();
@ -255,7 +254,6 @@ export class ProjectTree {
if (!isRootSubItemVisible) {
Logger.trace(`ProjectTree.waitProjectImported sub-items not found, reloading page.`);
await this.driverHelper.reloadPage();
await this.driverHelper.wait(triesPolling);
await this.ide.waitAndSwitchToIdeFrame();
await this.ide.waitIde();
await this.openProjectTreeContainer();
@ -266,6 +264,7 @@ export class ProjectTree {
}
throw new error.TimeoutError('Exceeded the maximum number of checking attempts, project has not been imported');
}
async waitProjectImportedNoSubfolder(projectName: string,