Skip to content

Commit

Permalink
Merge pull request #314 from nesrineabdmouleh/FixGoToNextStepInAutoup…
Browse files Browse the repository at this point in the history
…gradeModule

Fix go to next step for autoupgrade configure page
  • Loading branch information
nesrineabdmouleh authored Jan 9, 2025
2 parents 1803b4f + d9ddff3 commit 09d3e9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/interfaces/BO/modules/autoupgrade/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface ModuleAutoupgradeMainPageInterface extends ModuleConfigurationP
readonly updateSuccessMessage: string;

cancelBackup(page:Page):Promise<boolean>;
checkRequirements(page: Page): Promise<string>;
checkRequirements(page: Page): Promise<boolean>;
checkUpdateSuccess(page:Page):Promise<string>;
chooseNewVersion(page:Page):Promise<boolean>;
clickOnLaunchBackup(page:Page):Promise<boolean>;
Expand Down
8 changes: 6 additions & 2 deletions src/versions/develop/pages/BO/modules/autoupgrade/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class Autoupgrade extends ModuleConfiguration implements ModuleAutoupgradeMainPa

private readonly radioCardLoader: string;

private readonly radioCardLoaderWrapper: string;

private readonly checkRequirementBlock: string;

private readonly checkRequirementsFailedAlerts: string;
Expand Down Expand Up @@ -81,6 +83,7 @@ class Autoupgrade extends ModuleConfiguration implements ModuleAutoupgradeMainPa
// 1 : version choose step
this.newVersionRadioButton = '#online';
this.radioCardLoader = '.radio-card__loader-title';
this.radioCardLoaderWrapper = '.radio-card__loader-wrapper';
this.checkRequirementBlock = '.check-requirements';
this.checkRequirementsFailedAlerts = '.check-requirements--failed';
this.goToMaintenancePageLink = '#radio_card_online div.radio-card__check-requirements a[href*="AdminMaintenance"]';
Expand Down Expand Up @@ -144,11 +147,12 @@ class Autoupgrade extends ModuleConfiguration implements ModuleAutoupgradeMainPa
* @param page {Page} Browser tab
* @return {Promise<string}
*/
async checkRequirements(page: Page): Promise<string> {
async checkRequirements(page: Page): Promise<boolean> {
await page.locator(this.checkRequirementsButton).click();
await this.waitForVisibleSelector(page, this.radioCardLoader);
await this.waitForHiddenSelector(page, this.radioCardLoaderWrapper);

return this.getTextContent(page, this.alertSuccessMessage);
return this.elementNotVisible(page, `${this.nextStepButton}[disabled='true']`, 2000);
}

/**
Expand Down

0 comments on commit 09d3e9f

Please sign in to comment.