Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMM-7 Fix product tour tests #911

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/helper/grafana_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Grafana extends Helper {
Playwright.setPlaywrightRequestHeaders({ Authorization: `Basic ${basicAuthEncoded}` });
}

async enableProductTour() {
async enableProductTour(snooze = false) {
const { Playwright } = this.helpers;

await Playwright.page.route('**/v1/users/me', async (route, request) => {
Expand All @@ -45,7 +45,7 @@ class Grafana extends Helper {
user_id: 1,
product_tour_completed: false,
alerting_tour_completed: false,
snoozed_pmm_version: '',
snoozed_pmm_version: snooze ? '3.2.0' : '',
}),
});
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/pages/homePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
genericOauthUrl: 'graph/login/generic_oauth',
requestEnd: '/v1/Updates/Check',
elements: {
pageContent: locate('//div[@id="pageContent"]'),
pageContent: locate('//main[@id="pageContent"]'),
},
fields: {
systemsUnderMonitoringCount:
Expand Down
8 changes: 6 additions & 2 deletions tests/product-tour/productTour_test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
Feature('Pmm Product tour tests');

Before(async ({ I }) => {
Before(async ({ I, settingsAPI }) => {
await I.stopMockingProductTourApi();
await I.Authorize();
// get request will create the initial state
await I.sendGetRequest('v1/users/me', { Authorization: `Basic ${await I.getAuth()}` });
// todo: it would be better to disable updates once PMM-13608 is fixed
// snooze update modal
await settingsAPI.setTourOptions(false, true, '3.2.0');
});

Scenario('PMM-T1879 Verify that product tour dialog is displayed after check later button pressed. @grafana-pr', async ({ I, homePage }) => {
Expand Down Expand Up @@ -31,7 +35,7 @@ Scenario('PMM-T1881 Verify that product tour dialog contains all the components.
}).config('Playwright', { waitForNavigation: 'load' });

Scenario('PMM-T1882 Verify that product tour dialog is not displayed after skipping @grafana-pr', async ({ I, homePage }) => {
await I.enableProductTour();
await I.enableProductTour(true);
await I.amOnPage('');

await I.waitForElement(homePage.productTour.skipButton);
Expand Down
Loading