Skip to content

PMM-15241 Add update-snooze test and HelpPage locator - #1127

Open
kiranvuyurru wants to merge 1 commit into
mainfrom
PMM-15241-popup-snooze
Open

PMM-15241 Add update-snooze test and HelpPage locator#1127
kiranvuyurru wants to merge 1 commit into
mainfrom
PMM-15241-popup-snooze

Conversation

@kiranvuyurru

Copy link
Copy Markdown
Contributor

Add a remind-me-later locator to HelpPage and a new Playwright test (PMM-T2263) that verifies the update notification stays snoozed across page reloads and reappears after the snooze duration. The test mocks users.me and server.updates endpoints, sets pmm-ui.dev.updateSnoozeDurationMs in localStorage, and uses Timeouts helpers. Also import apiEndpoints in the test file.

Add a remind-me-later locator to HelpPage and a new Playwright test (PMM-T2263) that verifies the update notification stays snoozed across page reloads and reappears after the snooze duration. The test mocks users.me and server.updates endpoints, sets pmm-ui.dev.updateSnoozeDurationMs in localStorage, and uses Timeouts helpers. Also import apiEndpoints in the test file.
@kiranvuyurru
kiranvuyurru marked this pull request as ready for review July 30, 2026 17:40
Comment on lines +172 to +208
await page.context().unroute(apiEndpoints.users.me);
await page.context().unroute(apiEndpoints.server.updates);
await page.route(apiEndpoints.users.me, async (route) => {
if (route.request().method() === 'PUT') {
const body = route.request().postDataJSON() as { snoozed_pmm_version?: string };

snoozedAt = Date.now();
snoozedVersion = body.snoozed_pmm_version ?? '';
}

await route.fulfill({
body: JSON.stringify({
alerting_tour_completed: true,
product_tour_completed: true,
snoozed_at: snoozedAt ? new Date(snoozedAt).toISOString() : null,
snoozed_pmm_version: snoozedVersion,
user_id: 1,
}),
contentType: 'application/json',
status: 200,
});
});
await page.route(apiEndpoints.server.updates, (route) =>
route.fulfill({
body: JSON.stringify({
installed: {},
last_check: new Date().toISOString(),
latest: {
timestamp: new Date(0).toISOString(),
version: updateVersion,
},
update_available: true,
}),
contentType: 'application/json',
status: 200,
}),
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For these API interactions, don't we have fixtures + methods that wrap those?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have mocks fixture and mockUpdateAvailable(), but nothing for user-snooze API behavior.

@travagliad travagliad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test is failing, please make sure you check the test result before asking for review as you will probably need to change code and we should review it by then

@kiranvuyurru

Copy link
Copy Markdown
Contributor Author

Test is failing, please make sure you check the test result before asking for review as you will probably need to change code and we should review it by then

here is the execution of the test where it passed. https://github.com/percona/pmm-qa/actions/runs/30566783377/job/90964485581

@travagliad

Copy link
Copy Markdown
Contributor

Test is failing, please make sure you check the test result before asking for review as you will probably need to change code and we should review it by then

here is the execution of the test where it passed. percona/pmm-qa/actions/runs/30566783377/job/90964485581

It failed on this run, so it's flaky test?
https://github.com/percona/pmm-qa/actions/runs/30566686568/job/90952850365?pr=1127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants