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-13608 test for update settings #920

Merged
merged 9 commits into from
Jan 14, 2025
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
2 changes: 1 addition & 1 deletion tests/configuration/pages/pmmSettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ module.exports = {
backupManagementSwitchInput: locate('$advanced-backup').find('input'),
callHomeSwitch: '//button[@class="toggle-field ant-switch ant-switch-checked"]',
checkForUpdatesLabel: locate('$advanced-updates').find('span'),
checkForUpdatesSwitch: '//div[@data-testid="advanced-updates"]//div[2]//input',
checkForUpdatesSwitch: locate('$advanced-updates').find('label'),
dataRetentionInput: '$retention-number-input',
dataRetentionLabel: locateLabel('form-field-data-retention'),
errorPopUpElement: I.useDataQA('data-testid Alert error'),
Expand Down
30 changes: 30 additions & 0 deletions tests/configuration/verifyPMMSettingsPageFunctionality_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,33 @@ Scenario.skip(
);
},
).retry(1);

Scenario(
'PMM-T1967 Verify Update modal respects update settings @fb-settings',
async ({
I, homePage, settingsAPI, pmmSettingsPage,
}) => {
await settingsAPI.changeSettings({ updates: true });
await I.usePlaywrightTo('remove users/me mock', async ({ page }) => {
await page.route('**/v1/users/me', (route) => route.continue());
});

I.amOnPage(pmmSettingsPage.advancedSettingsUrl);
I.waitForVisible(homePage.updatesModal.root, 30);
I.click(homePage.updatesModal.closeIcon);
// eslint-disable-next-line no-undef
await tryTo(() => {
I.waitForVisible(homePage.productTour.skipButton, 5);
I.click(homePage.productTour.skipButton);
});
I.click(pmmSettingsPage.fields.checkForUpdatesSwitch);
I.click(pmmSettingsPage.fields.applyButton);
I.refreshPage();
I.waitForVisible(pmmSettingsPage.fields.checkForUpdatesSwitch, 30);
I.dontSeeElement(homePage.updatesModal.root);
I.click(pmmSettingsPage.fields.checkForUpdatesSwitch);
I.click(pmmSettingsPage.fields.applyButton);
I.refreshPage();
I.seeElement(homePage.updatesModal.root);
},
);
13 changes: 13 additions & 0 deletions tests/pages/components/updatesAvailableModal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const { I } = inject();

class UpdatesAvailableModalComponent {
constructor() {
this.root = locate('[role="dialog"]').withDescendant('$multiple-updates-modal');
this.closeIcon = this.root.find('[aria-label="Close"]');
this.dismissButton = this.root.find('button').withText('Dismiss');
this.goToUpdatesPage = this.root.find('button').withText('Go to updates page');
}
}

module.exports = new UpdatesAvailableModalComponent();
module.exports.UpdatesAvailableDialog = UpdatesAvailableModalComponent;
2 changes: 2 additions & 0 deletions tests/pages/homePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ const { I, dashboardPage } = inject();
const assert = require('assert');
const moment = require('moment');
const productTourModal = require('./components/productTourComponent');
const updatesAvailableDialog = require('./components/updatesAvailableModal');

module.exports = {
updatesModal: updatesAvailableDialog,
// insert your locators and methods here
// setting locators
url: 'graph/d/pmm-home/home-dashboard?orgId=1&refresh=1m&from=now-5m&to=now',
Expand Down
Loading