Skip to content
Open
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
10 changes: 5 additions & 5 deletions codeceptjs-e2e/tests/advisors/stt/sttSettings_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Scenario.skip(
I, pmmSettingsPage, settingsAPI,
}) => {
await settingsAPI.apiDisableSTT();
I.amOnPage(pmmSettingsPage.advancedSettingsUrl);
I.amOnPage(pmmSettingsPage.advisorsSettingsUrl);
I.waitForVisible(pmmSettingsPage.fields.rareIntervalInput, 30);

// Verify Interval fields are disabled and have default values
Expand Down Expand Up @@ -53,7 +53,7 @@ Scenario.skip(
}) => {
const interval = '0.1';

I.amOnPage(pmmSettingsPage.advancedSettingsUrl);
I.amOnPage(pmmSettingsPage.advisorsSettingsUrl);
I.waitForVisible(pmmSettingsPage.fields.rareIntervalInput, 30);

// Set 0.1 values for all 3 intervals
Expand All @@ -65,7 +65,7 @@ Scenario.skip(
I.fillField(pmmSettingsPage.fields.frequentIntervalInput, interval);

// Apply Settings
I.click(pmmSettingsPage.fields.advancedButton);
I.click(pmmSettingsPage.fields.advisorsButton);
I.verifyPopUpMessage(pmmSettingsPage.messages.successPopUpMessage);
I.refreshPage();

Expand All @@ -84,7 +84,7 @@ Scenario.skip(
}) => {
const greaterThanZero = 'Value should be greater or equal to 0.1';

I.amOnPage(pmmSettingsPage.advancedSettingsUrl);
I.amOnPage(pmmSettingsPage.advisorsSettingsUrl);
I.waitForVisible(pmmSettingsPage.fields.rareIntervalInput, 30);

I.clearField(pmmSettingsPage.fields.rareIntervalInput);
Expand All @@ -99,6 +99,6 @@ Scenario.skip(
I.fillField(pmmSettingsPage.fields.frequentIntervalInput, current.input);
I.seeTextEquals(greaterThanZero, pmmSettingsPage.fields.frequentIntervalValidation);

I.seeElementsDisabled(pmmSettingsPage.fields.advancedButton);
I.seeElementsDisabled(pmmSettingsPage.fields.advisorsButton);
},
);
21 changes: 16 additions & 5 deletions codeceptjs-e2e/tests/configuration/pages/pmmSettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = {
publicAddress: process.env.VM_IP ? process.env.VM_IP : process.env.SERVER_IP || '127.0.0.1',
metricsResolutionUrl: '/pmm-ui/settings/metrics-resolution',
advancedSettingsUrl: '/pmm-ui/settings/advanced-settings',
advisorsSettingsUrl: '/pmm-ui/settings/advisors',
sshKeyUrl: '/pmm-ui/settings/ssh-key',
alertManagerIntegrationUrl: 'graph/settings/am-integration',
communicationSettingsUrl: 'graph/settings/communication',
Expand Down Expand Up @@ -82,6 +83,7 @@ module.exports = {
sectionTabsList: {
metrics: 'Metrics Resolution',
advanced: 'Advanced Settings',
advisors: 'Advisors',
ssh: 'SSH Key',
},
sectionButtonText: {
Expand Down Expand Up @@ -122,8 +124,8 @@ module.exports = {
link: links.checkForUpdates,
},
stt: {
nativeTextLocator: locate('$advanced-advisors-label-description').as('Advisors tooltip'),
nativeLinkLocator: locate('$advanced-advisors-label-description').find('a').as('Advisors tooltip Read more link'),
nativeTextLocator: locate('$advisors-label-description').as('Advisors tooltip'),
nativeLinkLocator: locate('$advisors-label-description').find('a').as('Advisors tooltip Read more link'),
Comment on lines +127 to +128

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Map the STT tooltip to the Advisors subpage.

Line 127-128 uses an Advisors-only locator, but getSubpageTooltips() still attaches this tooltip to advancedSettingsUrl at Line 680-685. A subpage tooltip test will open Advanced Settings and fail to find $advisors-label-description.

Remove stt from the Advanced Settings entry and add a separate advisorsSettingsUrl entry.

Proposed mapping
       {
         subPage: this.advancedSettingsUrl,
         tooltips: {
           dataRetention: this.tooltips.advancedSettings.dataRetention,
           telemetry: this.tooltips.advancedSettings.telemetry,
-          stt: this.tooltips.advancedSettings.stt,
         },
       },
+      {
+        subPage: this.advisorsSettingsUrl,
+        tooltips: {
+          stt: this.tooltips.advancedSettings.stt,
+        },
+      },
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@codeceptjs-e2e/tests/configuration/pages/pmmSettingsPage.js` around lines 127
- 128, Update getSubpageTooltips() so the stt tooltip is removed from the
advancedSettingsUrl entry and mapped under a separate advisorsSettingsUrl entry,
matching the Advisors tooltip locators defined by nativeTextLocator and
nativeLinkLocator.

text: 'Run automated checks to identify potential database performance and configuration issues.',
link: links.advisorsDocs,
},
Expand Down Expand Up @@ -248,6 +250,7 @@ module.exports = {
fields: {
advancedLabel: '$advanced-label',
advancedButton: '$advanced-button',
advisorsButton: '$advisors-button',
addAlertRuleButton: '//span[text()="Apply Alertmanager settings"]/parent::span',
alertRulesInput: '$alertmanager-rules',
alertURLInput: '$alertmanager-url',
Expand Down Expand Up @@ -304,9 +307,9 @@ module.exports = {
sshKeyInput: '$ssh-key',
sshKeyLabel: '$ssh-key-label',
sshKeyButton: '$ssh-key-button',
sttLabel: locate('$advanced-advisors').find('span'),
sttSwitchSelectorInput: locate('$advanced-advisors').find('input'),
sttSwitchSelector: locate('$advanced-advisors').find('label'),
sttLabel: locate('$advisors-settings').find('span'),
sttSwitchSelectorInput: locate('$advisors-settings').find('input'),
sttSwitchSelector: locate('$advisors-settings').find('label'),
subSectionHeader: '//following-sibling::div//div[@class="ant-collapse-header"]',
signUpEmail: '$email-text-input',
signUpPassword: '$password-password-input',
Expand Down Expand Up @@ -342,6 +345,11 @@ module.exports = {
await this.waitForPmmSettingsPageLoaded();
},

async openAdvisorsSettings() {
I.amOnPage(this.advisorsSettingsUrl);
await this.waitForPmmSettingsPageLoaded();
},

async applyChanges() {
I.click(this.fields.applyButton);
I.verifyPopUpMessage(this.messages.successPopUpMessage, 30);
Expand All @@ -368,6 +376,9 @@ module.exports = {
case 'advanced settings':
sectionExpandLocator = I.useDataQA('settings-tab-advanced');
break;
case 'advisors':
sectionExpandLocator = I.useDataQA('settings-tab-advisors');
break;
case 'ssh key':
sectionExpandLocator = I.useDataQA('settings-tab-ssh');
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,17 @@ Scenario('Verify Advanced Section Elements @settings @grafana-pr', async ({ I, p
I.see('Data retention', pmmSettingsPage.fields.advancedLabel);
I.see('Telemetry', pmmSettingsPage.fields.telemetryLabel);
I.see('Check for updates', pmmSettingsPage.fields.checkForUpdatesLabel);
I.see('Advisors', pmmSettingsPage.fields.sttLabel);
I.seeElement(pmmSettingsPage.fields.telemetrySwitchSelectorInput);
I.seeElement(pmmSettingsPage.fields.telemetryLabel);
I.seeElement(pmmSettingsPage.fields.checkForUpdatesSwitch);
I.seeElement(pmmSettingsPage.fields.checkForUpdatesLabel);
});

Scenario('Verify Advisors Section Elements @settings @grafana-pr', async ({ I, pmmSettingsPage }) => {
I.amOnPage(pmmSettingsPage.advisorsSettingsUrl);

await pmmSettingsPage.waitForPmmSettingsPageLoaded();
I.see('Advisors', pmmSettingsPage.fields.sttLabel);
I.seeElement(pmmSettingsPage.fields.sttSwitchSelectorInput);
I.seeElement(pmmSettingsPage.fields.sttLabel);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ Scenario(
Scenario.skip(
'PMM-T253 - Verify user can see correct tooltip for STT [trivial] @settings @stt @grafana-pr',
async ({ I, pmmSettingsPage }) => {
const sectionNameToExpand = pmmSettingsPage.sectionTabsList.advanced;
const sectionNameToExpand = pmmSettingsPage.sectionTabsList.advisors;

I.amOnPage(pmmSettingsPage.url);
await pmmSettingsPage.waitForPmmSettingsPageLoaded();
await pmmSettingsPage.expandSection(sectionNameToExpand, pmmSettingsPage.fields.advancedButton);
await pmmSettingsPage.expandSection(sectionNameToExpand, pmmSettingsPage.fields.advisorsButton);
await pmmSettingsPage.waitForPmmSettingsPageLoaded();

await pmmSettingsPage.verifyTooltip(pmmSettingsPage.tooltips.advancedSettings.stt);
Expand All @@ -60,17 +60,21 @@ Scenario.skip(
Scenario.skip(
'PMM-T254 + PMM-T253 - Verify disable telemetry while Advisors enabled @settings @stt @grafana-pr',
async ({ I, pmmSettingsPage }) => {
I.amOnPage(pmmSettingsPage.advisorsSettingsUrl);
await pmmSettingsPage.waitForPmmSettingsPageLoaded();
pmmSettingsPage.verifySwitch(pmmSettingsPage.fields.sttSwitchSelectorInput, 'on');
I.amOnPage(pmmSettingsPage.advancedSettingsUrl);
await pmmSettingsPage.waitForPmmSettingsPageLoaded();
pmmSettingsPage.verifySwitch(pmmSettingsPage.fields.telemetrySwitchSelectorInput, 'on');
pmmSettingsPage.verifySwitch(pmmSettingsPage.fields.sttSwitchSelectorInput, 'on');
I.click(pmmSettingsPage.fields.telemetrySwitchSelector);
pmmSettingsPage.verifySwitch(pmmSettingsPage.fields.telemetrySwitchSelectorInput, 'off');
I.click(pmmSettingsPage.fields.advancedButton);
I.refreshPage();
await pmmSettingsPage.waitForPmmSettingsPageLoaded();
pmmSettingsPage.verifySwitch(pmmSettingsPage.fields.sttSwitchSelectorInput, 'on');
pmmSettingsPage.verifySwitch(pmmSettingsPage.fields.telemetrySwitchSelectorInput, 'off');
I.amOnPage(pmmSettingsPage.advisorsSettingsUrl);
await pmmSettingsPage.waitForPmmSettingsPageLoaded();
pmmSettingsPage.verifySwitch(pmmSettingsPage.fields.sttSwitchSelectorInput, 'on');
},
);

Expand Down
6 changes: 3 additions & 3 deletions codeceptjs-e2e/tests/upgrade/advisorsAlerting_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ Scenario(
I,
pmmSettingsPage,
}) => {
I.amOnPage(pmmSettingsPage.advancedSettingsUrl);
I.amOnPage(pmmSettingsPage.advisorsSettingsUrl);
I.waitForVisible(pmmSettingsPage.fields.rareIntervalInput, 30);
I.fillField(pmmSettingsPage.fields.rareIntervalInput, rareInterval);
I.fillField(pmmSettingsPage.fields.standartIntervalInput, standardInterval);
I.fillField(pmmSettingsPage.fields.frequentIntervalInput, frequentInterval);
I.click(pmmSettingsPage.fields.advancedButton);
I.click(pmmSettingsPage.fields.advisorsButton);
I.waitForValue(pmmSettingsPage.fields.rareIntervalInput, rareInterval, 5);
I.waitForValue(pmmSettingsPage.fields.standartIntervalInput, standardInterval, 5);
I.waitForValue(pmmSettingsPage.fields.frequentIntervalInput, frequentInterval, 5);
Expand All @@ -118,7 +118,7 @@ Scenario(
I,
pmmSettingsPage,
}) => {
I.amOnPage(pmmSettingsPage.advancedSettingsUrl);
I.amOnPage(pmmSettingsPage.advisorsSettingsUrl);
I.switchTo();
I.waitForVisible(pmmSettingsPage.fields.rareIntervalInput, 30);

Expand Down
9 changes: 7 additions & 2 deletions e2e_tests/pages/ha/settings.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@ export default class SettingsPage extends BasePage {
url = '/pmm-ui/settings';
urls = {
advanced: '/pmm-ui/settings/advanced-settings',
advisors: '/pmm-ui/settings/advisors',
metrics: '/pmm-ui/settings/metrics-resolution',
ssh: '/pmm-ui/settings/ssh-key',
};
haQanErrorMessage = "Enabling QAN on PMM's own database is not supported in HA mode.";
tabs = {
advanced: this.page.getByTestId('settings-tab-advanced'),
advisors: this.page.getByTestId('settings-tab-advisors'),
metrics: this.page.getByTestId('settings-tab-metrics'),
ssh: this.page.getByTestId('settings-tab-ssh'),
};
builders = {};
buttons = {
applyAdvancedChanges: this.page.getByTestId('advanced-button'),
applyAdvisorsChanges: this.page.getByTestId('advisors-button'),
applyMetricsChanges: this.page.getByTestId('metrics-resolution-button'),
applySshKeyChanges: this.page.getByTestId('ssh-key-button'),
getPublicAddressFromBrowser: this.page.getByRole('button', { name: 'Get from browser' }),
Expand Down Expand Up @@ -51,8 +54,10 @@ export default class SettingsPage extends BasePage {

enableToggleAndApplyChanges = async (toggleName: keyof typeof this.buttons.toggles): Promise<void> =>
await pmmTest.step(`Enable ${toggleName} and apply changes`, async () => {
await this.page.goto(this.urls.advanced);
const isAdvisors = toggleName === 'advisors';

await this.page.goto(isAdvisors ? this.urls.advisors : this.urls.advanced);
await this.buttons.toggles[toggleName].locator.click();
await this.buttons.applyAdvancedChanges.click();
await (isAdvisors ? this.buttons.applyAdvisorsChanges : this.buttons.applyAdvancedChanges).click();
});
}
Loading