Skip to content

Commit 2d0236b

Browse files
authored
PMM-13329 add wait for upgrade to button (#842)
* PMM-13329 add wait for upgrade to button * PMM-13329 add wait for upgrade to button
1 parent 400e2fe commit 2d0236b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

playwright-tests/pages/home-dashboard.page.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export default class HomeDashboardPage extends BaseDashboard {
2525
await expect(this.page).toHaveURL(this.PAGE_PATH);
2626
}
2727
upgradePmm = async () => {
28-
await this.pmmUpgradeWidget.elements.upgradeButton.waitFor({ state: 'visible', timeout: Wait.ThreeMinutes });
28+
await this.pmmUpgradeWidget.elements.upgradeButton.waitFor({ state: 'visible', timeout: Wait.TwoMinutes });
29+
2930
const currentVersion = await this.pmmUpgradeWidget.elements.currentVersion.textContent();
3031

3132
await this.pmmUpgradeWidget.elements.upgradeButton.click();

playwright-tests/pages/page-components/pmm-upgrade-widget.ts

+8
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,20 @@ export default class PmmUpgradeWidget {
99
elements: any = {
1010
currentVersion: this.containers.upgradeContainer.getByTestId('update-installed-version'),
1111
availableVersion: this.containers.upgradeContainer.getByTestId('update-latest-version'),
12+
checkForUpgradesButton: this.containers.upgradeContainer.getByTestId('update-last-check-button'),
1213
upToDate: this.containers.upgradeContainer.getByText('You are up to date'),
1314
lastUpgradeCheckDate: this.containers.upgradeContainer.getByTestId('update-last-check'),
1415
upgradeButton: this.containers.upgradeContainer.getByText('Upgrade to', { exact: false }),
1516
};
1617

1718
verifyUpgradeWidget = async () => {
19+
await expect(this.elements.checkForUpgradesButton).toBeEnabled({ timeout: Wait.ThreeMinutes });
20+
21+
await expect(async () => {
22+
await this.elements.checkForUpgradesButton.click();
23+
await this.elements.upgradeButton.waitFor({ state: 'visible', timeout: Wait.TwoMinutes });
24+
}).toPass({ timeout: Wait.TenMinutes });
25+
1826
await this.elements.upgradeButton.waitFor({ state: 'visible', timeout: Wait.ThreeMinutes });
1927
await expect(this.elements.upToDate).toBeHidden();
2028
await this.elements.lastUpgradeCheckDate.waitFor({ state: 'visible' });

0 commit comments

Comments
 (0)