diff --git a/tests/configuration/pages/agentsPage.js b/tests/configuration/pages/agentsPage.js index 8d233eb23..15f1b9743 100644 --- a/tests/configuration/pages/agentsPage.js +++ b/tests/configuration/pages/agentsPage.js @@ -15,7 +15,7 @@ module.exports = { pagination: paginationPart, async open(serviceId) { - I.amOnPage(`graph/inventory/services/${serviceId.split('/')[2]}/agents`); + I.amOnPage(`graph/inventory/services/${serviceId}/agents`); await I.waitForVisible(this.fields.backLink, 30); }, diff --git a/tests/configuration/pages/pmmInventoryPage.js b/tests/configuration/pages/pmmInventoryPage.js index a5bb393b1..441613425 100644 --- a/tests/configuration/pages/pmmInventoryPage.js +++ b/tests/configuration/pages/pmmInventoryPage.js @@ -19,7 +19,7 @@ module.exports = { backToServices: '//span[text()="Go back to services"]', agentsLinkNew: '//div[contains(@data-testid,"status-badge")]', detailsLabelByText: (label) => locate('[aria-label="Tags"]').find(`//li/span[contains(text(), "${label}")]`), - agentDetailsLabelByText: (label) => locate('[aria-label="Tags"]').find('li').withText(label), + agentDetailsLabelByText: (label) => locate('$details-row-content').find('li').withText(label), agentsLink: locate('[role="tablist"] a').withText('Agents').withAttr({ 'aria-label': 'Tab Agents' }), agentsLinkOld: locate('a').withText('Agents'), cluster: '$cluster-text-input', diff --git a/tests/configuration/pages/pmmSettingsPage.js b/tests/configuration/pages/pmmSettingsPage.js index 1bfb79002..ec5464c3f 100644 --- a/tests/configuration/pages/pmmSettingsPage.js +++ b/tests/configuration/pages/pmmSettingsPage.js @@ -363,7 +363,7 @@ module.exports = { }, async expandSection(sectionName, expectedContentLocator) { - const sectionExpandLocator = locate('a').withText(sectionName); + const sectionExpandLocator = locate(`[aria-label="Tab ${sectionName}"]`); I.click(sectionExpandLocator); I.waitForVisible(expectedContentLocator, 30); diff --git a/tests/configuration/verifyPMMSettingsPageFunctionality_test.js b/tests/configuration/verifyPMMSettingsPageFunctionality_test.js index ef38a4c18..b264cfe23 100644 --- a/tests/configuration/verifyPMMSettingsPageFunctionality_test.js +++ b/tests/configuration/verifyPMMSettingsPageFunctionality_test.js @@ -218,7 +218,7 @@ Scenario( Scenario( 'PMM-T254 ensure Advisors are on by default @instances', async ({ settingsAPI }) => { - const resp = await settingsAPI.getSettings('stt_enabled'); + const resp = await settingsAPI.getSettings('advisor_enabled'); assert.ok(resp, `Advisors should be turned on by default from 2.28.0 release but found ${resp}`); }, diff --git a/tests/helper/constants.js b/tests/helper/constants.js index 64b6b2192..9ee314536 100644 --- a/tests/helper/constants.js +++ b/tests/helper/constants.js @@ -25,6 +25,16 @@ const AGENT_STATUS = { UNKNOWN: 'AGENT_STATUS_UNKNOWN', }; +const CLI_AGENT_STATUS = { + UNSPECIFIED: 'UNSPECIFIED', + STARTING: 'STARTING', + RUNNING: 'RUNNING', + WAITING: 'WAITING', + STOPPING: 'STOPPING', + DONE: 'DONE', + UNKNOWN: 'UNKNOWN', +}; + const NODE_TYPE = { UNSPECIFIED: 'NODE_TYPE_UNSPECIFIED', GENERIC: 'NODE_TYPE_GENERIC_NODE', @@ -51,6 +61,7 @@ module.exports = { SERVICE_TYPE, NODE_STATUS, AGENT_STATUS, + CLI_AGENT_STATUS, NODE_TYPE, DISCOVER_RDS, AGENT_TYPE, diff --git a/tests/ia/alertRules_test.js b/tests/ia/alertRules_test.js index 73d10f2fd..d631a8748 100644 --- a/tests/ia/alertRules_test.js +++ b/tests/ia/alertRules_test.js @@ -63,11 +63,7 @@ Scenario( I.waitForVisible(columnHeader, 30); }); - const folderUID = await rulesAPI.getFolderUID(ruleFolder); - - I.seeElement(alertRulesPage.buttons.goToFolderButton(folderUID, ruleFolder.toLowerCase())); - I.seeElement(alertRulesPage.buttons.managePermissionsButton(folderUID, ruleFolder.toLowerCase())); - I.seeElement(alertRulesPage.elements.totalRulesCounter('1 rule', ruleFolder)); + I.seeElement(alertRulesPage.elements.alertRuleNameByName(ruleName)); await rulesAPI.removeAlertRule(ruleFolder); }, ); @@ -148,8 +144,7 @@ Scenario( const editedRule = { ruleName: 'EDITED rule', duration: '2m', - severity: 'Alert', - folder: 'Experimental', + folder: 'PostgreSQL', }; await rulesAPI.createAlertRule({ ruleName }, ruleFolder); @@ -177,10 +172,13 @@ Scenario( alertRulesPage.verifyRuleList(ruleFolder, ruleName); I.waitForElement(alertRulesPage.buttons.ruleCollapseButton); I.click(alertRulesPage.buttons.ruleCollapseButton); + alertRulesPage.openMoreMenu(ruleName); I.click(alertRulesPage.buttons.deleteAlertRule); I.waitForText(alertRulesPage.messages.confirmDelete, iaCommon.elements.modalDialog); I.click(alertRulesPage.buttons.cancelModal); + alertRulesPage.openMoreMenu(ruleName); I.click(alertRulesPage.buttons.deleteAlertRule); + I.waitForElement(iaCommon.elements.modalDialog, 10); I.click(alertRulesPage.buttons.confirmModal); I.verifyPopUpMessage(alertRulesPage.messages.successfullyDeleted); I.dontSeeElement(alertRulesPage.buttons.groupCollapseButton(ruleFolder)); diff --git a/tests/ia/alerts_test.js b/tests/ia/alerts_test.js index 3d53d33f7..55a6434d8 100644 --- a/tests/ia/alerts_test.js +++ b/tests/ia/alerts_test.js @@ -41,8 +41,8 @@ AfterSuite(async ({ rulesAPI, I }) => { await I.verifyCommand('docker compose -f docker-compose-webhook.yml stop'); }); -Scenario.skip( - 'PMM-T1482 Verify fired alert @alerting-fb', +Scenario( + 'PMM-T1482 Verify fired alert @ia', async ({ I, alertsPage, alertsAPI }) => { await alertsAPI.waitForAlerts(24, 1); await I.amOnPage(alertsPage.url); @@ -59,8 +59,8 @@ Scenario.skip( }, ); -Scenario.skip( - 'PMM-T1494 PMM-T1495 Verify fired alert in Pager Duty and Webhook @alerting-fb', +Scenario( + 'PMM-T1494 PMM-T1495 Verify fired alert in Pager Duty and Webhook @ia', async ({ I, alertsAPI, rulesAPI }) => { const file = './testdata/ia/scripts/alert.txt'; const alertUID = await rulesAPI.getAlertUID(ruleName, ruleFolder); @@ -71,12 +71,12 @@ Scenario.skip( I.seeInThisFile(ruleName); // Pager Duty notification check - await alertsAPI.verifyAlertInPagerDuty(alertUID); + // await alertsAPI.verifyAlertInPagerDuty(alertUID); }, ); -Scenario.skip( - 'PMM-T1496 PMM-T1497 Verify it is possible to silence and unsilence alert @alerting-fb', +Scenario( + 'PMM-T1496 PMM-T1497 Verify it is possible to silence and unsilence alert @ia', async ({ I, alertsPage, alertmanagerAPI, }) => { @@ -93,8 +93,8 @@ Scenario.skip( }, ); -Scenario.skip( - 'PMM-T1498 Verify firing alerts dissappear when the condition is fixed @alerting-fb', +Scenario( + 'PMM-T1498 Verify firing alerts dissappear when the condition is fixed @ia', async ({ I, alertsPage, alertRulesPage, }) => { @@ -112,8 +112,8 @@ Scenario.skip( ); // FIXME: Skip until https://jira.percona.com/browse/PMM-11130 is fixed -Scenario.skip( - 'PMM-T659 Verify alerts are deleted after deleting rules @alerting-fb', +Scenario( + 'PMM-T659 Verify alerts are deleted after deleting rules @ia', async ({ I, alertsPage, rulesAPI }) => { // Deleting rules await rulesAPI.removeAllAlertRules(); @@ -133,7 +133,7 @@ Scenario.skip( { label: 'service_name', regexp: 'wrong-service', - type: 'MATCH', + type: 'FILTER_TYPE_MATCH', }, ], }; @@ -145,8 +145,8 @@ Scenario.skip( }, ); -Scenario.skip( - 'PMM-T564 Verify fired alert severity colors @alerting-fb', +Scenario( + 'PMM-T564 Verify fired alert severity colors @ia', async ({ I, alertsPage, rulesAPI, alertsAPI, }) => { @@ -171,7 +171,7 @@ Scenario.skip( }, ); -Scenario.skip( +Scenario( 'PMM-T1467 Verify empty Fired alerts list @alerting-fb', async ({ I, alertsPage, rulesAPI }) => { await rulesAPI.removeAllAlertRules(); diff --git a/tests/ia/common_test.js b/tests/ia/common_test.js index 2d156f4cb..d17700ed6 100644 --- a/tests/ia/common_test.js +++ b/tests/ia/common_test.js @@ -40,21 +40,21 @@ Scenario( I.wait(10); // PMM-T776 const verifyTitle = (page) => { - I.seeTitleEquals(`${page} - Alerting - Percona Monitoring and Management`); + I.seeTitleEquals(`${page} - Percona Monitoring and Management`); }; verifyTitle('Fired alerts'); - iaCommon.openAndVerifyTab( + await iaCommon.openAndVerifyTab( iaCommon.tabNames.ruleTemplates, ruleTemplatesPage.buttons.openAddTemplateModal, ruleTemplatesPage.url, ); verifyTitle('Alert rule templates'); - iaCommon.openAndVerifyTab(iaCommon.tabNames.alertRules, alertRulesPage.buttons.newAlertRule, alertRulesPage.url); + await iaCommon.openAndVerifyTab(iaCommon.tabNames.alertRules, alertRulesPage.buttons.newAlertRule, alertRulesPage.url); verifyTitle('Alert rules'); - iaCommon.openAndVerifyTab(iaCommon.tabNames.contactPoints, contactPointsPage.buttons.newContactPoint, contactPointsPage.url); + await iaCommon.openAndVerifyTab(iaCommon.tabNames.contactPoints, contactPointsPage.buttons.newContactPoint, contactPointsPage.url); verifyTitle('Contact points'); - iaCommon.openAndVerifyTab(iaCommon.tabNames.notificationPolicies, nPoliciesPage.buttons.newPolicy, nPoliciesPage.url); + await iaCommon.openAndVerifyTab(iaCommon.tabNames.notificationPolicies, nPoliciesPage.buttons.newPolicy, nPoliciesPage.url); verifyTitle('Notification policies'); // PMM-T620 @@ -65,8 +65,8 @@ Scenario( verifyTitle('Silences'); await iaCommon.openAndVerifyTab(iaCommon.tabNames.alertGroups, alertGroupsPage.elements.groupByContainer, alertGroupsPage.url); verifyTitle('Alert groups'); - await iaCommon.openAndVerifyTab(iaCommon.tabNames.admin, aiAdminPage.elements.configTextarea, aiAdminPage.url); - verifyTitle('Admin'); + await iaCommon.openAndVerifyTab(iaCommon.tabNames.admin, aiAdminPage.buttons.editConfig, aiAdminPage.url); + verifyTitle('Settings'); await iaCommon.openAndVerifyTab(iaCommon.tabNames.firedAlerts, alertsPage.elements.noAlerts, alertsPage.url); }, ); diff --git a/tests/ia/contactPoints_test.js b/tests/ia/contactPoints_test.js index ba6ed0572..74dbfc176 100644 --- a/tests/ia/contactPoints_test.js +++ b/tests/ia/contactPoints_test.js @@ -12,73 +12,73 @@ Before(async ({ I }) => { await I.Authorize(); }); -Data(contactPoints).Scenario( - 'PMM-T1703 Verify Slack contact point can be created, ' - + 'PMM-T1709 Verify Webhook contact point can be created @alerting-fb', - async ({ I, current }) => { - await contactPointsPage.openContactPointsTab(); - await contactPointsPage.createCP(current.name, current.type); - I.click(contactPointsPage.buttons.saveCP); - I.verifyPopUpMessage(contactPointsPage.messages.cPCreatedSuccess); - await contactPointsPage.verifyCPInTable(current.name); - }, -); +// Data(contactPoints).Scenario( +// 'PMM-T1703 Verify Slack contact point can be created, ' +// + 'PMM-T1709 Verify Webhook contact point can be created @alerting-fb', +// async ({ I, current }) => { +// await contactPointsPage.openContactPointsTab(); +// await contactPointsPage.createCP(current.name, current.type); +// I.click(contactPointsPage.buttons.saveCP); +// I.verifyPopUpMessage(contactPointsPage.messages.cPCreatedSuccess); +// await contactPointsPage.verifyCPInTable(current.name); +// }, +// ); +// +// Data(contactPoints).Scenario( +// 'PMM-T1707 Verify Slack contact point can be edited @alerting-fb', +// async ({ I, current }) => { +// await contactPointsPage.openContactPointsTab(); +// await contactPointsPage.editCP(current.name); +// I.appendField(contactPointsPage.fields.cPName, editedCPName); +// I.click(contactPointsPage.buttons.saveCP); +// I.verifyPopUpMessage(contactPointsPage.messages.cPEditedSuccess); +// await contactPointsPage.verifyCPInTable(current.name + editedCPName); +// }, +// ); +// +// Scenario( +// 'PMM-T1706 Verify default contact point cannot be deleted @alerting-fb', +// async ({ I }) => { +// await contactPointsPage.openContactPointsTab(); +// await contactPointsPage.openMoreMenu('default'); +// I.waitForVisible(contactPointsPage.buttons.deleteCP, 10); +// I.seeAttributesOnElements(contactPointsPage.buttons.deleteCP, { disabled: 'true' }); +// }, +// ); +// +// Data(contactPoints).Scenario( +// 'PMM-T1704 Verify Slack contact point can be deleted @alerting-fb', +// async ({ I, current }) => { +// const name = current.name + editedCPName; +// +// await contactPointsPage.openContactPointsTab(); +// await contactPointsPage.deleteCP(name); +// I.waitForVisible(contactPointsPage.elements.deleteCPDialogHeader, 10); +// I.see(contactPointsPage.messages.deleteCPConfirm(name)); +// I.click(contactPointsPage.buttons.confirmDeleteCP); +// I.verifyPopUpMessage(contactPointsPage.messages.cPDeletedSuccess); +// I.dontSee(name, contactPointsPage.elements.cPTable); +// }, +// ); -Data(contactPoints).Scenario( - 'PMM-T1707 Verify Slack contact point can be edited @alerting-fb', - async ({ I, current }) => { - await contactPointsPage.openContactPointsTab(); - await contactPointsPage.editCP(current.name); - I.appendField(contactPointsPage.fields.cPName, editedCPName); - I.click(contactPointsPage.buttons.saveCP); - I.verifyPopUpMessage(contactPointsPage.messages.cPEditedSuccess); - await contactPointsPage.verifyCPInTable(current.name + editedCPName); - }, -); - -Scenario( - 'PMM-T1706 Verify default contact point cannot be deleted @alerting-fb', - async ({ I }) => { - await contactPointsPage.openContactPointsTab(); - await contactPointsPage.openMoreMenu('default'); - I.waitForVisible(contactPointsPage.buttons.deleteCP, 10); - I.seeAttributesOnElements(contactPointsPage.buttons.deleteCP, { disabled: 'true' }); - }, -); - -Data(contactPoints).Scenario( - 'PMM-T1704 Verify Slack contact point can be deleted @alerting-fb', - async ({ I, current }) => { - const name = current.name + editedCPName; - - await contactPointsPage.openContactPointsTab(); - await contactPointsPage.deleteCP(name); - I.waitForVisible(contactPointsPage.elements.deleteCPDialogHeader, 10); - I.see(contactPointsPage.messages.deleteCPConfirm(name)); - I.click(contactPointsPage.buttons.confirmDeleteCP); - I.verifyPopUpMessage(contactPointsPage.messages.cPDeletedSuccess); - I.dontSee(name, contactPointsPage.elements.cPTable); - }, -); - -Scenario( - 'PMM-T1710 Verify saving a contact point when required info is missing, ' - + 'PMM-T1711 Verify contact point test @alerting-fb', - async ({ I, iaCommon }) => { - await contactPointsPage.openContactPointsTab(); - I.waitForVisible(contactPointsPage.buttons.newContactPoint, 10); - I.click(contactPointsPage.buttons.newContactPoint); - I.waitForVisible(contactPointsPage.buttons.saveCP, 10); - I.click(contactPointsPage.buttons.saveCP); - I.verifyPopUpMessage(contactPointsPage.messages.missingRequired); - I.click(contactPointsPage.fields.cPType); - I.waitForVisible(iaCommon.elements.selectDropdownOption('PagerDuty'), 10); - I.click(iaCommon.elements.selectDropdownOption('PagerDuty')); - I.fillField(contactPointsPage.fields.cPName, 'test'); - I.fillField(contactPointsPage.fields.pagerDutyKey, process.env.PAGER_DUTY_SERVICE_KEY); - I.click(contactPointsPage.buttons.testCP); - I.see(contactPointsPage.messages.testNotification, iaCommon.elements.modalDialog); - I.click(contactPointsPage.buttons.sendTest); - I.verifyPopUpMessage(contactPointsPage.messages.testSent); - }, -); +// Scenario( +// 'PMM-T1710 Verify saving a contact point when required info is missing, ' +// + 'PMM-T1711 Verify contact point test @alerting-fb', +// async ({ I, iaCommon }) => { +// await contactPointsPage.openContactPointsTab(); +// I.waitForVisible(contactPointsPage.buttons.newContactPoint, 10); +// I.click(contactPointsPage.buttons.newContactPoint); +// I.waitForVisible(contactPointsPage.buttons.saveCP, 10); +// I.click(contactPointsPage.buttons.saveCP); +// I.verifyPopUpMessage(contactPointsPage.messages.missingRequired); +// I.click(contactPointsPage.fields.cPType); +// I.waitForVisible(iaCommon.elements.selectDropdownOption('PagerDuty'), 10); +// I.click(iaCommon.elements.selectDropdownOption('PagerDuty')); +// I.fillField(contactPointsPage.fields.cPName, 'test'); +// I.fillField(contactPointsPage.fields.pagerDutyKey, process.env.PAGER_DUTY_SERVICE_KEY); +// I.click(contactPointsPage.buttons.testCP); +// I.see(contactPointsPage.messages.testNotification, iaCommon.elements.modalDialog); +// I.click(contactPointsPage.buttons.sendTest); +// I.verifyPopUpMessage(contactPointsPage.messages.testSent); +// }, +// ); diff --git a/tests/ia/pages/alertRulesPage.js b/tests/ia/pages/alertRulesPage.js index bdb9395ca..7b477c876 100644 --- a/tests/ia/pages/alertRulesPage.js +++ b/tests/ia/pages/alertRulesPage.js @@ -1,6 +1,9 @@ const { I } = inject(); +const Promise = require('mongodb/lib/core/topologies/read_preference'); const { rules, templates, filterOperators } = require('./testData'); +const rowByAlertRuleName = (ruleName) => `//div[@data-testid="row"][div[@data-column="Name" and contains(text(), "${ruleName}")]]`; + module.exports = { url: 'graph/alerting/list', columnHeaders: ['State', 'Name', 'Health', 'Summary'], @@ -13,8 +16,9 @@ module.exports = { columnHeaderLocator: (columnHeaderText) => locate('$header').withText(columnHeaderText), ruleNameValue: 'div[data-column=\'Name\']', ruleState: (text) => `//span[contains(.,'${text}')]`, - ruleDetails: 'div[data-testid=\'expanded-content\']', - searchByDataSourceDropdown: '//div[@aria-label="Data source picker select container"]', + alertRuleNameByName: (ruleName) => locate(rowByAlertRuleName(ruleName)).find('div[data-column="Name"]'), + ruleDetails: I.useDataQA('data-testid expanded-content'), + searchByDataSourceDropdown: I.useDataQA('data-testid Data source picker select container'), searchByLabel: '$input-wrapper', // eslint-disable-next-line no-inline-comments ruleFilterLocator: (ruleFilterText) => locate('label').withText(ruleFilterText).after('//input[@type="radio"]'), @@ -32,15 +36,16 @@ module.exports = { saveAndExit: locate('button').withText('Save rule and exit'), editAlertRule: '//a[contains(@href, \'edit?returnTo=%2Falerting%2Flist\')]', editRuleOnView: '//span[text()="Edit"]', - deleteAlertRule: locate('span').withText('Delete').inside('button'), + deleteAlertRule: locate('[role="menuitem"]').withText('Delete'), groupCollapseButton: (folderText) => `//button[@data-testid='data-testid group-collapse-toggle'][following::div/h3[contains(., '${folderText}')]]`, ruleCollapseButton: 'button[aria-label=\'Expand row\']', goToFolderButton: (folderID, folderText) => locate('[aria-label="go to folder"]').withAttr({ href: `/graph/dashboards/f/${folderID}/${folderText}` }), managePermissionsButton: (folderID, folderText) => locate('[aria-label="manage permissions"]').withAttr({ href: `/graph/dashboards/f/${folderID}/${folderText}/permissions` }), - confirmModal: 'button[aria-label=\'Confirm Modal Danger Button\']', + confirmModal: I.useDataQA('data-testid Confirm Modal Danger Button'), cancelModal: locate('button').withText('Cancel'), newEvaluationGroup: I.useDataQA('data-testid alert-rule new-evaluation-group-button'), evaluationGroupCreate: I.useDataQA('data-testid alert-rule new-evaluation-group-create-button'), + moreMenuByAlertRuleName: (ruleName) => locate(rowByAlertRuleName(ruleName)).find('[aria-label="More"]'), }, fields: { // searchDropdown returns a locator of a search input for a given label @@ -59,7 +64,7 @@ module.exports = { evaluationGroupName: I.useDataQA('data-testid alert-rule new-evaluation-group-name'), }, messages: { - noRulesFound: 'You haven`t created any alert rules yet', + noRulesFound: 'You haven\'t created any alert rules yet', confirmDelete: 'Deleting this rule will permanently remove it from your alert rule list. Are you sure you want to delete this rule?', successRuleCreate: (name) => `Rule "${name}" saved.`, successRuleEdit: (name) => `Rule "${name}" updated.`, @@ -106,10 +111,10 @@ module.exports = { I.waitForVisible(this.fields.inputField('name')); I.fillField(this.fields.inputField('name'), ruleName); - this.selectFolder(folder); - I.fillField(this.fields.editRuleSeverity, severity); + // this.selectFolder(folder); + // I.fillField(this.fields.editRuleSeverity, severity); I.fillField(this.fields.editRuleThreshold, duration); - I.fillField(this.fields.editRuleEvaluate, '10s'); + // I.fillField(this.fields.editRuleEvaluate, '10s'); I.click(this.buttons.saveAndExit); I.verifyPopUpMessage(this.messages.successRuleEdit(ruleName)); }, @@ -141,18 +146,14 @@ module.exports = { verifyRuleDetails(ruleObj) { const { - ruleName, duration, folder, severity, + ruleName, duration, folder, } = ruleObj; this.verifyRuleList(folder, ruleName); I.seeElement(this.buttons.ruleCollapseButton); I.click(this.buttons.ruleCollapseButton); I.waitForElement(this.elements.ruleDetails); - I.seeTextEquals(duration, this.elements.detailsDurationValue); - I.waitForElement(this.elements.detailsSeverityLabel(severity)); - I.see(severity, this.elements.detailsSeverityLabel(severity)); - I.waitForElement(this.elements.detailsFolderLabel(folder)); - I.see(folder, this.elements.detailsFolderLabel(folder)); + I.see(`Pending period ${duration}`, this.elements.ruleDetails); }, verifyRuleList(folder, ruleName) { @@ -164,4 +165,10 @@ module.exports = { verifyRuleState(ruleName, timeOut) { I.waitForText(ruleName, timeOut, this.elements.ruleState(ruleName)); }, + + openMoreMenu(ruleName) { + I.waitForVisible(this.buttons.moreMenuByAlertRuleName(ruleName), 30); + I.click(this.buttons.moreMenuByAlertRuleName(ruleName)); + I.waitForVisible(this.buttons.deleteAlertRule, 10); + }, }; diff --git a/tests/ia/pages/alertingAdminPage.js b/tests/ia/pages/alertingAdminPage.js index 73d74de70..d86286a54 100644 --- a/tests/ia/pages/alertingAdminPage.js +++ b/tests/ia/pages/alertingAdminPage.js @@ -4,10 +4,9 @@ const { I } = inject(); module.exports = { url: 'graph/alerting/admin', - elements: { - configTextarea: 'textarea[id=\'configuration\']', - }, + elements: {}, buttons: { + editConfig: locate('button').withText('Edit configuration'), }, messages: { }, diff --git a/tests/ia/pages/alertsPage.js b/tests/ia/pages/alertsPage.js index 241741800..b43cba502 100644 --- a/tests/ia/pages/alertsPage.js +++ b/tests/ia/pages/alertsPage.js @@ -21,7 +21,7 @@ module.exports = { debugSeverity: '//td[4]/span[text()="Debug"]', infoSeverity: '//td[4]/span[text()="Info"]', columnHeaderLocator: (columnHeaderText) => `//th[text()="${columnHeaderText}"]`, - noAlerts: '//h1[text()=\' No alerts detected\']', + noAlerts: locate('$table-no-data').withText('No alerts detected'), firedAlertLink: (alertName) => `//a[text()="${alertName}"]`, }, buttons: { diff --git a/tests/ia/pages/api/contactPointsAPI.js b/tests/ia/pages/api/contactPointsAPI.js index 3a0a776ed..7b3734a82 100644 --- a/tests/ia/pages/api/contactPointsAPI.js +++ b/tests/ia/pages/api/contactPointsAPI.js @@ -14,14 +14,14 @@ module.exports = { name: 'default', grafana_managed_receiver_configs: [{ // Pager Duty config - settings: {}, - secureSettings: { - integrationKey: process.env.PAGER_DUTY_SERVICE_KEY, - }, - type: 'pagerduty', - name: 'default', - disableResolveMessage: false, - }, { + // settings: {}, + // secureSettings: { + // integrationKey: process.env.PAGER_DUTY_SERVICE_KEY, + // }, + // type: 'pagerduty', + // name: 'default', + // disableResolveMessage: false, + // }, { // Webhook config settings: { url: 'http://webhookd:8080/alert', diff --git a/tests/ia/pages/contactPointsPage.js b/tests/ia/pages/contactPointsPage.js index cb75018f7..68e197ab7 100644 --- a/tests/ia/pages/contactPointsPage.js +++ b/tests/ia/pages/contactPointsPage.js @@ -37,7 +37,7 @@ module.exports = { cPTableRow: (name) => `//*[@data-testid="row"][contains(., '${name}')]`, }, buttons: { - newContactPoint: locate('button').find('span').withText('New contact point'), + newContactPoint: locate('[aria-label="add contact point"]'), saveCP: locate('button').find('span').withText('Save contact point'), deleteCP: locate('button').withText('Delete'), moreMenu: (name) => locate(`//*[@data-testid="contact-point"][contains(., '${name}')]//button[@aria-label = 'More']`), diff --git a/tests/ia/pages/iaCommonPage.js b/tests/ia/pages/iaCommonPage.js index 2bed5ae16..5a27a4750 100644 --- a/tests/ia/pages/iaCommonPage.js +++ b/tests/ia/pages/iaCommonPage.js @@ -13,14 +13,15 @@ module.exports = { notificationPolicies: 'Notification policies', silences: 'Silences', alertGroups: 'Alert groups', - admin: 'Admin', + admin: 'Settings', }, elements: { noData: locate('$table-no-data').find('h1'), pagination: '$pagination', itemsShown: '$pagination-items-inverval', rowInTable: locate('$table-tbody').find('tr'), - tab: (tabName) => locate('[role="tablist"] a').withAttr({ 'aria-label': `Tab ${tabName}` }), + // tab: (tabName) => locate('[role="tablist"] a').withAttr({ 'aria-label': `Tab ${tabName}` }), + tab: (tabName) => locate(I.useDataQA('data-testid Nav menu item')).withText(tabName), table: '$table-tbody', disabledIa: '$empty-block', settingsLink: '$settings-link', @@ -54,10 +55,10 @@ module.exports = { I.click(this.elements.tab(tabName)); I.waitForVisible(tabElement, 10); I.seeInCurrentUrl(tabUrl); - - const className = await I.grabAttributeFrom(this.elements.tab(tabName), 'class'); - - assert.ok(className.endsWith('activeTabStyle'), `Tab ${tabName} should be active`); + // + // const className = await I.grabAttributeFrom(this.elements.tab(tabName), 'class'); + // + // assert.ok(className.endsWith('activeTabStyle'), `Tab ${tabName} should be active`); }, getCreateEntitiesAndPageUrl(page) { diff --git a/tests/ia/pages/notificationPolicies.js b/tests/ia/pages/notificationPolicies.js index a504a0153..434b12528 100644 --- a/tests/ia/pages/notificationPolicies.js +++ b/tests/ia/pages/notificationPolicies.js @@ -7,7 +7,7 @@ module.exports = { elements: { }, buttons: { - newPolicy: locate('button').find('span').withText('New specific policy'), + newPolicy: locate('button').find('span').withText('New child policy'), }, messages: { }, diff --git a/tests/ia/pages/ruleTemplatesPage.js b/tests/ia/pages/ruleTemplatesPage.js index b92466add..591fe8418 100644 --- a/tests/ia/pages/ruleTemplatesPage.js +++ b/tests/ia/pages/ruleTemplatesPage.js @@ -34,7 +34,7 @@ module.exports = { editButtonByName: (name) => `//td[contains(text(), "${name}")]/following-sibling::td//button[@data-testid="edit-template-button"]`, // deleteButtonByName returns Delete template button locator for a given Template name deleteButtonByName: (name) => `//td[contains(text(), "${name}")]/following-sibling::td//button[@data-testid="delete-template-button"]`, - addRuleButtonByName: (name) => `//td[contains(text(), "${name}")]/following-sibling::td//button[@data-testid="create-from-template-button"]`, + addRuleButtonByName: (name) => `//td[contains(text(), "${name}")]/following-sibling::td//a[@data-testid="create-from-template-button"]`, }, fields: { templateInput: '$yaml-textarea-input', diff --git a/tests/ia/pages/silencesPage.js b/tests/ia/pages/silencesPage.js index 0a5ce005d..86c1be10a 100644 --- a/tests/ia/pages/silencesPage.js +++ b/tests/ia/pages/silencesPage.js @@ -7,7 +7,7 @@ module.exports = { elements: { }, buttons: { - newSilence: locate('$silences-table').find('a').withText('New'), + newSilence: locate('$silences-table').find('a').withText('Create silence'), }, messages: { }, diff --git a/tests/ia/pagination_test.js b/tests/ia/pagination_test.js index 5e1ede83f..a3d7ac27e 100644 --- a/tests/ia/pagination_test.js +++ b/tests/ia/pagination_test.js @@ -12,259 +12,259 @@ After(async ({ templatesAPI }) => { await templatesAPI.clearAllTemplates(); }); -Scenario( - 'PMM-T632 PMM-T697 PMM-T701 PMM-T1251 Verify Pagination navigation @alerting-fb @grafana-pr', - async ({ - I, iaCommon, - }) => { - const initialButtonsState = { - firstPageButton: 'disabled', - prevPageButton: 'disabled', - pageButtonActive: 'enabled', - nextPageButton: 'disabled', - lastPageButton: 'disabled', - }; - const { createEntities, url, getListOfItems } = iaCommon.getCreateEntitiesAndPageUrl(page); - - I.amOnPage(url); - await iaCommon.verifyPaginationButtonsState(initialButtonsState); - - const templatesTotal = await I.grabNumberOfVisibleElements(iaCommon.elements.rowInTable); - - I.assertAbove(templatesTotal, 10, 'There\'s more then 10 templates by default'); - I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); - - // Create more templates to have 2 pages (26 in sum) - await createEntities(26 - templatesTotal); - I.say(`1st checkpoint, URL = ${url}, Count of elements = ${(await getListOfItems()).length}`); - I.refreshPage(); - - await iaCommon.verifyPaginationButtonsState({ - ...initialButtonsState, - nextPageButton: 'enabled', - lastPageButton: 'enabled', - }); - - // Verify number of rows and number of page buttons on page 1 - I.seeNumberOfElements(iaCommon.elements.rowInTable, 25); - I.seeNumberOfElements(iaCommon.buttons.pageButton, 1); - I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); - - // Go to page 2 - I.scrollTo(iaCommon.elements.pagination); - I.click(locate(iaCommon.buttons.pageButton).at(1)); - I.waitForVisible(iaCommon.elements.pagination, 30); - - await iaCommon.verifyPaginationButtonsState({ - ...initialButtonsState, - firstPageButton: 'enabled', - prevPageButton: 'enabled', - }); - - // Verify only 1 row on page 2 - I.seeNumberOfElements(iaCommon.elements.rowInTable, 1); - I.seeNumberOfElements(iaCommon.buttons.pageButton, 1); - I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); - - // Create 25 more templates to have 3 pages (51 in sum) - await createEntities(25); - I.say(`2nd checkpoint, URL = ${url}, Count of elements = ${(await getListOfItems()).length}`); - I.refreshPage(); - I.waitForVisible(iaCommon.elements.pagination, 30); - - // Go to page 2 - I.scrollTo(iaCommon.elements.pagination); - I.click(locate(iaCommon.buttons.pageButton).at(1)); - - await iaCommon.verifyPaginationButtonsState({ - ...initialButtonsState, - firstPageButton: 'enabled', - prevPageButton: 'enabled', - nextPageButton: 'enabled', - lastPageButton: 'enabled', - }); - - // Verify number of rows and number of page buttons on page 1 - I.seeNumberOfElements(iaCommon.elements.rowInTable, 25); - I.seeNumberOfElements(iaCommon.buttons.pageButton, 2); - I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); - - // Go to page 3 - I.scrollTo(iaCommon.elements.pagination); - I.click(iaCommon.buttons.nextPageButton); - I.waitForVisible(iaCommon.elements.pagination, 30); - - await iaCommon.verifyPaginationButtonsState({ - ...initialButtonsState, - firstPageButton: 'enabled', - prevPageButton: 'enabled', - }); - - // Verify page 3 has 1 row - I.seeNumberOfElements(iaCommon.elements.rowInTable, 1); - - // Go back to page 1 - I.scrollTo(iaCommon.elements.pagination); - I.click(iaCommon.buttons.firstPageButton); - I.waitForVisible(iaCommon.elements.pagination, 30); - I.seeNumberOfElements(iaCommon.elements.rowInTable, 25); - - await iaCommon.verifyPaginationButtonsState({ - ...initialButtonsState, - nextPageButton: 'enabled', - lastPageButton: 'enabled', - }); - - // Go to the last page - I.scrollTo(iaCommon.elements.pagination); - I.click(iaCommon.buttons.lastPageButton); - I.waitForVisible(iaCommon.elements.pagination, 30); - I.seeNumberOfElements(iaCommon.elements.rowInTable, 1); - - await iaCommon.verifyPaginationButtonsState({ - ...initialButtonsState, - firstPageButton: 'enabled', - prevPageButton: 'enabled', - }); - - // Go to page 2 - I.scrollTo(iaCommon.elements.pagination); - I.click(iaCommon.buttons.prevPageButton); - I.waitForVisible(iaCommon.elements.pagination, 30); - I.seeNumberOfElements(iaCommon.elements.rowInTable, 25); - - await iaCommon.verifyPaginationButtonsState({ - ...initialButtonsState, - firstPageButton: 'enabled', - prevPageButton: 'enabled', - nextPageButton: 'enabled', - lastPageButton: 'enabled', - }); - }, -); - -Scenario( - 'PMM-T662 PMM-T698 PMM-T702 PMM-T631 PMM-T1251 Pagination rows per page persistence @alerting-fb', - async ({ - I, iaCommon, - }) => { - const { createEntities, url, getListOfItems } = iaCommon.getCreateEntitiesAndPageUrl(page); - - I.amOnPage(url); - - // Verify '25' rows per page is selected by default - I.waitForVisible(iaCommon.elements.pagination, 30); - I.seeTextEquals('25', iaCommon.buttons.rowsPerPage); - - // Change rows per page to '50' - iaCommon.selectRowsPerPage(50); - I.seeTextEquals('50', iaCommon.buttons.rowsPerPage); - - // Create more templates to have 2 pages (26 in sum) - const templatesTotal = await I.grabNumberOfVisibleElements(iaCommon.elements.rowInTable); - - await createEntities(26 - templatesTotal); - - // Rows per page is '50' after refreshing a page - I.say(`1st checkpoint, URL = ${url}, Count of elements = ${(await getListOfItems()).length}`); - I.refreshPage(); - I.waitForVisible(iaCommon.elements.pagination, 30); - I.scrollTo(iaCommon.elements.pagination); - I.seeTextEquals('50', iaCommon.buttons.rowsPerPage); - - // Verify that we have 25 rows and only one page - I.seeNumberOfElements(iaCommon.elements.rowInTable, 26); - I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); - - // Change rows per page to '25' - I.waitForVisible(iaCommon.elements.pagination, 30); - iaCommon.selectRowsPerPage(25); - - // Verify that we have 25 rows and 2 pages - I.seeNumberOfElements(iaCommon.elements.rowInTable, 25); - I.seeNumberOfElements(iaCommon.buttons.pageButton, 1); - I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); - - // Change rows to 100 - iaCommon.selectRowsPerPage(100); - I.waitForVisible(iaCommon.elements.pagination, 30); - I.seeNumberOfElements(iaCommon.elements.rowInTable, 26); - I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); - - // Create 75 more templates (101 in sum) - await createEntities(75); - I.say(`2nd checkpoint, URL = ${url}, Count of elements = ${(await getListOfItems()).length}`); - I.refreshPage(); - - // Verify 100 rows per page persists after refreshing a page - I.waitForVisible(iaCommon.elements.pagination, 30); - I.scrollTo(iaCommon.elements.pagination); - I.seeTextEquals('100', iaCommon.buttons.rowsPerPage); - I.seeNumberOfElements(iaCommon.elements.rowInTable, 100); - I.seeNumberOfElements(iaCommon.buttons.pageButton, 1); - I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); - - // Go to page 2 - I.scrollTo(iaCommon.elements.pagination); - I.click(locate(iaCommon.buttons.pageButton).at(1)); - - // Verify only 1 row on page 2 - I.waitForVisible(iaCommon.elements.pagination, 30); - I.waitForVisible(iaCommon.elements.rowInTable, 30); - I.seeTextEquals('100', iaCommon.buttons.rowsPerPage); - I.seeNumberOfElements(iaCommon.elements.rowInTable, 1); - I.seeNumberOfElements(iaCommon.buttons.pageButton, 1); - I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); - }, -); - -Scenario( - 'PMM-T631 PMM-T633 PMM-T1251 Changing rows per page resets view to 1 page @alerting-fb', - async ({ - I, iaCommon, templatesAPI, - }) => { - const { createEntities, url, getListOfItems } = iaCommon.getCreateEntitiesAndPageUrl(page); - - // Create more templates to have 2 pages (101 in sum) - const templatesTotal = (await templatesAPI.getTemplatesList()).length; - - await createEntities(101 - templatesTotal); - - I.say(`Checkpoint, URL = ${url}, Count of elements = ${(await getListOfItems()).length}`); - I.amOnPage(url); - - // Verify '25' rows per page is selected by default - I.waitForVisible(iaCommon.elements.pagination, 30); - I.seeTextEquals('25', iaCommon.buttons.rowsPerPage); - I.seeTextEquals(iaCommon.messages.itemsShown(1, 25, 101), iaCommon.elements.itemsShown); - - // Go to page 2 - I.scrollTo(iaCommon.elements.pagination); - I.click(locate(iaCommon.buttons.pageButton).at(1)); - I.waitForVisible(iaCommon.elements.pagination, 30); - I.seeTextEquals(iaCommon.messages.itemsShown(26, 50, 101), iaCommon.elements.itemsShown); - - // Change rows per page to '50' - iaCommon.selectRowsPerPage(50); - I.waitForVisible(iaCommon.elements.pagination, 30); - I.scrollTo(iaCommon.elements.pagination); - I.seeTextEquals('50', iaCommon.buttons.rowsPerPage); - I.seeTextEquals(iaCommon.messages.itemsShown(1, 50, 101), iaCommon.elements.itemsShown); - I.click(locate(iaCommon.buttons.pageButton).at(1)); - I.waitForVisible(iaCommon.elements.pagination, 30); - I.seeTextEquals(iaCommon.messages.itemsShown(51, 100, 101), iaCommon.elements.itemsShown); - - // Change rows per page to '100' - iaCommon.selectRowsPerPage(100); - I.waitForVisible(iaCommon.elements.pagination, 30); - I.scrollTo(iaCommon.elements.pagination); - I.seeTextEquals('100', iaCommon.buttons.rowsPerPage); - I.seeTextEquals(iaCommon.messages.itemsShown(1, 100, 101), iaCommon.elements.itemsShown); - I.click(locate(iaCommon.buttons.pageButton).at(1)); - I.waitForVisible(iaCommon.elements.pagination, 30); - I.seeNumberOfElements(iaCommon.elements.rowInTable, 1); - I.seeNumberOfElements(iaCommon.buttons.pageButton, 1); - I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); - I.seeTextEquals(iaCommon.messages.itemsShown(101, 101, 101), iaCommon.elements.itemsShown); - }, -); +// Scenario( +// 'PMM-T632 PMM-T697 PMM-T701 PMM-T1251 Verify Pagination navigation @alerting-fb @grafana-pr', +// async ({ +// I, iaCommon, +// }) => { +// const initialButtonsState = { +// firstPageButton: 'disabled', +// prevPageButton: 'disabled', +// pageButtonActive: 'enabled', +// nextPageButton: 'disabled', +// lastPageButton: 'disabled', +// }; +// const { createEntities, url, getListOfItems } = iaCommon.getCreateEntitiesAndPageUrl(page); +// +// I.amOnPage(url); +// await iaCommon.verifyPaginationButtonsState(initialButtonsState); +// +// const templatesTotal = await I.grabNumberOfVisibleElements(iaCommon.elements.rowInTable); +// +// I.assertAbove(templatesTotal, 10, 'There\'s more then 10 templates by default'); +// I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); +// +// // Create more templates to have 2 pages (26 in sum) +// await createEntities(26 - templatesTotal); +// I.say(`1st checkpoint, URL = ${url}, Count of elements = ${(await getListOfItems()).length}`); +// I.refreshPage(); +// +// await iaCommon.verifyPaginationButtonsState({ +// ...initialButtonsState, +// nextPageButton: 'enabled', +// lastPageButton: 'enabled', +// }); +// +// // Verify number of rows and number of page buttons on page 1 +// I.seeNumberOfElements(iaCommon.elements.rowInTable, 25); +// I.seeNumberOfElements(iaCommon.buttons.pageButton, 1); +// I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); +// +// // Go to page 2 +// I.scrollTo(iaCommon.elements.pagination); +// I.click(locate(iaCommon.buttons.pageButton).at(1)); +// I.waitForVisible(iaCommon.elements.pagination, 30); +// +// await iaCommon.verifyPaginationButtonsState({ +// ...initialButtonsState, +// firstPageButton: 'enabled', +// prevPageButton: 'enabled', +// }); +// +// // Verify only 1 row on page 2 +// I.seeNumberOfElements(iaCommon.elements.rowInTable, 1); +// I.seeNumberOfElements(iaCommon.buttons.pageButton, 1); +// I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); +// +// // Create 25 more templates to have 3 pages (51 in sum) +// await createEntities(25); +// I.say(`2nd checkpoint, URL = ${url}, Count of elements = ${(await getListOfItems()).length}`); +// I.refreshPage(); +// I.waitForVisible(iaCommon.elements.pagination, 30); +// +// // Go to page 2 +// I.scrollTo(iaCommon.elements.pagination); +// I.click(locate(iaCommon.buttons.pageButton).at(1)); +// +// await iaCommon.verifyPaginationButtonsState({ +// ...initialButtonsState, +// firstPageButton: 'enabled', +// prevPageButton: 'enabled', +// nextPageButton: 'enabled', +// lastPageButton: 'enabled', +// }); +// +// // Verify number of rows and number of page buttons on page 1 +// I.seeNumberOfElements(iaCommon.elements.rowInTable, 25); +// I.seeNumberOfElements(iaCommon.buttons.pageButton, 2); +// I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); +// +// // Go to page 3 +// I.scrollTo(iaCommon.elements.pagination); +// I.click(iaCommon.buttons.nextPageButton); +// I.waitForVisible(iaCommon.elements.pagination, 30); +// +// await iaCommon.verifyPaginationButtonsState({ +// ...initialButtonsState, +// firstPageButton: 'enabled', +// prevPageButton: 'enabled', +// }); +// +// // Verify page 3 has 1 row +// I.seeNumberOfElements(iaCommon.elements.rowInTable, 1); +// +// // Go back to page 1 +// I.scrollTo(iaCommon.elements.pagination); +// I.click(iaCommon.buttons.firstPageButton); +// I.waitForVisible(iaCommon.elements.pagination, 30); +// I.seeNumberOfElements(iaCommon.elements.rowInTable, 25); +// +// await iaCommon.verifyPaginationButtonsState({ +// ...initialButtonsState, +// nextPageButton: 'enabled', +// lastPageButton: 'enabled', +// }); +// +// // Go to the last page +// I.scrollTo(iaCommon.elements.pagination); +// I.click(iaCommon.buttons.lastPageButton); +// I.waitForVisible(iaCommon.elements.pagination, 30); +// I.seeNumberOfElements(iaCommon.elements.rowInTable, 1); +// +// await iaCommon.verifyPaginationButtonsState({ +// ...initialButtonsState, +// firstPageButton: 'enabled', +// prevPageButton: 'enabled', +// }); +// +// // Go to page 2 +// I.scrollTo(iaCommon.elements.pagination); +// I.click(iaCommon.buttons.prevPageButton); +// I.waitForVisible(iaCommon.elements.pagination, 30); +// I.seeNumberOfElements(iaCommon.elements.rowInTable, 25); +// +// await iaCommon.verifyPaginationButtonsState({ +// ...initialButtonsState, +// firstPageButton: 'enabled', +// prevPageButton: 'enabled', +// nextPageButton: 'enabled', +// lastPageButton: 'enabled', +// }); +// }, +// ); +// +// Scenario( +// 'PMM-T662 PMM-T698 PMM-T702 PMM-T631 PMM-T1251 Pagination rows per page persistence @alerting-fb', +// async ({ +// I, iaCommon, +// }) => { +// const { createEntities, url, getListOfItems } = iaCommon.getCreateEntitiesAndPageUrl(page); +// +// I.amOnPage(url); +// +// // Verify '25' rows per page is selected by default +// I.waitForVisible(iaCommon.elements.pagination, 30); +// I.seeTextEquals('25', iaCommon.buttons.rowsPerPage); +// +// // Change rows per page to '50' +// iaCommon.selectRowsPerPage(50); +// I.seeTextEquals('50', iaCommon.buttons.rowsPerPage); +// +// // Create more templates to have 2 pages (26 in sum) +// const templatesTotal = await I.grabNumberOfVisibleElements(iaCommon.elements.rowInTable); +// +// await createEntities(26 - templatesTotal); +// +// // Rows per page is '50' after refreshing a page +// I.say(`1st checkpoint, URL = ${url}, Count of elements = ${(await getListOfItems()).length}`); +// I.refreshPage(); +// I.waitForVisible(iaCommon.elements.pagination, 30); +// I.scrollTo(iaCommon.elements.pagination); +// I.seeTextEquals('50', iaCommon.buttons.rowsPerPage); +// +// // Verify that we have 25 rows and only one page +// I.seeNumberOfElements(iaCommon.elements.rowInTable, 26); +// I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); +// +// // Change rows per page to '25' +// I.waitForVisible(iaCommon.elements.pagination, 30); +// iaCommon.selectRowsPerPage(25); +// +// // Verify that we have 25 rows and 2 pages +// I.seeNumberOfElements(iaCommon.elements.rowInTable, 25); +// I.seeNumberOfElements(iaCommon.buttons.pageButton, 1); +// I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); +// +// // Change rows to 100 +// iaCommon.selectRowsPerPage(100); +// I.waitForVisible(iaCommon.elements.pagination, 30); +// I.seeNumberOfElements(iaCommon.elements.rowInTable, 26); +// I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); +// +// // Create 75 more templates (101 in sum) +// await createEntities(75); +// I.say(`2nd checkpoint, URL = ${url}, Count of elements = ${(await getListOfItems()).length}`); +// I.refreshPage(); +// +// // Verify 100 rows per page persists after refreshing a page +// I.waitForVisible(iaCommon.elements.pagination, 30); +// I.scrollTo(iaCommon.elements.pagination); +// I.seeTextEquals('100', iaCommon.buttons.rowsPerPage); +// I.seeNumberOfElements(iaCommon.elements.rowInTable, 100); +// I.seeNumberOfElements(iaCommon.buttons.pageButton, 1); +// I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); +// +// // Go to page 2 +// I.scrollTo(iaCommon.elements.pagination); +// I.click(locate(iaCommon.buttons.pageButton).at(1)); +// +// // Verify only 1 row on page 2 +// I.waitForVisible(iaCommon.elements.pagination, 30); +// I.waitForVisible(iaCommon.elements.rowInTable, 30); +// I.seeTextEquals('100', iaCommon.buttons.rowsPerPage); +// I.seeNumberOfElements(iaCommon.elements.rowInTable, 1); +// I.seeNumberOfElements(iaCommon.buttons.pageButton, 1); +// I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); +// }, +// ); +// +// Scenario( +// 'PMM-T631 PMM-T633 PMM-T1251 Changing rows per page resets view to 1 page @alerting-fb', +// async ({ +// I, iaCommon, templatesAPI, +// }) => { +// const { createEntities, url, getListOfItems } = iaCommon.getCreateEntitiesAndPageUrl(page); +// +// // Create more templates to have 2 pages (101 in sum) +// const templatesTotal = (await templatesAPI.getTemplatesList()).length; +// +// await createEntities(101 - templatesTotal); +// +// I.say(`Checkpoint, URL = ${url}, Count of elements = ${(await getListOfItems()).length}`); +// I.amOnPage(url); +// +// // Verify '25' rows per page is selected by default +// I.waitForVisible(iaCommon.elements.pagination, 30); +// I.seeTextEquals('25', iaCommon.buttons.rowsPerPage); +// I.seeTextEquals(iaCommon.messages.itemsShown(1, 25, 101), iaCommon.elements.itemsShown); +// +// // Go to page 2 +// I.scrollTo(iaCommon.elements.pagination); +// I.click(locate(iaCommon.buttons.pageButton).at(1)); +// I.waitForVisible(iaCommon.elements.pagination, 30); +// I.seeTextEquals(iaCommon.messages.itemsShown(26, 50, 101), iaCommon.elements.itemsShown); +// +// // Change rows per page to '50' +// iaCommon.selectRowsPerPage(50); +// I.waitForVisible(iaCommon.elements.pagination, 30); +// I.scrollTo(iaCommon.elements.pagination); +// I.seeTextEquals('50', iaCommon.buttons.rowsPerPage); +// I.seeTextEquals(iaCommon.messages.itemsShown(1, 50, 101), iaCommon.elements.itemsShown); +// I.click(locate(iaCommon.buttons.pageButton).at(1)); +// I.waitForVisible(iaCommon.elements.pagination, 30); +// I.seeTextEquals(iaCommon.messages.itemsShown(51, 100, 101), iaCommon.elements.itemsShown); +// +// // Change rows per page to '100' +// iaCommon.selectRowsPerPage(100); +// I.waitForVisible(iaCommon.elements.pagination, 30); +// I.scrollTo(iaCommon.elements.pagination); +// I.seeTextEquals('100', iaCommon.buttons.rowsPerPage); +// I.seeTextEquals(iaCommon.messages.itemsShown(1, 100, 101), iaCommon.elements.itemsShown); +// I.click(locate(iaCommon.buttons.pageButton).at(1)); +// I.waitForVisible(iaCommon.elements.pagination, 30); +// I.seeNumberOfElements(iaCommon.elements.rowInTable, 1); +// I.seeNumberOfElements(iaCommon.buttons.pageButton, 1); +// I.seeNumberOfElements(iaCommon.buttons.pageButtonActive, 1); +// I.seeTextEquals(iaCommon.messages.itemsShown(101, 101, 101), iaCommon.elements.itemsShown); +// }, +// ); diff --git a/tests/ia/ruleTemplates_test.js b/tests/ia/ruleTemplates_test.js index 544ae872a..350c5cd82 100644 --- a/tests/ia/ruleTemplates_test.js +++ b/tests/ia/ruleTemplates_test.js @@ -337,9 +337,9 @@ Scenario( .editButtonBySource(ruleTemplatesPage.templateSources.saas); ruleTemplatesPage.openRuleTemplatesTab(); - I.waitForElement(saasDeleteButton, 30); - I.seeAttributesOnElements(saasDeleteButton, { disabled: true }); - I.seeAttributesOnElements(saasEditButton, { disabled: true }); + I.waitForElement(ruleTemplatesPage.elements.templateRowBySource(ruleTemplatesPage.templateSources.saas), 30); + I.dontSeeElement(saasEditButton); + I.dontSeeElement(saasDeleteButton); }, ); @@ -365,7 +365,8 @@ Scenario( }, ); -Scenario( +// TODO: unskip after https://perconadev.atlassian.net/browse/PMM-13542 is fixed +Scenario.skip( 'PMM-T825 PMM-T821 Verify User can add Alert rule template in the file system @not-ovf @alerting-fb', async ({ I, ruleTemplatesPage }) => { const editButton = ruleTemplatesPage.buttons diff --git a/tests/pages/addInstancePage.js b/tests/pages/addInstancePage.js index a88c47b77..ab4803d12 100644 --- a/tests/pages/addInstancePage.js +++ b/tests/pages/addInstancePage.js @@ -4,8 +4,8 @@ module.exports = { url: 'graph/add-instance', addMySQLRemoteURL: 'graph/add-instance?instance_type=mysql', fields: { - breadcrumbs: locate('h2').withText('Select service type'), - addAmazonRDSbtn: '//div[@data-testid=\'rds-instance\']//button[@type=\'button\']', + breadcrumbs: locate('.page-toolbar').withText('Inventory / Add service / Step 1 of 2'), + addAmazonRDSbtn: '$rds-instance', }, async open() { diff --git a/tests/pages/api/grafanaAPI.js b/tests/pages/api/grafanaAPI.js index 0e3fa0161..ba94eac11 100644 --- a/tests/pages/api/grafanaAPI.js +++ b/tests/pages/api/grafanaAPI.js @@ -357,19 +357,59 @@ module.exports = { return (r.data.find((d) => d.name === name)).uid; }, - // Should be refactored + // Refactored function for new Grafana Explore UI format async getMetric(metricName, refineBy) { const uid = await this.getDataSourceUidByName(); + const currentTime = Date.now(); const body = { queries: [ { + refId: 'A', + expr: refineBy ? `${metricName}{${refineBy.type}="${refineBy.value}"}` : metricName, + range: true, + instant: false, datasource: { + type: 'prometheus', uid, }, - expr: refineBy ? `${metricName}{${refineBy.type}=\"${refineBy.value}\"}` : metricName, + editorMode: 'builder', + legendFormat: '__auto', + useBackend: false, + disableTextWrap: false, + fullMetaSearch: false, + includeNullMetadata: true, + requestId: '17102A', + utcOffsetSec: 19800, + interval: '', + datasourceId: 1, + intervalMs: 1000, + maxDataPoints: 757, + }, + { + refId: 'A-Instant', + expr: refineBy ? `${metricName}{${refineBy.type}="${refineBy.value}"}` : metricName, + range: false, + instant: true, + datasource: { + type: 'prometheus', + uid, + }, + editorMode: 'builder', + legendFormat: '__auto', + useBackend: false, + disableTextWrap: false, + fullMetaSearch: false, + includeNullMetadata: true, + requestId: '17102A', + utcOffsetSec: 19800, + interval: '', + datasourceId: 1, + intervalMs: 1000, + maxDataPoints: 757, }, ], - from: 'now-15m', + from: (currentTime - 5 * 60 * 1000).toString(), + to: currentTime.toString(), }; const headers = { diff --git a/tests/pages/api/inventoryAPI.js b/tests/pages/api/inventoryAPI.js index 91f40a09f..f0b1dd5d8 100644 --- a/tests/pages/api/inventoryAPI.js +++ b/tests/pages/api/inventoryAPI.js @@ -104,7 +104,7 @@ module.exports = { async apiGetServices() { const headers = { Authorization: `Basic ${await I.getAuth()}` }; - const url = 'v1/inventory/services'; + const url = 'v1/management/services'; return await I.sendGetRequest(url, headers); }, @@ -235,7 +235,7 @@ module.exports = { // Wait for Status to change to running I.wait(10); - await I.verifyCommand(`docker exec ${dbDetails.container_name} pmm-admin list | grep mongodb_profiler_agent | grep ${agent_id} | grep ${dbDetails.service_id} | grep "Agent_status_running"`); + await I.verifyCommand(`docker exec ${dbDetails.container_name} pmm-admin list | grep mongodb_profiler_agent | grep ${agent_id} | grep ${dbDetails.service_id} | grep "Running"`); assert.ok(log_level === expectedLogLevel, `Was expecting MongoDB QAN Profile for service ${dbDetails.service_name} added again via inventory command and log level to have ${logLevel || 'warn'} set`); break; case 'postgresql': @@ -254,7 +254,7 @@ module.exports = { // Wait for Status to change to running I.wait(10); - await I.verifyCommand(`docker exec ${dbDetails.container_name} pmm-admin list | grep postgresql_pgstatmonitor_agent | grep ${agent_id} | grep ${dbDetails.service_id} | grep "Agent_status_running"`); + await I.verifyCommand(`docker exec ${dbDetails.container_name} pmm-admin list | grep postgresql_pgstatmonitor_agent | grep ${agent_id} | grep ${dbDetails.service_id} | grep "Running"`); assert.ok(log_level === expectedLogLevel, `Was expecting PGSTAT_MONITOR QAN for service ${dbDetails.service_name} added again via inventory command and log level to have ${logLevel || 'warn'} set`); await I.verifyCommand(`docker exec ${dbDetails.container_name} pmm-admin inventory remove agent ${agent_id}`); break; @@ -265,7 +265,7 @@ module.exports = { // Wait for Status to change to running I.wait(10); - await I.verifyCommand(`docker exec ${dbDetails.container_name} pmm-admin list | grep postgresql_pgstatements_agent | grep ${agent_id} | grep ${dbDetails.service_id} | grep "Agent_status_running"`); + await I.verifyCommand(`docker exec ${dbDetails.container_name} pmm-admin list | grep postgresql_pgstatements_agent | grep ${agent_id} | grep ${dbDetails.service_id} | grep "Running"`); assert.ok(log_level === expectedLogLevel, `Was expecting PGSTATSTATEMENT QAN for service ${dbDetails.service_name} added again via inventory command and log level to have ${logLevel || 'warn'} set`); await I.verifyCommand(`docker exec ${dbDetails.container_name} pmm-admin inventory remove agent ${agent_id}`); break; @@ -295,7 +295,7 @@ module.exports = { // Wait for Status to change to running I.wait(10); - await I.verifyCommand(`docker exec ${dbDetails.container_name} pmm-admin list | grep mysql_slowlog_agent | grep ${agent_id} | grep ${dbDetails.service_id} | grep "Agent_status_running"`); + await I.verifyCommand(`docker exec ${dbDetails.container_name} pmm-admin list | grep mysql_slowlog_agent | grep ${agent_id} | grep ${dbDetails.service_id} | grep "Running"`); assert.ok(log_level === expectedLogLevel, `Was expecting Slowlog QAN for service ${dbDetails.service_name} added again via inventory command and log level to have ${logLevel || 'warn'} set`); await I.verifyCommand(`docker exec ${dbDetails.container_name} pmm-admin inventory remove agent ${agent_id}`); break; @@ -306,7 +306,7 @@ module.exports = { // Wait for Status to change to running I.wait(10); - await I.verifyCommand(`docker exec ${dbDetails.container_name} pmm-admin list | grep mysql_perfschema_agent | grep ${agent_id} | grep ${dbDetails.service_id} | grep "Agent_status_running"`); + await I.verifyCommand(`docker exec ${dbDetails.container_name} pmm-admin list | grep mysql_perfschema_agent | grep ${agent_id} | grep ${dbDetails.service_id} | grep "Running"`); assert.ok(log_level === expectedLogLevel, `Was expecting PerfSchema QAN for service ${dbDetails.service_name} added again via inventory command and log level to have ${logLevel || 'warn'} set`); await I.verifyCommand(`docker exec ${dbDetails.container_name} pmm-admin inventory remove agent ${agent_id}`); break; diff --git a/tests/pages/api/settingsAPI.js b/tests/pages/api/settingsAPI.js index 9e97c58c5..90135cdbc 100644 --- a/tests/pages/api/settingsAPI.js +++ b/tests/pages/api/settingsAPI.js @@ -54,17 +54,7 @@ module.exports = { }, async apiDisableIA() { - const body = { - disable_alerting: true, - }; - const headers = { Authorization: `Basic ${await I.getAuth()}` }; - - const resp = await I.sendPostRequest(endpoint, body, headers); - - assert.ok( - resp.status === 200, - `Failed to disable Integrated alerting. ${resp.data.message}`, - ); + await this.changeSettings({ alerting: false }); }, async apiEnableIA() { diff --git a/tests/pages/remoteInstancesPage.js b/tests/pages/remoteInstancesPage.js index 1d9e85aaf..256496c69 100644 --- a/tests/pages/remoteInstancesPage.js +++ b/tests/pages/remoteInstancesPage.js @@ -275,13 +275,22 @@ module.exports = { I.click(this.fields.useTLS); I.waitForElement(this.fields.tlscaInput, 30); - await this.fillFileContent(this.fields.tlscaInput, details.tlsCAFile); - await this.fillFileContent(this.fields.tlsCertificateInput, details.tlsCertFile); - await this.fillFileContent(this.fields.tlsCertificateKeyInput, details.tlsKeyFile); - - if (details.serviceType === 'postgres_ssl') I.click(this.fields.usePgStatStatements); - - if (details.serviceType === 'mysql_ssl') I.click(this.fields.skipTLSL); + if (details.serviceType === 'postgres_ssl') { + I.click(this.fields.tlscaInput); + I.type(details.tlsCA); + I.click(this.fields.tlsCertificateInput); + I.type(details.tlsCert); + I.click(this.fields.tlsCertificateKeyInput); + I.type(details.tlsKey); + I.click(this.fields.usePgStatStatements); + } + + if (details.serviceType === 'mysql_ssl') { + await this.fillFileContent(this.fields.tlscaInput, details.tlsCAFile); + await this.fillFileContent(this.fields.tlsCertificateInput, details.tlsCertFile); + await this.fillFileContent(this.fields.tlsCertificateKeyInput, details.tlsKeyFile); + I.click(this.fields.skipTLSL); + } } if (details.serviceType === 'mongodb_ssl') { @@ -298,8 +307,18 @@ module.exports = { } }, + selectNodeForRemoteInstance(nodeName = 'pmm-server') { + I.waitForElement(this.fields.hostName, 30); + this.selectDropdownOption('$nodes-selectbox', 'pmm-server'); + }, + async fillRemoteFields(serviceName) { let inputs; + const externalServiceName = 'external_service_new'; + + if (serviceName !== externalServiceName) { + this.selectNodeForRemoteInstance(); + } // eslint-disable-next-line default-case switch (serviceName) { @@ -441,7 +460,7 @@ module.exports = { I.fillField(this.fields.environment, inputs.environment); I.fillField(this.fields.cluster, inputs.clusterName); break; - case 'external_service_new': + case externalServiceName: inputs = remoteInstancesHelper.remote_instance.external.redis; I.fillField(this.fields.serviceName, serviceName); I.fillField(this.fields.hostName, inputs.host); @@ -579,6 +598,7 @@ module.exports = { async fillRemoteRDSFields(serviceName) { let inputs; + this.selectNodeForRemoteInstance(); // eslint-disable-next-line default-case switch (serviceName) { case 'rds-mysql56': diff --git a/tests/qa-integration/pmm_pdpgsql_integration_test.js b/tests/qa-integration/pmm_pdpgsql_integration_test.js index e153b28bb..a482c7e78 100644 --- a/tests/qa-integration/pmm_pdpgsql_integration_test.js +++ b/tests/qa-integration/pmm_pdpgsql_integration_test.js @@ -24,7 +24,7 @@ Scenario( adminPage.performPageUp(5); await dashboardPage.verifyMetricsExistence(dashboardPage.postgresqlInstanceSummaryDashboard.metrics); await dashboardPage.verifyThereAreNoGraphsWithoutData(1); - await I.verifyCommand('pmm-admin list | grep "postgresql_pgstatmonitor_agent" | grep "Agent_status_running"'); - await I.verifyCommand('pmm-admin list | grep "postgres_exporter" | grep "Agent_status_running"'); + await I.verifyCommand('pmm-admin list | grep "postgresql_pgstatmonitor_agent" | grep "Running"'); + await I.verifyCommand('pmm-admin list | grep "postgres_exporter" | grep "Running"'); }, ); diff --git a/tests/qa-integration/pmm_pgsm_integration_test.js b/tests/qa-integration/pmm_pgsm_integration_test.js index dc9471ca5..ba0ef726d 100644 --- a/tests/qa-integration/pmm_pgsm_integration_test.js +++ b/tests/qa-integration/pmm_pgsm_integration_test.js @@ -1,7 +1,7 @@ const assert = require('assert'); const { SERVICE_TYPE, - AGENT_STATUS, + CLI_AGENT_STATUS, } = require('../helper/constants'); const connection = { @@ -17,7 +17,7 @@ const connection = { // Service Name: ${PGSQL_PGSM_CONTAINER}_${PGSQL_VERSION}_service // Docker Container Name: ${PGSQL_PGSM_CONTAINER}_${PGSQL_VERSION} -const version = process.env.PDPGSQL_VERSION ? `${process.env.PDPGSQL_VERSION}` : '16'; +const version = process.env.PDPGSQL_VERSION ? `${process.env.PDPGSQL_VERSION}` : '17'; const database = `pgsm${Math.floor(Math.random() * 99) + 1}`; let pgsm_service_name; let pgsm_service_name_socket; @@ -100,7 +100,7 @@ Scenario( assert.ok(pgStatMonitorAgent, 'pg_stat_monitor agent should exist'); - return pgStatMonitorAgent.status === AGENT_STATUS.RUNNING; + return pgStatMonitorAgent.status === CLI_AGENT_STATUS.RUNNING; }, 30); const pgStatStatementsAgent = serviceAgents.find(({ agent_type }) => agent_type === 'AGENT_TYPE_QAN_POSTGRESQL_PGSTATEMENTS_AGENT'); @@ -227,7 +227,7 @@ Scenario( dashboardPage.waitForDashboardOpened(); await dashboardPage.expandEachDashboardRow(); await dashboardPage.verifyMetricsExistence(dashboardPage.postgresqlInstanceSummaryDashboard.metrics); - await dashboardPage.verifyThereAreNoGraphsWithoutData(1); + await dashboardPage.verifyThereAreNoGraphsWithoutData(2); }, ); @@ -243,7 +243,7 @@ Scenario( dashboardPage.waitForDashboardOpened(); await dashboardPage.expandEachDashboardRow(); await dashboardPage.verifyMetricsExistence(dashboardPage.postgresqlInstanceSummaryDashboard.metrics); - await dashboardPage.verifyThereAreNoGraphsWithoutData(1); + await dashboardPage.verifyThereAreNoGraphsWithoutData(2); const log = await I.verifyCommand(`docker exec ${container_name} cat pmm-agent.log`); I.assertFalse( @@ -254,7 +254,8 @@ Scenario( ); // The numbers don't entirely match, we need to find a way to track based on difference -Scenario( +// TODO: unskip after https://perconadev.atlassian.net/browse/PMM-13544 +Scenario.skip( 'PMM-T1259 - Verifying data in Clickhouse and comparing with PGSM output @pgsm-pmm-integration @not-ui-pipeline', async ({ I, qanAPI }) => { await I.pgExecuteQueryOnDemand('SELECT now();', connection); diff --git a/tests/qa-integration/pmm_pgss_integration_test.js b/tests/qa-integration/pmm_pgss_integration_test.js index 457c1ef7d..2d99432bc 100644 --- a/tests/qa-integration/pmm_pgss_integration_test.js +++ b/tests/qa-integration/pmm_pgss_integration_test.js @@ -1,7 +1,7 @@ const assert = require('assert'); const { SERVICE_TYPE, - AGENT_STATUS, + CLI_AGENT_STATUS, } = require('../helper/constants'); const { adminPage } = inject(); @@ -18,7 +18,7 @@ const connection = { // Service Name: ${PGSQL_PGSS_CONTAINER}_${PGSQL_VERSION}_service // Docker Container Name: ${PGSQL_PGSS_CONTAINER}_${PGSQL_VERSION} -const version = process.env.PGSQL_VERSION ? `${process.env.PGSQL_VERSION}` : '16'; +const version = process.env.PGSQL_VERSION ? `${process.env.PGSQL_VERSION}` : '17'; const container = process.env.PGSQL_PGSS_CONTAINER ? `${process.env.PGSQL_PGSS_CONTAINER}` : 'pgsql_pgss_pmm'; const database = `pgss${Math.floor(Math.random() * 99) + 1}`; let pgss_service_name; @@ -48,11 +48,10 @@ Scenario( 'PMM-T1868 - pg_stat_statements is used if no --query-source flag provided and pg_stat_monitor is not configured @not-ui-pipeline @pgss-pmm-integration', async ({ I }) => { const serviceName = `pgss_${Math.floor(Math.random() * 99) + 1}`; - const { service: { service_id: serviceId }, warning } = JSON.parse( - await I.verifyCommand(`docker exec ${container_name} pmm-admin add postgresql --json --password=${connection.password} --username=${connection.user} --service-name=${serviceName}`), - ); + const commandOut = await I.verifyCommand(`docker exec ${container_name} pmm-admin add postgresql --json --password=${connection.password} --username=${connection.user} --service-name=${serviceName}`); + const { service: { service_id: serviceId }, warning } = JSON.parse(commandOut); - assert.ok(warning === 'Could not to detect the pg_stat_monitor extension on your system. Falling back to the pg_stat_statements.'); + assert.ok(warning === 'Could not to detect the pg_stat_monitor extension on your system. Falling back to the pg_stat_statements.', `Expected warning message, but received \n${commandOut}`); let list; let serviceAgents; @@ -66,7 +65,7 @@ Scenario( assert.ok(pgStatStatementsAgent, 'pg_stat_statements agent should exist'); - return pgStatStatementsAgent.status === AGENT_STATUS.RUNNING; + return pgStatStatementsAgent.status === CLI_AGENT_STATUS.RUNNING; }, 30); const pgStatMonitorAgent = serviceAgents.find(({ agent_type }) => agent_type === 'AGENT_TYPE_QAN_POSTGRESQL_PGSTATMONITOR_AGENT'); @@ -121,7 +120,7 @@ Scenario.skip( connection.database = 'postgres'; // wait for pmm-agent to push the execution as part of next bucket to clickhouse I.wait(150); - await I.verifyCommand(`docker exec ${container_name} pmm-admin list | grep "postgresql_pgstatements_agent" | grep "Agent_status_running"`); + await I.verifyCommand(`docker exec ${container_name} pmm-admin list | grep "postgresql_pgstatements_agent" | grep "Running"`); let toStart = new Date(); diff --git a/tests/qa-integration/pmm_ps_integration_test.js b/tests/qa-integration/pmm_ps_integration_test.js index 1510a7b02..a8395c077 100644 --- a/tests/qa-integration/pmm_ps_integration_test.js +++ b/tests/qa-integration/pmm_ps_integration_test.js @@ -72,8 +72,8 @@ Scenario( let response; let result; const metricName = 'mysql_global_status_max_used_connections'; - await I.verifyCommand(`docker exec ${container_name} pmm-admin list | grep "mysqld_exporter" | grep "Agent_status_running" | wc -l | grep "1"`); - await I.verifyCommand(`docker exec ${container_name} pmm-admin list | grep "mysql_slowlog_agent" | grep "Agent_status_running" | wc -l | grep "1"`); + await I.verifyCommand(`docker exec ${container_name} pmm-admin list | grep "mysqld_exporter" | grep "Running" | wc -l | grep "1"`); + await I.verifyCommand(`docker exec ${container_name} pmm-admin list | grep "mysql_slowlog_agent" | grep "Running" | wc -l | grep "1"`); const clientServiceName = (await I.verifyCommand(`docker exec ${container_name} pmm-admin list | grep MySQL | head -1 | awk -F" " '{print $2}'`)).trim(); @@ -151,6 +151,9 @@ Scenario( const dbName = 'sbtest3'; const sbUser = { name: 'sysbench', password: 'test' }; + // Add wait for Queries to appear in PMM + await I.wait(70); + const psContainerName = await I.verifyCommand('docker ps --format "{{.Names}}" | grep ps_'); await I.verifyCommand(`docker exec ${psContainerName} mysql -h 127.0.0.1 --port 3307 -u ${credentials.perconaServer.root.username} -p${credentials.perconaServer.root.password} -e "CREATE USER IF NOT EXISTS sysbench@'%' IDENTIFIED WITH mysql_native_password BY 'test'; GRANT ALL ON *.* TO sysbench@'%'; DROP DATABASE IF EXISTS ${dbName};"`); @@ -171,6 +174,6 @@ Scenario( queryAnalyticsPage.waitForLoaded(); await queryAnalyticsPage.filters.selectFilter(dbName, 120000); queryAnalyticsPage.waitForLoaded(); - I.waitForText('16', 180, queryAnalyticsPage.data.elements.totalItems); + I.waitForText('16', 240, queryAnalyticsPage.data.elements.totalItems); }, ).retry(1); diff --git a/tests/qa-integration/pmm_psmdb_integration_test.js b/tests/qa-integration/pmm_psmdb_integration_test.js index d6c977742..cd9ff59c0 100644 --- a/tests/qa-integration/pmm_psmdb_integration_test.js +++ b/tests/qa-integration/pmm_psmdb_integration_test.js @@ -72,8 +72,8 @@ Scenario.skip( let response; let result; const metricName = 'mongodb_connections'; - await I.verifyCommand(`docker exec ${replica_container_name} pmm-admin list | grep "mongodb_exporter" | grep "Agent_status_running" | wc -l | grep "3"`); - await I.verifyCommand(`docker exec ${replica_container_name} pmm-admin list | grep "mongodb_profiler_agent" | grep "Agent_status_running" | wc -l | grep "3"`); + await I.verifyCommand(`docker exec ${replica_container_name} pmm-admin list | grep "mongodb_exporter" | grep "Running" | wc -l | grep "3"`); + await I.verifyCommand(`docker exec ${replica_container_name} pmm-admin list | grep "mongodb_profiler_agent" | grep "Running" | wc -l | grep "3"`); const clientServiceName = (await I.verifyCommand(`docker exec ${replica_container_name} pmm-admin list | grep MongoDB | head -1 | awk -F" " '{print $2}'`)).trim(); diff --git a/tests/qa-integration/pmm_pxc_integration_test.js b/tests/qa-integration/pmm_pxc_integration_test.js index 15ca5ace3..57b970acb 100644 --- a/tests/qa-integration/pmm_pxc_integration_test.js +++ b/tests/qa-integration/pmm_pxc_integration_test.js @@ -71,8 +71,8 @@ Scenario( let response; let result; const metricName = 'mysql_global_status_max_used_connections'; - await I.verifyCommand(`docker exec ${container_name} pmm-admin list | grep "mysqld_exporter" | grep "Agent_status_running" | wc -l | grep "3"`); - await I.verifyCommand(`docker exec ${container_name} pmm-admin list | grep "mysql_perfschema_agent" | grep "Agent_status_running" | wc -l | grep "3"`); + await I.verifyCommand(`docker exec ${container_name} pmm-admin list | grep "mysqld_exporter" | grep "Running" | wc -l | grep "3"`); + await I.verifyCommand(`docker exec ${container_name} pmm-admin list | grep "mysql_perfschema_agent" | grep "Running" | wc -l | grep "3"`); const clientServiceName = (await I.verifyCommand(`docker exec ${container_name} pmm-admin list | grep MySQL | head -1 | awk -F" " '{print $2}'`)).trim(); diff --git a/tests/remoteInstances/remoteInstancesHelper.js b/tests/remoteInstances/remoteInstancesHelper.js index cace365cb..76f400d9c 100644 --- a/tests/remoteInstances/remoteInstancesHelper.js +++ b/tests/remoteInstances/remoteInstancesHelper.js @@ -1,4 +1,4 @@ -const { SERVICE_TYPE } = require("../helper/constants"); +const { SERVICE_TYPE } = require('../helper/constants'); const remoteInstanceStatus = { mysql: { @@ -187,8 +187,8 @@ module.exports = { proxysql_2_1_1: { host: (PMM_SERVER_OVF_AMI_SETUP === 'true' ? SERVER_HOST : 'proxysql'), port: DB_CONFIG.PROXYSQL_SERVER_PORT, - username: 'proxysql_user', - password: 'passw0rd', + username: 'proxyadmin', + password: 'yxZq!4SGv0A1', environment: 'proxy_env', clusterName: 'proxy_clstr', }, diff --git a/tests/verifyAWSRDSMySQLInstance_test.js b/tests/verifyAWSRDSMySQLInstance_test.js index 0f3fecc8d..3b2df5c2f 100644 --- a/tests/verifyAWSRDSMySQLInstance_test.js +++ b/tests/verifyAWSRDSMySQLInstance_test.js @@ -18,10 +18,13 @@ Scenario( remoteInstancesPage.verifyInstanceIsDiscovered(instanceIdToMonitor); remoteInstancesPage.startMonitoringOfInstance(instanceIdToMonitor); remoteInstancesPage.verifyAddInstancePageOpened(); - remoteInstancesPage.fillRemoteRDSFields(instanceIdToMonitor); + await remoteInstancesPage.fillRemoteRDSFields(instanceIdToMonitor); remoteInstancesPage.createRemoteInstance(instanceIdToMonitor); pmmInventoryPage.verifyRemoteServiceIsDisplayed(instanceIdToMonitor); await pmmInventoryPage.verifyAgentHasStatusRunning(instanceIdToMonitor); + + // Waiting for metrics to start hitting for remotely added services + I.wait(60); }, ); @@ -61,7 +64,7 @@ Scenario( })); dashboardPage.waitForDashboardOpened(); await dashboardPage.expandEachDashboardRow(); - await dashboardPage.verifyThereAreNoGraphsWithoutData(7); + await dashboardPage.verifyThereAreNoGraphsWithoutData(9); }, ); diff --git a/tests/verifyAuroraRemoteInstance_test.js b/tests/verifyAuroraRemoteInstance_test.js index 2be8c31ba..0bbda612f 100644 --- a/tests/verifyAuroraRemoteInstance_test.js +++ b/tests/verifyAuroraRemoteInstance_test.js @@ -60,45 +60,43 @@ Data(instances).Scenario('@PMM-T1295 Verify adding Aurora remote instance @insta }, details.service_name, ); + + // Waiting for metrics to start hitting for remotely added services + I.wait(60); // await pmmInventoryPage.verifyAgentHasStatusRunning(details.service_name); }); // FIXME: Can be removed once https://jira.percona.com/browse/PMM-10201 is fixed -Data(instances) - .Scenario('PMM-T1295 Verify Aurora instance metrics @instances', async ({ I, current, grafanaAPI }) => { - const { instance_id } = current; - - // Waiting for metrics to start hitting for remotely added services - I.wait(10); - - const response = await grafanaAPI.checkMetricExist(mysql_metric, { - type: 'service_name', - value: instance_id, - }); - const result = JSON.stringify(response.data.data.result); - - assert.ok( - response.data.data.result.length !== 0, - `Metrics ${mysql_metric} from ${instance_id} should be available but got empty ${result}`, - ); - }) - .retry(1); +// TODO: unskip after PMM-13541 +// Data(instances) +// .Scenario('PMM-T1295 Verify Aurora instance metrics @instances', async ({ I, current, grafanaAPI }) => { +// const { instance_id } = current; +// +// // Waiting for metrics to start hitting for remotely added services +// I.wait(10); +// +// await grafanaAPI.checkMetricExist(mysql_metric, { +// type: 'service_name', +// value: instance_id, +// }); +// +// await grafanaAPI.checkMetricExist(aurora_metric, { +// type: 'service_name', +// value: instance_id, +// }); +// }) +// .retry(1); // FIXME: Add also check for Aurora3 once https://jira.percona.com/browse/PMM-10201 is fixed -Scenario('PMM-T1295 Verify Aurora instance metrics @instances', async ({ I, grafanaAPI }) => { +// TODO: unskip after PMM-13541 +Scenario.skip('PMM-T1295 Verify Aurora instance metrics @instances', async ({ I, grafanaAPI }) => { // Waiting for metrics to start hitting for remotely added services I.wait(10); - const response = await grafanaAPI.checkMetricExist(aurora_metric, { + await grafanaAPI.checkMetricExist(aurora_metric, { type: 'service_name', value: 'pmm-qa-aurora2-mysql-instance-1', }); - const result = JSON.stringify(response.data.data.result); - - assert.ok( - response.data.data.result.length !== 0, - `Metrics ${aurora_metric} from pmm-qa-aurora2-mysql-instance-1 should be available but got empty ${result}`, - ); }).retry(1); // FIXME: Add also check for Aurora3 once https://jira.percona.com/browse/PMM-10201 is fixed @@ -107,7 +105,6 @@ Scenario('PMM-T1295 Verify MySQL Amazon Aurora Details @instances', async ({ I, dashboardPage.waitForDashboardOpened(); await adminPage.applyTimeRange('Last 5 minutes'); await dashboardPage.applyFilter('Service Name', 'pmm-qa-aurora2-mysql-instance-1'); - await dashboardPage.verifyThereAreNoGraphsWithNA(); await dashboardPage.verifyThereAreNoGraphsWithoutData(0); }).retry(1); @@ -126,7 +123,6 @@ Data(instances) adminPage.performPageDown(5); await dashboardPage.expandEachDashboardRow(); adminPage.performPageUp(5); - await dashboardPage.verifyThereAreNoGraphsWithNA(); await dashboardPage.verifyThereAreNoGraphsWithoutData(1); }, ) @@ -142,8 +138,6 @@ Data(instances) I.amOnPage(I.buildUrlWithParams(queryAnalyticsPage.url, { from: 'now-5m' })); queryAnalyticsPage.waitForLoaded(); - await adminPage.applyTimeRange('Last 12 hours'); - queryAnalyticsPage.waitForLoaded(); await queryAnalyticsPage.filters.selectFilter(instance_id); queryAnalyticsPage.waitForLoaded(); const count = await queryAnalyticsPage.data.getCountOfItems(); diff --git a/tests/verifyAzureMySQLPostgreSQLRemoteInstance_test.js b/tests/verifyAzureMySQLPostgreSQLRemoteInstance_test.js index ce6a3ada9..8cf4286a8 100644 --- a/tests/verifyAzureMySQLPostgreSQLRemoteInstance_test.js +++ b/tests/verifyAzureMySQLPostgreSQLRemoteInstance_test.js @@ -42,7 +42,7 @@ Data(azureServices).Scenario( remoteInstancesPage.discoverAzure(); remoteInstancesPage.startMonitoringOfInstance(current.instanceToMonitor); remoteInstancesPage.verifyAddInstancePageOpened(); - remoteInstancesPage.fillRemoteRDSFields(serviceName); + await remoteInstancesPage.fillRemoteRDSFields(serviceName); I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); diff --git a/tests/verifyTLSMySQLRemoteInstance_test.js b/tests/verifyTLSMySQLRemoteInstance_test.js index 1bf3a07ce..1c732269c 100644 --- a/tests/verifyTLSMySQLRemoteInstance_test.js +++ b/tests/verifyTLSMySQLRemoteInstance_test.js @@ -31,7 +31,7 @@ let serviceName; Before(async ({ I, inventoryAPI }) => { await I.Authorize(); - const { service_name } = await inventoryAPI.apiGetNodeInfoByServiceName(SERVICE_TYPE.MYSQL, 'mysql_ssl_8.0_ssl_service'); + const { service_name } = await inventoryAPI.apiGetNodeInfoByServiceName(SERVICE_TYPE.MYSQL, 'mysql_ssl_8.0_ssl_service', 'remote'); serviceName = service_name; }); @@ -86,14 +86,12 @@ Data(instances).Scenario( }, ); -Data(instances).Scenario( +Scenario( 'Verify metrics from mysql SSL instances on PMM-Server @ssl @ssl-mysql @ssl-remote @not-ui-pipeline', async ({ - I, remoteInstancesPage, pmmInventoryPage, current, grafanaAPI, + I, grafanaAPI, }) => { - const { - metric, - } = current; + const metric = 'mysql_global_status_max_used_connections'; const remoteServiceName = `remote_${serviceName}_faker`; // Waiting for metrics to start hitting for remotely added services @@ -148,7 +146,7 @@ Scenario( adminPage.performPageDown(5); await dashboardPage.expandEachDashboardRow(); adminPage.performPageUp(5); - await dashboardPage.verifyThereAreNoGraphsWithoutData(1); + await dashboardPage.verifyThereAreNoGraphsWithoutData(2); } }, ).retry(2); @@ -185,14 +183,14 @@ Data(instances).Scenario( const agent_id = await I.verifyCommand(`docker exec ${container} pmm-admin list | grep mysqld_exporter | awk -F" " '{print $4}' | awk -F"/" '{print $3}'`); - await I.verifyCommand(`docker exec ${container} ls -la /usr/local/percona/pmm/tmp/mysqld_exporter/${agent_id} | grep tls`); - await I.verifyCommand(`docker exec ${container} rm -r /usr/local/percona/pmm/tmp/mysqld_exporter/`); - await I.verifyCommand(`docker exec ${container} ls -la /usr/local/percona/pmm/tmp/mysqld_exporter/`, 'ls: cannot access \'/usr/local/percona/pmm/tmp/mysqld_exporter\': No such file or directory', 'fail'); + await I.verifyCommand(`docker exec ${container} ls -R /usr/local/percona/pmm/tmp/agent_type_mysqld_exporter/${agent_id} | grep tls`); + await I.verifyCommand(`docker exec ${container} rm -r /usr/local/percona/pmm/tmp/agent_type_mysqld_exporter/`); + await I.verifyCommand(`docker exec ${container} ls -R /usr/local/percona/pmm/tmp/agent_type_mysqld_exporter/`, 'ls: cannot access \'/usr/local/percona/pmm/tmp/agent_type_mysqld_exporter\': No such file or directory', 'fail'); await I.verifyCommand(`docker exec ${container} pmm-admin list | grep mysqld_exporter | grep Running`); await I.verifyCommand(`docker exec ${container} pkill -f mysqld_exporter`); I.wait(10); await I.verifyCommand(`docker exec ${container} pmm-admin list | grep mysqld_exporter | grep Running`); - await I.verifyCommand(`docker exec ${container} ls -la /usr/local/percona/pmm/tmp/mysqld_exporter/${agent_id} | grep tls`); + await I.verifyCommand(`docker exec ${container} ls -R /usr/local/percona/pmm/tmp/agent_type_mysqld_exporter/${agent_id} | grep tls`); }, ).retry(1); @@ -262,19 +260,16 @@ Data(maxQueryLengthInstances).Scenario( const { service_id } = await inventoryAPI.apiGetNodeInfoByServiceName(SERVICE_TYPE.MYSQL, remoteServiceName); await pmmInventoryPage.openAgents(service_id); - if (maxQueryLength !== '') { - await pmmInventoryPage.checkAgentOtherDetailsSection('Qan mysql perfschema agent', `max_query_length=${maxQueryLength}`); - } else { - await pmmInventoryPage.checkAgentOtherDetailsSection('Qan mysql perfschema agent', `max_query_length=${maxQueryLength}`, false); - } - + await pmmInventoryPage.checkAgentOtherDetailsSection('Qan mysql perfschema agent', `max_query_length=${maxQueryLength}`); + // This extra time is needed for queries to appear in QAN await I.wait(70); // Check max visible query length is less than max_query_length option I.amOnPage(I.buildUrlWithParams(queryAnalyticsPage.url, { from: 'now-5m' })); queryAnalyticsPage.waitForLoaded(); await queryAnalyticsPage.filters.selectFilter(remoteServiceName); - I.waitForElement(queryAnalyticsPage.data.elements.queryRows, 30); - const queryFromRow = await queryAnalyticsPage.data.elements.queryRowValue(1); + await I.wait(5); + await I.waitForElement(queryAnalyticsPage.data.elements.queryRows, 30); + const queryFromRow = await I.grabTextFrom(queryAnalyticsPage.data.elements.queryRowValue(1)); if (maxQueryLength !== '' && maxQueryLength !== '-1') { assert.ok(queryFromRow.length <= maxQueryLength, `Query length exceeds max length boundary equals ${queryFromRow.length} is more than ${maxQueryLength}`); diff --git a/tests/verifyTLSPostgresRemoteInstance_test.js b/tests/verifyTLSPostgresRemoteInstance_test.js index 96c9cb3fc..7aa7a68fb 100644 --- a/tests/verifyTLSPostgresRemoteInstance_test.js +++ b/tests/verifyTLSPostgresRemoteInstance_test.js @@ -11,7 +11,7 @@ Before(async ({ I, settingsAPI }) => { const instances = new DataTable(['serviceName', 'version', 'container', 'serviceType', 'metric', 'maxQueryLength']); -instances.add(['pgsql_16_ssl_service', '16', 'pdpgsql_pgsm_ssl_16', 'postgres_ssl', 'pg_stat_database_xact_rollback', '7']); +instances.add(['pgsql_17_ssl_service', '17', 'pdpgsql_pgsm_ssl_17', 'postgres_ssl', 'pg_up', '7']); // instances.add(['pgsql_14_ssl_service', '14', 'pdpgsql_pgsm_ssl_14', 'postgres_ssl', 'pg_stat_database_xact_rollback', '7']); // instances.add(['pgsql_14_ssl_service', '13', 'pdpgsql_pgsm_ssl_13', 'postgres_ssl', 'pg_stat_database_xact_rollback', '7']); // instances.add(['pgsql_12_ssl_service', '12', 'pdpgsql_pgsm_ssl_12', 'postgres_ssl', 'pg_stat_database_xact_rollback', '7']);