From 151af4e1fd041f922ccc33c3c1342e640357f402 Mon Sep 17 00:00:00 2001 From: Saikumar Date: Mon, 4 Sep 2023 11:16:11 +0530 Subject: [PATCH 01/23] Initial tests for mysql, pgsql, proxysql and mongo --- tests/configuration/pages/pmmInventoryPage.js | 205 +++++++++++++++++- .../configuration/verifyPMMInventory_test.js | 69 ++++++ 2 files changed, 272 insertions(+), 2 deletions(-) diff --git a/tests/configuration/pages/pmmInventoryPage.js b/tests/configuration/pages/pmmInventoryPage.js index af06be86c..85c769672 100644 --- a/tests/configuration/pages/pmmInventoryPage.js +++ b/tests/configuration/pages/pmmInventoryPage.js @@ -2,14 +2,69 @@ const { I, inventoryAPI } = inject(); const assert = require('assert'); const paginationPart = require('./paginationFragment'); const servicesTab = require('./servicesTab'); +const service = (serviceName) => `//span[contains(text(),'${serviceName}')]`; module.exports = { + postgresGCSettings: { + environment: 'Remote PostgreSQL_GC env', + cluster: 'Remote PostgreSQL_GC cluster', + }, + mysqlSettings: { + environment: 'remote-mysql-new', + cluster: 'remote-mysql-cluster-new', + }, + potgresqlSettings: { + environment: 'remote-postgres-new', + cluster: 'remote-postgres-cluster-new', + }, + postgresqlAzureInputs: { + userName: remoteInstancesHelper.remote_instance.azure.azure_postgresql.userName, + password: remoteInstancesHelper.remote_instance.azure.azure_postgresql.password, + environment: 'Azure PostgreSQL environment', + cluster: 'Azure PostgreSQL cluster', + replicationSet: 'Azure PostgreSQL replica', + }, + mysqlAzureInputs: { + userName: remoteInstancesHelper.remote_instance.azure.azure_mysql.userName, + password: remoteInstancesHelper.remote_instance.azure.azure_mysql.password, + environment: 'Azure MySQL environment', + cluster: 'Azure MySQL cluster', + replicationSet: 'Azure MySQL replica', + }, + mysqlInputs: { + userName: remoteInstancesHelper.remote_instance.aws.aws_rds_5_6.username, + password: remoteInstancesHelper.remote_instance.aws.aws_rds_5_6.password, + environment: 'RDS MySQL 5.6', + cluster: 'rds56-cluster', + replicationSet: 'rds56-replication', + }, + mysql57rdsInput: { + userName: remoteInstancesHelper.remote_instance.aws.aws_rds_5_7.username, + password: remoteInstancesHelper.remote_instance.aws.aws_rds_5_7.password, + environment: 'RDS MySQL 5.7', + cluster: 'rds57-cluster', + replicationSet: 'rds57-replication', + }, + mysql80rdsInput: { + userName: remoteInstancesHelper.remote_instance.aws.aws_rds_8_0.username, + password: remoteInstancesHelper.remote_instance.aws.aws_rds_8_0.password, + environment: 'RDS MySQL 8.0', + cluster: 'rds80-cluster', + replicationSet: 'rds80-replication', + }, + postgresqlInputs: { + userName: remoteInstancesHelper.remote_instance.aws.aws_postgresql_12.userName, + password: remoteInstancesHelper.remote_instance.aws.aws_postgresql_12.password, + environment: 'RDS Postgres', + cluster: 'rdsPostgres-cluster', + replicationSet: 'rdsPostgres-replication', + }, url: 'graph/inventory?orgId=1', fields: { servicesLink: locate('[role="tablist"] a').withText('Services').withAttr({ 'aria-label': 'Tab Services' }), serviceRow: (serviceName) => locate('tr').withChild(locate('td').withAttr({ title: serviceName })), - showServiceDetails: (serviceName) => `//span[contains(text(), '${serviceName}')]//ancestor::tr//button[@data-testid="show-row-details"]`, - hideServiceDetails: (serviceName) => `//span[contains(text(), '${serviceName}')]//ancestor::tr//button[@data-testid="hide-row-details"]`, + showServiceDetails: (serviceName) => `${service(serviceName)}//ancestor::tr//button[@data-testid="show-row-details"]`, + hideServiceDetails: (serviceName) => `${service(serviceName)}//ancestor::tr//button[@data-testid="hide-row-details"]`, showAgentDetails: (agentName) => `//td[contains(text(), '${agentName}')]//ancestor::tr//button[@data-testid="show-row-details"]`, showRowDetails: '//button[@data-testid="show-row-details"]', agentStatus: locate('$details-row-content').find('a'), @@ -18,13 +73,16 @@ module.exports = { agentDetailsLabelByText: (label) => locate('[aria-label="Tags"]').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', deleteButton: locate('span').withText('Delete'), + environment: '$environment-text-input', externalExporter: locate('td').withText('External exporter'), forceModeCheckbox: locate('$force-field-label'), inventoryTable: locate('table'), inventoryTableColumn: locate('table').find('td'), inventoryTableRows: locate('tr').after('table'), inventoryTableRowCount: (count) => locate('span').withText(`${count}`), + kebabMenu: (serviceName) => `(${service(serviceName)}/following::span//*[name()='svg' and @class='css-hj6vlq'])[2]`, mongoServiceName: locate('td').withText('mongodb'), mysqlServiceName: locate('td').withText('ms-single'), // cannot be changed to locate because it's failing in I.waitForVisible() @@ -50,6 +108,7 @@ module.exports = { selectAllCheckbox: locate('$select-all'), selectRowCheckbox: locate('$select-row'), removalDialogMessage: '//form/h4', + replicationSet: '$replication_set-text-input', selectedCheckbox: '//div[descendant::input[@value="true"] and @data-testid="select-row"]', }, servicesTab, @@ -373,4 +432,146 @@ module.exports = { await I.waitForVisible(agent, 30); I.click(this.fields.backToServices); }, + + async saveConfirm() { + I.click('//div[contains(text(),\'Save Changes\')]'); + I.seeElement('//div[contains(text(),"Changing the cluster label will remove all scheduled backups")]'); + I.click('//span[normalize-space()="Confirm and save changes"]'); + }, + + async editRemoteServiceDisplayed(serviceName) { + I.waitForElement(this.fields.kebabMenu(serviceName),30); + I.wait(10); + I.click(this.fields.kebabMenu(serviceName)); + I.waitForElement('//span[contains(text(),"Edit")]',30); + I.wait(10); + I.click('//span[contains(text(),"Edit")]'); + I.waitForElement('//h3[contains(text(),"Editing")]'); + I.seeElement('//h3[contains(text(),"Editing")]'); + var lables; + switch (serviceName) { + case remoteInstancesHelper.services.mysql: + I.clearField(this.fields.environment); + I.fillField(this.fields.environment, this.mysqlSettings.environment); + I.clearField(this.fields.cluster); + I.fillField(this.fields.cluster, this.mysqlSettings.cluster); + this.saveConfirm(); + await I.click(this.fields.showServiceDetails(serviceName)); + labels = `//span[contains(text(),"${this.mysqlSettings.environment}")]`; + I.waitForElement(labels, 30); + labels = `//span[contains(text(),"${this.mysqlSettings.cluster}")]`; + I.waitForElement(labels, 30); + break; + case remoteInstancesHelper.services.mysql_ssl: + I.clearField(this.fields.environment); + I.fillField( + this.fields.environment, + remoteInstancesHelper.remote_instance.mysql.ms_8_0_ssl.environment, + ); + I.clearField(this.fields.cluster); + I.fillField( + this.fields.cluster, + remoteInstancesHelper.remote_instance.mysql.ms_8_0_ssl.clusterName, + ); + this.saveConfirm(); + await I.click(this.fields.showServiceDetails(serviceName)); + labels = `//span[contains(text(),"${remoteInstancesHelper.remote_instance.mysql.ms_8_0_ssl.environment}")]`; + I.waitForElement(labels, 30); + labels = `//span[contains(text(),"${remote_instance.mysql.ms_8_0_ssl.clusterName}")]`; + I.waitForElement(labels, 30); + break; + case remoteInstancesHelper.services.mongodb: + I.clearField(this.fields.environment); + I.fillField(this.fields.environment, 'remote-mongodb-new'); + I.clearField(this.fields.cluster); + I.fillField(this.fields.cluster, 'remote-mongodb-cluster-new'); + this.saveConfirm(); + await I.click(this.fields.showServiceDetails(serviceName)); + labels = `//span[contains(text(),"remote-mongodb-new")]`; + I.waitForElement(labels, 30); + labels = `//span[contains(text(),"remote-mongodb-cluster-new")]`; + I.waitForElement(labels, 30); + break; + case remoteInstancesHelper.services.mongodb_ssl: + I.clearField(this.fields.environment); + I.fillField( + this.fields.environment, + remoteInstancesHelper.remote_instance.mongodb.mongodb_4_4_ssl.environment, + ); + this.saveConfirm(); + await I.click(this.fields.showServiceDetails(serviceName)); + labels = `//span[contains(text(),"${remote_instance.mongodb.mongodb_4_4_ssl.environment}")]`; + I.waitForElement(labels, 30); + break; + case remoteInstancesHelper.services.postgresql: + I.clearField(this.fields.environment); + I.fillField(this.fields.environment, this.potgresqlSettings.environment); + I.clearField(this.fields.cluster); + I.fillField(this.fields.cluster, this.potgresqlSettings.cluster); + this.saveConfirm(); + await I.click(this.fields.showServiceDetails(serviceName)); + labels = `//span[contains(text(),"${this.potgresqlSettings.environment}")]`; + I.waitForElement(labels, 30); + labels = `//span[contains(text(),"${this.potgresqlSettings.cluster}")]`; + I.waitForElement(labels, 30); + break; + case remoteInstancesHelper.services.postgres_ssl: + I.clearField(this.fields.environment); + I.fillField( + this.fields.environment, + remoteInstancesHelper.remote_instance.postgresql.postgres_13_3_ssl.environment, + ); + I.clearField(this.fields.cluster); + I.fillField( + this.fields.cluster, + remoteInstancesHelper.remote_instance.postgresql.postgres_13_3_ssl.clusterName, + ); + this.saveConfirm(); + await I.click(this.fields.showServiceDetails(serviceName)); + labels = `//span[contains(text(),"${remote_instance.postgresql.postgres_13_3_ssl.environment}")]`; + I.waitForElement(labels, 30); + labels = `//span[contains(text(),"${remote_instance.postgresql.postgres_13_3_ssl.clusterName}")]`; + I.waitForElement(labels, 30); + break; + case remoteInstancesHelper.services.proxysql: + I.clearField(this.fields.environment); + I.fillField(this.fields.environment, 'remote-proxysql-new'); + I.fillField(this.fields.cluster, 'remote-proxysql-cluster-new'); + this.saveConfirm(); + await I.click(this.fields.showServiceDetails(serviceName)); + labels = `//span[contains(text(),"remote-proxysql-new")]`; + I.waitForElement(labels, 30); + labels = `//span[contains(text(),"remote-proxysql-cluster-new")]`; + I.waitForElement(labels, 30); + break; + case 'external_service_new': + I.clearField(this.fields.environment); + I.fillField(this.fields.environment, 'remote-external-service-new'); + I.clearField(this.fields.cluster); + I.fillField(this.fields.cluster, 'remote-external-cluster-new'); + this.saveConfirm(); + await I.click(this.fields.showServiceDetails(serviceName)); + labels = `//span[contains(text(),"remote-external-service-new")]`; + I.waitForElement(labels, 30); + labels = `//span[contains(text(),"remote-external-cluster-new")]`; + I.waitForElement(labels, 30); + break; + case 'postgreDoNotTrack': + case 'postgresPGStatStatements': + case 'postgresPgStatMonitor': + break; + case remoteInstancesHelper.services.postgresGC: + I.clearField(this.fields.environment); + I.fillField(this.fields.environment, this.postgresGCSettings.environment); + I.clearField(this.fields.cluster); + I.fillField(this.fields.cluster, this.postgresGCSettings.cluster); + this.saveConfirm(); + await I.click(this.fields.showServiceDetails(serviceName)); + labels = `//span[contains(text(),"${this.postgresGCSettings.environment}")]`; + I.waitForElement(labels, 30); + labels = `//span[contains(text(),"${this.postgresGCSettings.cluster}")]`; + I.waitForElement(labels, 30); + break; + } + }, }; diff --git a/tests/configuration/verifyPMMInventory_test.js b/tests/configuration/verifyPMMInventory_test.js index 4e99b6b69..8b86f5a43 100644 --- a/tests/configuration/verifyPMMInventory_test.js +++ b/tests/configuration/verifyPMMInventory_test.js @@ -1,5 +1,57 @@ const assert = require('assert'); +const { I, remoteInstancesPage, pmmInventoryPage, remoteInstancesHelper } = inject(); + +const externalExporterServiceName = 'external_service_new'; +const haproxyServiceName = 'haproxy_remote'; + +const instances = new DataTable(['name']); +const remotePostgreSQL = new DataTable(['instanceName', 'trackingOption', 'checkAgent']); +const qanFilters = new DataTable(['filterName']); +const dashboardCheck = new DataTable(['serviceName']); +const metrics = new DataTable(['serviceName', 'metricName']); + +metrics.add(['pmm-server-postgresql', 'pg_stat_database_xact_rollback']); +metrics.add([externalExporterServiceName, 'redis_uptime_in_seconds']); +metrics.add([haproxyServiceName, 'haproxy_process_start_time_seconds']); + +for (const [key, value] of Object.entries(remoteInstancesHelper.services)) { + if (value) { + switch (key) { + case 'postgresql': + // TODO: https://jira.percona.com/browse/PMM-9011 + // eslint-disable-next-line max-len + // remotePostgreSQL.add(['postgresPGStatStatements', remoteInstancesPage.fields.usePgStatStatements, pmmInventoryPage.fields.postgresPgStatements]); + // qanFilters.add([remoteInstancesPage.potgresqlSettings.environment]); + // dashboardCheck.add([remoteInstancesHelper.services.postgresql]); + // metrics.add([remoteInstancesHelper.services.postgresql, 'pg_stat_database_xact_rollback']); + break; + case 'mysql': + qanFilters.add([remoteInstancesPage.mysqlSettings.environment]); + metrics.add([remoteInstancesHelper.services.mysql, 'mysql_global_status_max_used_connections']); + break; + case 'postgresGC': + dashboardCheck.add([remoteInstancesHelper.services.postgresGC]); + qanFilters.add([remoteInstancesPage.postgresGCSettings.environment]); + break; + case 'mysql_ssl': + qanFilters.add([remoteInstancesHelper.remote_instance.mysql.ms_8_0_ssl.environment]); + break; + case 'postgres_ssl': + qanFilters.add([remoteInstancesHelper.remote_instance.postgresql.postgres_13_3_ssl.environment]); + break; + case 'mongodb': + metrics.add([remoteInstancesHelper.services.mongodb, 'mongodb_up']); + break; + case 'proxysql': + metrics.add([remoteInstancesHelper.services.proxysql, 'proxysql_up']); + break; + default: + } + instances.add([key]); + } +} + Feature('Inventory page'); Before(async ({ I }) => { @@ -208,3 +260,20 @@ Scenario( }); }, ); + +Data(instances).Scenario( + 'Verify Remote Instances can be created and edited [critical] @inventory', + async ({ + I, pmmInventoryPage, current, + }) => { + const serviceName = remoteInstancesHelper.services[current.name]; + + I.amOnPage(remoteInstancesPage.url); + remoteInstancesPage.waitUntilRemoteInstancesPageLoaded(); + remoteInstancesPage.openAddRemotePage(current.name); + await remoteInstancesPage.fillRemoteFields(serviceName); + remoteInstancesPage.createRemoteInstance(serviceName); + pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); + pmmInventoryPage.editRemoteServiceDisplayed(serviceName); + }, +); From a1ed048dcf090f0b4cbe0cdb2976718020a873c9 Mon Sep 17 00:00:00 2001 From: Saikumar Date: Mon, 4 Sep 2023 12:10:15 +0530 Subject: [PATCH 02/23] Added Mising Class Name --- tests/configuration/pages/pmmInventoryPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/configuration/pages/pmmInventoryPage.js b/tests/configuration/pages/pmmInventoryPage.js index 85c769672..ba3969a83 100644 --- a/tests/configuration/pages/pmmInventoryPage.js +++ b/tests/configuration/pages/pmmInventoryPage.js @@ -1,4 +1,4 @@ -const { I, inventoryAPI } = inject(); +const { I, inventoryAPI, remoteInstancesHelper } = inject(); const assert = require('assert'); const paginationPart = require('./paginationFragment'); const servicesTab = require('./servicesTab'); From a9df7c483eae85a4db29e7fd47a06d6b601182ca Mon Sep 17 00:00:00 2001 From: Saikumar Date: Mon, 4 Sep 2023 12:27:01 +0530 Subject: [PATCH 03/23] Fixed a typo --- tests/configuration/pages/pmmInventoryPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/configuration/pages/pmmInventoryPage.js b/tests/configuration/pages/pmmInventoryPage.js index ba3969a83..6aaac3550 100644 --- a/tests/configuration/pages/pmmInventoryPage.js +++ b/tests/configuration/pages/pmmInventoryPage.js @@ -448,7 +448,7 @@ module.exports = { I.click('//span[contains(text(),"Edit")]'); I.waitForElement('//h3[contains(text(),"Editing")]'); I.seeElement('//h3[contains(text(),"Editing")]'); - var lables; + var labels; switch (serviceName) { case remoteInstancesHelper.services.mysql: I.clearField(this.fields.environment); From 5c618651c03f5266cf0891b76cba8d29df4dda00 Mon Sep 17 00:00:00 2001 From: Saikumar Date: Mon, 11 Sep 2023 12:27:36 +0530 Subject: [PATCH 04/23] Add tests for RDS, AWS and QAN checks --- tests/configuration/pages/pmmInventoryPage.js | 231 +++++++++--------- .../configuration/verifyPMMInventory_test.js | 224 +++++++++++++++-- tests/pages/remoteInstancesPage.js | 5 + 3 files changed, 321 insertions(+), 139 deletions(-) diff --git a/tests/configuration/pages/pmmInventoryPage.js b/tests/configuration/pages/pmmInventoryPage.js index 6aaac3550..170ea84e0 100644 --- a/tests/configuration/pages/pmmInventoryPage.js +++ b/tests/configuration/pages/pmmInventoryPage.js @@ -6,58 +6,76 @@ const service = (serviceName) => `//span[contains(text(),'${serviceName}')]`; module.exports = { postgresGCSettings: { - environment: 'Remote PostgreSQL_GC env', - cluster: 'Remote PostgreSQL_GC cluster', + environment: 'Remote PostgreSQL_GC env new', + cluster: 'Remote PostgreSQL_GC cluster new', + replicationSet: 'Remote PostgreSQL_GC replica-new', }, mysqlSettings: { environment: 'remote-mysql-new', cluster: 'remote-mysql-cluster-new', + replicationSet: 'remote-mysql-replica-new', }, potgresqlSettings: { environment: 'remote-postgres-new', cluster: 'remote-postgres-cluster-new', + replicationSet: 'remote-postgres-replica-new', + }, + mongodbSettings: { + environment: 'remote-mongodb-new', + cluster: 'remote-mongodb-cluster-new', + replicationSet: 'remote-mongodb-replica-new', + }, + proxysqlSettings: { + environment: 'remote-proxysql-new', + cluster: 'remote-proxysql-cluster-new', + replicationSet: 'remote-proxysql-replica-new', + }, + externalSettings: { + environment: 'remote-external-service-new', + cluster: 'remote-external-cluster-new', + replicationSet: 'remote-external-replica-new', }, postgresqlAzureInputs: { userName: remoteInstancesHelper.remote_instance.azure.azure_postgresql.userName, password: remoteInstancesHelper.remote_instance.azure.azure_postgresql.password, - environment: 'Azure PostgreSQL environment', - cluster: 'Azure PostgreSQL cluster', - replicationSet: 'Azure PostgreSQL replica', + environment: 'Azure PostgreSQL environment new', + cluster: 'Azure PostgreSQL cluster new', + replicationSet: 'Azure PostgreSQL replica new', }, mysqlAzureInputs: { userName: remoteInstancesHelper.remote_instance.azure.azure_mysql.userName, password: remoteInstancesHelper.remote_instance.azure.azure_mysql.password, - environment: 'Azure MySQL environment', - cluster: 'Azure MySQL cluster', - replicationSet: 'Azure MySQL replica', + environment: 'Azure MySQL environment new', + cluster: 'Azure MySQL cluster new', + replicationSet: 'Azure MySQL replica new', }, mysqlInputs: { userName: remoteInstancesHelper.remote_instance.aws.aws_rds_5_6.username, password: remoteInstancesHelper.remote_instance.aws.aws_rds_5_6.password, - environment: 'RDS MySQL 5.6', - cluster: 'rds56-cluster', - replicationSet: 'rds56-replication', + environment: 'RDS MySQL 5.6 new', + cluster: 'rds56-cluster new', + replicationSet: 'rds56-replication new', }, mysql57rdsInput: { userName: remoteInstancesHelper.remote_instance.aws.aws_rds_5_7.username, password: remoteInstancesHelper.remote_instance.aws.aws_rds_5_7.password, - environment: 'RDS MySQL 5.7', - cluster: 'rds57-cluster', - replicationSet: 'rds57-replication', + environment: 'RDS MySQL 5.7 new', + cluster: 'rds57-cluster new', + replicationSet: 'rds57-replication new', }, mysql80rdsInput: { userName: remoteInstancesHelper.remote_instance.aws.aws_rds_8_0.username, password: remoteInstancesHelper.remote_instance.aws.aws_rds_8_0.password, - environment: 'RDS MySQL 8.0', - cluster: 'rds80-cluster', - replicationSet: 'rds80-replication', + environment: 'RDS MySQL 8.0 new', + cluster: 'rds80-cluster new', + replicationSet: 'rds80-replication new', }, postgresqlInputs: { userName: remoteInstancesHelper.remote_instance.aws.aws_postgresql_12.userName, password: remoteInstancesHelper.remote_instance.aws.aws_postgresql_12.password, - environment: 'RDS Postgres', - cluster: 'rdsPostgres-cluster', - replicationSet: 'rdsPostgres-replication', + environment: 'RDS Postgres new', + cluster: 'rdsPostgres-cluster new', + replicationSet: 'rdsPostgres-replication new', }, url: 'graph/inventory?orgId=1', fields: { @@ -433,11 +451,32 @@ module.exports = { I.click(this.fields.backToServices); }, + async clearFields() { + I.clearField(this.fields.environment); + I.clearField(this.fields.cluster); + I.clearField(this.fields.replicationSet); + }, + + async fillFields(serviceParameters) { + I.fillField(this.fields.environment, serviceParameters.environment); + I.fillField(this.fields.cluster, serviceParameters.cluster); + I.fillField(this.fields.replicationSet, serviceParameters.replicationSet); + }, + async saveConfirm() { I.click('//div[contains(text(),\'Save Changes\')]'); I.seeElement('//div[contains(text(),"Changing the cluster label will remove all scheduled backups")]'); I.click('//span[normalize-space()="Confirm and save changes"]'); }, + + async checkLabels(serviceParameters) { + labels = `//span[contains(text(),"${serviceParameters.environment}")]`; + I.waitForElement(labels, 30); + labels = `//span[contains(text(),"${serviceParameters.cluster}")]`; + I.waitForElement(labels, 30); + labels = `//span[contains(text(),"${serviceParameters.replicationSet}")]`; + I.waitForElement(labels, 30); + }, async editRemoteServiceDisplayed(serviceName) { I.waitForElement(this.fields.kebabMenu(serviceName),30); @@ -451,127 +490,89 @@ module.exports = { var labels; switch (serviceName) { case remoteInstancesHelper.services.mysql: - I.clearField(this.fields.environment); - I.fillField(this.fields.environment, this.mysqlSettings.environment); - I.clearField(this.fields.cluster); - I.fillField(this.fields.cluster, this.mysqlSettings.cluster); + this.clearFields(); + this.fillFields(this.mysqlSettings); this.saveConfirm(); await I.click(this.fields.showServiceDetails(serviceName)); - labels = `//span[contains(text(),"${this.mysqlSettings.environment}")]`; - I.waitForElement(labels, 30); - labels = `//span[contains(text(),"${this.mysqlSettings.cluster}")]`; - I.waitForElement(labels, 30); + this.checkLabels(this.mysqlSettings); break; - case remoteInstancesHelper.services.mysql_ssl: - I.clearField(this.fields.environment); - I.fillField( - this.fields.environment, - remoteInstancesHelper.remote_instance.mysql.ms_8_0_ssl.environment, - ); - I.clearField(this.fields.cluster); - I.fillField( - this.fields.cluster, - remoteInstancesHelper.remote_instance.mysql.ms_8_0_ssl.clusterName, - ); + case remoteInstancesHelper.services.mongodb: + this.clearFields(); + this.fillFields(this.mongodbSettings); this.saveConfirm(); await I.click(this.fields.showServiceDetails(serviceName)); - labels = `//span[contains(text(),"${remoteInstancesHelper.remote_instance.mysql.ms_8_0_ssl.environment}")]`; - I.waitForElement(labels, 30); - labels = `//span[contains(text(),"${remote_instance.mysql.ms_8_0_ssl.clusterName}")]`; - I.waitForElement(labels, 30); + this.checkLabels(this.mongodbSettings); break; - case remoteInstancesHelper.services.mongodb: - I.clearField(this.fields.environment); - I.fillField(this.fields.environment, 'remote-mongodb-new'); - I.clearField(this.fields.cluster); - I.fillField(this.fields.cluster, 'remote-mongodb-cluster-new'); + case remoteInstancesHelper.services.postgresql: + this.clearFields(); + this.fillFields(this.potgresqlSettings); this.saveConfirm(); await I.click(this.fields.showServiceDetails(serviceName)); - labels = `//span[contains(text(),"remote-mongodb-new")]`; - I.waitForElement(labels, 30); - labels = `//span[contains(text(),"remote-mongodb-cluster-new")]`; - I.waitForElement(labels, 30); + this.checkLabels(this.potgresqlSettings); break; - case remoteInstancesHelper.services.mongodb_ssl: - I.clearField(this.fields.environment); - I.fillField( - this.fields.environment, - remoteInstancesHelper.remote_instance.mongodb.mongodb_4_4_ssl.environment, - ); + case remoteInstancesHelper.services.proxysql: + this.clearFields(); + this.fillFields(this.proxysqlSettings); this.saveConfirm(); await I.click(this.fields.showServiceDetails(serviceName)); - labels = `//span[contains(text(),"${remote_instance.mongodb.mongodb_4_4_ssl.environment}")]`; - I.waitForElement(labels, 30); + this.checkLabels(this.proxysqlSettings); break; - case remoteInstancesHelper.services.postgresql: - I.clearField(this.fields.environment); - I.fillField(this.fields.environment, this.potgresqlSettings.environment); - I.clearField(this.fields.cluster); - I.fillField(this.fields.cluster, this.potgresqlSettings.cluster); + case 'external_service_new': + this.clearFields(); + this.fillFields(this.externalSettings); this.saveConfirm(); await I.click(this.fields.showServiceDetails(serviceName)); - labels = `//span[contains(text(),"${this.potgresqlSettings.environment}")]`; - I.waitForElement(labels, 30); - labels = `//span[contains(text(),"${this.potgresqlSettings.cluster}")]`; - I.waitForElement(labels, 30); + this.checkLabels(this.externalSettings); break; - case remoteInstancesHelper.services.postgres_ssl: - I.clearField(this.fields.environment); - I.fillField( - this.fields.environment, - remoteInstancesHelper.remote_instance.postgresql.postgres_13_3_ssl.environment, - ); - I.clearField(this.fields.cluster); - I.fillField( - this.fields.cluster, - remoteInstancesHelper.remote_instance.postgresql.postgres_13_3_ssl.clusterName, - ); + case remoteInstancesHelper.services.postgresGC: + this.clearFields(); + this.fillFields(this.postgresGCSettings); this.saveConfirm(); await I.click(this.fields.showServiceDetails(serviceName)); - labels = `//span[contains(text(),"${remote_instance.postgresql.postgres_13_3_ssl.environment}")]`; - I.waitForElement(labels, 30); - labels = `//span[contains(text(),"${remote_instance.postgresql.postgres_13_3_ssl.clusterName}")]`; - I.waitForElement(labels, 30); + this.checkLabels(this.postgresGCSettings); + break; + case 'rds-mysql56': + this.clearFields(); + this.fillFields(this.mysqlInputs); + this.saveConfirm(); + await I.click(this.fields.showServiceDetails(serviceName)); + this.checkLabels(this.mysqlInputs); break; - case remoteInstancesHelper.services.proxysql: - I.clearField(this.fields.environment); - I.fillField(this.fields.environment, 'remote-proxysql-new'); - I.fillField(this.fields.cluster, 'remote-proxysql-cluster-new'); + case 'pmm-qa-mysql-8-0-30': + this.clearFields(); + this.fillFields(this.mysql80rdsInput); this.saveConfirm(); await I.click(this.fields.showServiceDetails(serviceName)); - labels = `//span[contains(text(),"remote-proxysql-new")]`; - I.waitForElement(labels, 30); - labels = `//span[contains(text(),"remote-proxysql-cluster-new")]`; - I.waitForElement(labels, 30); + this.fillFields(this.mysql80rdsInput); break; - case 'external_service_new': - I.clearField(this.fields.environment); - I.fillField(this.fields.environment, 'remote-external-service-new'); - I.clearField(this.fields.cluster); - I.fillField(this.fields.cluster, 'remote-external-cluster-new'); + case 'pmm-qa-rds-mysql-5-7-39': + this.clearFields(); + this.fillFields(this.mysql57rdsInput); this.saveConfirm(); await I.click(this.fields.showServiceDetails(serviceName)); - labels = `//span[contains(text(),"remote-external-service-new")]`; - I.waitForElement(labels, 30); - labels = `//span[contains(text(),"remote-external-cluster-new")]`; - I.waitForElement(labels, 30); + this.fillFields(this.mysql57rdsInput); break; - case 'postgreDoNotTrack': - case 'postgresPGStatStatements': - case 'postgresPgStatMonitor': + case 'pmm-qa-pgsql-12': + this.clearFields(); + this.fillFields(this.postgresqlInputs); + this.saveConfirm(); + await I.click(this.fields.showServiceDetails(serviceName)); + this.fillFields(this.postgresqlInputs); break; - case remoteInstancesHelper.services.postgresGC: - I.clearField(this.fields.environment); - I.fillField(this.fields.environment, this.postgresGCSettings.environment); - I.clearField(this.fields.cluster); - I.fillField(this.fields.cluster, this.postgresGCSettings.cluster); + case 'azure-MySQL': + this.clearFields(); + this.fillFields(this.mysqlAzureInputs); this.saveConfirm(); await I.click(this.fields.showServiceDetails(serviceName)); - labels = `//span[contains(text(),"${this.postgresGCSettings.environment}")]`; - I.waitForElement(labels, 30); - labels = `//span[contains(text(),"${this.postgresGCSettings.cluster}")]`; - I.waitForElement(labels, 30); - break; - } + this.fillFields(this.mysqlAzureInputs); + break; + case 'azure-PostgreSQL': + this.clearFields(); + this.fillFields(this.postgresqlAzureInputs); + this.saveConfirm(); + await I.click(this.fields.showServiceDetails(serviceName)); + this.fillFields(this.postgresqlAzureInputs); + break; + } }, }; diff --git a/tests/configuration/verifyPMMInventory_test.js b/tests/configuration/verifyPMMInventory_test.js index 8b86f5a43..4d8e5218e 100644 --- a/tests/configuration/verifyPMMInventory_test.js +++ b/tests/configuration/verifyPMMInventory_test.js @@ -6,52 +6,58 @@ const externalExporterServiceName = 'external_service_new'; const haproxyServiceName = 'haproxy_remote'; const instances = new DataTable(['name']); -const remotePostgreSQL = new DataTable(['instanceName', 'trackingOption', 'checkAgent']); const qanFilters = new DataTable(['filterName']); -const dashboardCheck = new DataTable(['serviceName']); -const metrics = new DataTable(['serviceName', 'metricName']); - -metrics.add(['pmm-server-postgresql', 'pg_stat_database_xact_rollback']); -metrics.add([externalExporterServiceName, 'redis_uptime_in_seconds']); -metrics.add([haproxyServiceName, 'haproxy_process_start_time_seconds']); for (const [key, value] of Object.entries(remoteInstancesHelper.services)) { if (value) { switch (key) { case 'postgresql': // TODO: https://jira.percona.com/browse/PMM-9011 - // eslint-disable-next-line max-len - // remotePostgreSQL.add(['postgresPGStatStatements', remoteInstancesPage.fields.usePgStatStatements, pmmInventoryPage.fields.postgresPgStatements]); // qanFilters.add([remoteInstancesPage.potgresqlSettings.environment]); - // dashboardCheck.add([remoteInstancesHelper.services.postgresql]); - // metrics.add([remoteInstancesHelper.services.postgresql, 'pg_stat_database_xact_rollback']); break; case 'mysql': qanFilters.add([remoteInstancesPage.mysqlSettings.environment]); - metrics.add([remoteInstancesHelper.services.mysql, 'mysql_global_status_max_used_connections']); break; case 'postgresGC': - dashboardCheck.add([remoteInstancesHelper.services.postgresGC]); qanFilters.add([remoteInstancesPage.postgresGCSettings.environment]); break; - case 'mysql_ssl': - qanFilters.add([remoteInstancesHelper.remote_instance.mysql.ms_8_0_ssl.environment]); - break; - case 'postgres_ssl': - qanFilters.add([remoteInstancesHelper.remote_instance.postgresql.postgres_13_3_ssl.environment]); - break; case 'mongodb': - metrics.add([remoteInstancesHelper.services.mongodb, 'mongodb_up']); - break; + qanFilters.add([remoteInstancesPage.mongodbSettings.environment]); case 'proxysql': - metrics.add([remoteInstancesHelper.services.proxysql, 'proxysql_up']); break; - default: } instances.add([key]); } } +const azureServices = new DataTable(['name', 'instanceToMonitor']); + +if (remoteInstancesHelper.getInstanceStatus('azure').azure_mysql.enabled) { + azureServices.add(['azure-MySQL', 'pmm2-qa-mysql']); + qanFilters.add([remoteInstancesPage.mysqlAzureInputs.environment]); +} + +if (remoteInstancesHelper.getInstanceStatus('azure').azure_postgresql.enabled) { + azureServices.add(['azure-PostgreSQL', 'pmm2-qa-postgresql']); + qanFilters.add([remoteInstancesPage.postgresqlAzureInputs.environment]); +} + +const aws_instances = new DataTable(['service_name', 'password', 'instance_id', 'cluster_name']); + +aws_instances.add([ + remoteInstancesHelper.remote_instance.aws.aurora.aurora2.address, + remoteInstancesHelper.remote_instance.aws.aurora.aurora2.password, + remoteInstancesHelper.remote_instance.aws.aurora.aurora2.instance_id, + remoteInstancesHelper.remote_instance.aws.aurora.aurora2.cluster_name, +]); +aws_instances.add([ + remoteInstancesHelper.remote_instance.aws.aurora.aurora3.address, + remoteInstancesHelper.remote_instance.aws.aurora.aurora3.password, + remoteInstancesHelper.remote_instance.aws.aurora.aurora3.instance_id, + remoteInstancesHelper.remote_instance.aws.aurora.aurora3.cluster_name, +]); + + Feature('Inventory page'); Before(async ({ I }) => { @@ -262,7 +268,7 @@ Scenario( ); Data(instances).Scenario( - 'Verify Remote Instances can be created and edited [critical] @inventory', + 'PMM-T2340 - Verify Remote Instances can be created and edited [critical] @inventory @inventory-fb', async ({ I, pmmInventoryPage, current, }) => { @@ -277,3 +283,173 @@ Data(instances).Scenario( pmmInventoryPage.editRemoteServiceDisplayed(serviceName); }, ); + +Scenario( + 'PMM-T2340 - Verify adding and editing external exporter service via UI @inventory @inventory-fb', + async ({ I, remoteInstancesPage, pmmInventoryPage }) => { + I.amOnPage(remoteInstancesPage.url); + remoteInstancesPage.waitUntilRemoteInstancesPageLoaded(); + remoteInstancesPage.openAddRemotePage('external'); + await remoteInstancesPage.fillRemoteFields(externalExporterServiceName); + I.waitForVisible(remoteInstancesPage.fields.addService, 30); + I.click(remoteInstancesPage.fields.addService); + pmmInventoryPage.verifyRemoteServiceIsDisplayed(externalExporterServiceName); + pmmInventoryPage.editRemoteServiceDisplayed(externalExporterServiceName); + }, +).retry(0); + +Scenario( + 'PMM-T2340 - Verify adding and editing RDS instances [critical] @inventory @inventory-fb', + async ({ I, remoteInstancesPage, pmmInventoryPage }) => { + const serviceName = remoteInstancesPage.mysql57rds['Service Name']; + + I.amOnPage(remoteInstancesPage.url); + remoteInstancesPage.waitUntilRemoteInstancesPageLoaded().openAddAWSRDSMySQLPage(); + remoteInstancesPage.discoverRDS(); + remoteInstancesPage.verifyInstanceIsDiscovered(serviceName); + remoteInstancesPage.startMonitoringOfInstance(serviceName); + remoteInstancesPage.verifyAddInstancePageOpened(); + remoteInstancesPage.fillRemoteRDSFields(serviceName); + remoteInstancesPage.createRemoteInstance(serviceName); + pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); + pmmInventoryPage.editRemoteServiceDisplayed(serviceName); + }, +); + +Scenario( + '@PMM-T635 - Verify Adding HAProxy service via UI @instances @instances-fb', + async ({ + I, remoteInstancesPage, pmmInventoryPage, + }) => { + I.amOnPage(remoteInstancesPage.url); + remoteInstancesPage.waitUntilRemoteInstancesPageLoaded(); + remoteInstancesPage.openAddRemotePage('haproxy'); + I.waitForVisible(remoteInstancesPage.fields.hostName, 30); + I.fillField( + remoteInstancesPage.fields.hostName, + remoteInstancesHelper.remote_instance.haproxy.haproxy_2.host, + ); + I.fillField(remoteInstancesPage.fields.serviceName, haproxyServiceName); + I.clearField(remoteInstancesPage.fields.portNumber); + I.fillField( + remoteInstancesPage.fields.portNumber, + remoteInstancesHelper.remote_instance.haproxy.haproxy_2.port, + ); + I.scrollPageToBottom(); + I.waitForVisible(remoteInstancesPage.fields.addService, 30); + I.click(remoteInstancesPage.fields.addService); + pmmInventoryPage.verifyRemoteServiceIsDisplayed(haproxyServiceName); + pmmInventoryPage.editRemoteServiceDisplayed(haproxyServiceName); + }, +); + + +Scenario( + 'PMM-T2340 - Verify adding and editing PostgreSQL RDS monitoring to PMM via UI @inventory @inventory-fb', + async ({ + I, remoteInstancesPage, pmmInventoryPage, + }) => { + const serviceName = 'pmm-qa-pgsql-12'; + + I.amOnPage(remoteInstancesPage.url); + remoteInstancesPage.waitUntilRemoteInstancesPageLoaded().openAddAWSRDSMySQLPage(); + remoteInstancesPage.discoverRDS(); + remoteInstancesPage.verifyInstanceIsDiscovered(serviceName); + remoteInstancesPage.startMonitoringOfInstance(serviceName); + remoteInstancesPage.verifyAddInstancePageOpened(); + const grabbedHostname = await I.grabValueFrom(remoteInstancesPage.fields.hostName); + + assert.ok(grabbedHostname.startsWith(serviceName), `Hostname is incorrect: ${grabbedHostname}`); + I.seeInField(remoteInstancesPage.fields.serviceName, serviceName); + remoteInstancesPage.fillRemoteRDSFields(serviceName); + remoteInstancesPage.createRemoteInstance(serviceName); + pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); + pmmInventoryPage.editRemoteServiceDisplayed(serviceName); + }, +); + +Data(azureServices).Scenario( + 'PMM-T2340 - Verify adding and editing monitoring for Azure @inventory @inventory-fb', + async ({ + I, remoteInstancesPage, pmmInventoryPage, settingsAPI, current, inventoryAPI, + }) => { + const serviceName = current.name; + + await settingsAPI.enableAzure(); + I.amOnPage(remoteInstancesPage.url); + remoteInstancesPage.openAddAzure(); + remoteInstancesPage.discoverAzure(); + remoteInstancesPage.startMonitoringOfInstance(current.instanceToMonitor); + remoteInstancesPage.verifyAddInstancePageOpened(); + remoteInstancesPage.fillRemoteRDSFields(serviceName); + I.click(remoteInstancesPage.fields.addService); + pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); + pmmInventoryPage.editRemoteServiceDisplayed(serviceName); + }, +); + +Data(aws_instances).Scenario('PMM-T2340 Verify adding and editing Aurora remote instance @inventory @inventory-fb', async ({ + I, addInstanceAPI, inventoryAPI, current, +}) => { + const { + service_name, password, instance_id, cluster_name, + } = current; + + const details = { + add_node: { + node_name: service_name, + node_type: 'REMOTE_NODE', + }, + aws_access_key: remoteInstancesHelper.remote_instance.aws.aurora.aws_access_key, + aws_secret_key: remoteInstancesHelper.remote_instance.aws.aurora.aws_secret_key, + address: service_name, + service_name: instance_id, + port: remoteInstancesHelper.remote_instance.aws.aurora.port, + username: remoteInstancesHelper.remote_instance.aws.aurora.username, + password, + instance_id, + cluster: cluster_name, + }; + + await addInstanceAPI.addRDS(details.service_name, details); + + I.amOnPage(pmmInventoryPage.url); + pmmInventoryPage.verifyRemoteServiceIsDisplayed(details.service_name); + pmmInventoryPage.editRemoteServiceDisplayed(details.service_name); +}); + +Data(qanFilters).Scenario( + 'PMM-T2340 - Verify QAN after remote instance is added @inventory @inventory-fb', + async ({ + I, qanOverview, qanFilters, qanPage, current, + }) => { + I.amOnPage(qanPage.url); + qanOverview.waitForOverviewLoaded(); + await qanFilters.applyFilter(current.filterName); + qanOverview.waitForOverviewLoaded(); + const count = await qanOverview.getCountOfItems(); + + assert.ok(count > 0, `The queries for filter ${current.filterName} instance do NOT exist`); + }, +).retry(2); + + +Data(aws_instances).Scenario( + 'PMM-T2340 Verify QAN after Aurora instance is added and eidted @inventory @inventory-fb', + async ({ + I, qanOverview, qanFilters, qanPage, current, adminPage, + }) => { + const { instance_id } = current; + + I.amOnPage(qanPage.url); + qanOverview.waitForOverviewLoaded(); + await adminPage.applyTimeRange('Last 12 hours'); + qanOverview.waitForOverviewLoaded(); + qanFilters.waitForFiltersToLoad(); + await qanFilters.applySpecificFilter(instance_id); + qanOverview.waitForOverviewLoaded(); + const count = await qanOverview.getCountOfItems(); + + assert.ok(count > 0, `The queries for service ${instance_id} instance do NOT exist, check QAN Data`); + }, + ).retry(1); diff --git a/tests/pages/remoteInstancesPage.js b/tests/pages/remoteInstancesPage.js index d09251889..346a7fcf9 100644 --- a/tests/pages/remoteInstancesPage.js +++ b/tests/pages/remoteInstancesPage.js @@ -23,6 +23,11 @@ module.exports = { environment: 'remote-postgres', cluster: 'remote-postgres-cluster', }, + mongodbSettings: { + environment: 'remote-mongodb', + cluster: 'remote-mongodb-cluster', + replicationSet: 'remote-mongodb-replica', + }, postgresqlAzureInputs: { userName: remoteInstancesHelper.remote_instance.azure.azure_postgresql.userName, password: remoteInstancesHelper.remote_instance.azure.azure_postgresql.password, From adeebcd4786086b10df7016353e9e8d3012e2dc2 Mon Sep 17 00:00:00 2001 From: Saikumar Date: Mon, 11 Sep 2023 12:32:44 +0530 Subject: [PATCH 05/23] Updates --- tests/configuration/verifyPMMInventory_test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/configuration/verifyPMMInventory_test.js b/tests/configuration/verifyPMMInventory_test.js index 4d8e5218e..9ab2ea8c8 100644 --- a/tests/configuration/verifyPMMInventory_test.js +++ b/tests/configuration/verifyPMMInventory_test.js @@ -23,6 +23,7 @@ for (const [key, value] of Object.entries(remoteInstancesHelper.services)) { break; case 'mongodb': qanFilters.add([remoteInstancesPage.mongodbSettings.environment]); + break; case 'proxysql': break; } From 8e241277f00dd21531cd60d69601ddd1709d8695 Mon Sep 17 00:00:00 2001 From: Saikumar Date: Mon, 11 Sep 2023 15:53:39 +0530 Subject: [PATCH 06/23] Improvements --- tests/configuration/pages/pmmInventoryPage.js | 22 ++++++++++++------- .../configuration/verifyPMMInventory_test.js | 1 + 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/tests/configuration/pages/pmmInventoryPage.js b/tests/configuration/pages/pmmInventoryPage.js index 170ea84e0..f8ba64f07 100644 --- a/tests/configuration/pages/pmmInventoryPage.js +++ b/tests/configuration/pages/pmmInventoryPage.js @@ -95,6 +95,8 @@ module.exports = { deleteButton: locate('span').withText('Delete'), environment: '$environment-text-input', externalExporter: locate('td').withText('External exporter'), + editAction: '//span[contains(text(),"Edit")]', + editText: '//h3[contains(text(),"Editing")]', forceModeCheckbox: locate('$force-field-label'), inventoryTable: locate('table'), inventoryTableColumn: locate('table').find('td'), @@ -128,6 +130,9 @@ module.exports = { removalDialogMessage: '//form/h4', replicationSet: '$replication_set-text-input', selectedCheckbox: '//div[descendant::input[@value="true"] and @data-testid="select-row"]', + saveButton: '//div[contains(text(),\'Save Changes\')]', + saveConfirmButton: '//span[normalize-space()="Confirm and save changes"]', + savePopupMessage: '//div[contains(text(),"Changing the cluster label will remove all scheduled backups")]', }, servicesTab, pagination: paginationPart, @@ -464,12 +469,13 @@ module.exports = { }, async saveConfirm() { - I.click('//div[contains(text(),\'Save Changes\')]'); - I.seeElement('//div[contains(text(),"Changing the cluster label will remove all scheduled backups")]'); - I.click('//span[normalize-space()="Confirm and save changes"]'); + I.click(this.fields.saveButton); + I.seeElement(this.fields.savePopupMessage); + I.click(this.fields.saveConfirmButton); }, async checkLabels(serviceParameters) { + var labels; labels = `//span[contains(text(),"${serviceParameters.environment}")]`; I.waitForElement(labels, 30); labels = `//span[contains(text(),"${serviceParameters.cluster}")]`; @@ -482,12 +488,11 @@ module.exports = { I.waitForElement(this.fields.kebabMenu(serviceName),30); I.wait(10); I.click(this.fields.kebabMenu(serviceName)); - I.waitForElement('//span[contains(text(),"Edit")]',30); + I.waitForElement(this.fields.editAction,30); I.wait(10); - I.click('//span[contains(text(),"Edit")]'); - I.waitForElement('//h3[contains(text(),"Editing")]'); - I.seeElement('//h3[contains(text(),"Editing")]'); - var labels; + I.click(this.fields.editAction); + I.waitForElement(this.fields.editText); + I.seeElement(this.fields.editText); switch (serviceName) { case remoteInstancesHelper.services.mysql: this.clearFields(); @@ -573,6 +578,7 @@ module.exports = { await I.click(this.fields.showServiceDetails(serviceName)); this.fillFields(this.postgresqlAzureInputs); break; + default: } }, }; diff --git a/tests/configuration/verifyPMMInventory_test.js b/tests/configuration/verifyPMMInventory_test.js index 9ab2ea8c8..067c40bcd 100644 --- a/tests/configuration/verifyPMMInventory_test.js +++ b/tests/configuration/verifyPMMInventory_test.js @@ -26,6 +26,7 @@ for (const [key, value] of Object.entries(remoteInstancesHelper.services)) { break; case 'proxysql': break; + default: } instances.add([key]); } From 9eeddde1936a5570b8d44ebc0f24ddf6b47d6a0f Mon Sep 17 00:00:00 2001 From: Saikumar Date: Sat, 23 Sep 2023 11:18:24 +0530 Subject: [PATCH 07/23] Addressed review comments --- tests/configuration/pages/pmmInventoryPage.js | 175 +++++++----------- tests/configuration/testData.js | 81 ++++++++ .../configuration/verifyPMMInventory_test.js | 14 +- 3 files changed, 156 insertions(+), 114 deletions(-) create mode 100644 tests/configuration/testData.js diff --git a/tests/configuration/pages/pmmInventoryPage.js b/tests/configuration/pages/pmmInventoryPage.js index f8ba64f07..7b3f79478 100644 --- a/tests/configuration/pages/pmmInventoryPage.js +++ b/tests/configuration/pages/pmmInventoryPage.js @@ -1,4 +1,6 @@ -const { I, inventoryAPI, remoteInstancesHelper } = inject(); +const { I, inventoryAPI, remoteInstancesHelper, adminPage } = inject(); +const testData = require('../testData'); + const assert = require('assert'); const paginationPart = require('./paginationFragment'); const servicesTab = require('./servicesTab'); @@ -95,14 +97,14 @@ module.exports = { deleteButton: locate('span').withText('Delete'), environment: '$environment-text-input', externalExporter: locate('td').withText('External exporter'), - editAction: '//span[contains(text(),"Edit")]', - editText: '//h3[contains(text(),"Editing")]', + editAction: locate('span').withText('Edit'), + editText: locate('h3').withText('Editing'), forceModeCheckbox: locate('$force-field-label'), inventoryTable: locate('table'), inventoryTableColumn: locate('table').find('td'), inventoryTableRows: locate('tr').after('table'), inventoryTableRowCount: (count) => locate('span').withText(`${count}`), - kebabMenu: (serviceName) => `(${service(serviceName)}/following::span//*[name()='svg' and @class='css-hj6vlq'])[2]`, + kebabMenu: (serviceName) => `${service(serviceName)}//ancestor::tr//button[@data-testid="dropdown-menu-toggle"]`, mongoServiceName: locate('td').withText('mongodb'), mysqlServiceName: locate('td').withText('ms-single'), // cannot be changed to locate because it's failing in I.waitForVisible() @@ -130,9 +132,9 @@ module.exports = { removalDialogMessage: '//form/h4', replicationSet: '$replication_set-text-input', selectedCheckbox: '//div[descendant::input[@value="true"] and @data-testid="select-row"]', - saveButton: '//div[contains(text(),\'Save Changes\')]', - saveConfirmButton: '//span[normalize-space()="Confirm and save changes"]', - savePopupMessage: '//div[contains(text(),"Changing the cluster label will remove all scheduled backups")]', + saveButton: locate('button').withChild('div').withText('Save Changes'), + saveConfirmButton: locate('span').withText('Confirm and save changes'), + savePopupMessage: locate('p').withText('Changing existing labels can affect other parts of PMM dependent on it'), }, servicesTab, pagination: paginationPart, @@ -457,9 +459,12 @@ module.exports = { }, async clearFields() { - I.clearField(this.fields.environment); - I.clearField(this.fields.cluster); - I.clearField(this.fields.replicationSet); + adminPage.customClearField(this.fields.environment); + //I.clearField(this.fields.environment); + adminPage.customClearField(this.fields.cluster); + //I.clearField(this.fields.cluster); + adminPage.customClearField(this.fields.replicationSet); + //I.clearField(this.fields.replicationSet); }, async fillFields(serviceParameters) { @@ -474,8 +479,8 @@ module.exports = { I.click(this.fields.saveConfirmButton); }, - async checkLabels(serviceParameters) { - var labels; + async verifyLabels(serviceParameters) { + let labels; labels = `//span[contains(text(),"${serviceParameters.environment}")]`; I.waitForElement(labels, 30); labels = `//span[contains(text(),"${serviceParameters.cluster}")]`; @@ -483,102 +488,58 @@ module.exports = { labels = `//span[contains(text(),"${serviceParameters.replicationSet}")]`; I.waitForElement(labels, 30); }, - - async editRemoteServiceDisplayed(serviceName) { - I.waitForElement(this.fields.kebabMenu(serviceName),30); - I.wait(10); + + async editRemoteService(serviceName) { + I.waitForElement(this.fields.kebabMenu(serviceName), 30); I.click(this.fields.kebabMenu(serviceName)); - I.waitForElement(this.fields.editAction,30); - I.wait(10); + I.waitForElement(this.fields.editAction, 30); I.click(this.fields.editAction); - I.waitForElement(this.fields.editText); + I.waitForElement(this.fields.editText, 30); I.seeElement(this.fields.editText); - switch (serviceName) { - case remoteInstancesHelper.services.mysql: - this.clearFields(); - this.fillFields(this.mysqlSettings); - this.saveConfirm(); - await I.click(this.fields.showServiceDetails(serviceName)); - this.checkLabels(this.mysqlSettings); - break; - case remoteInstancesHelper.services.mongodb: - this.clearFields(); - this.fillFields(this.mongodbSettings); - this.saveConfirm(); - await I.click(this.fields.showServiceDetails(serviceName)); - this.checkLabels(this.mongodbSettings); - break; - case remoteInstancesHelper.services.postgresql: - this.clearFields(); - this.fillFields(this.potgresqlSettings); - this.saveConfirm(); - await I.click(this.fields.showServiceDetails(serviceName)); - this.checkLabels(this.potgresqlSettings); - break; - case remoteInstancesHelper.services.proxysql: - this.clearFields(); - this.fillFields(this.proxysqlSettings); - this.saveConfirm(); - await I.click(this.fields.showServiceDetails(serviceName)); - this.checkLabels(this.proxysqlSettings); - break; - case 'external_service_new': - this.clearFields(); - this.fillFields(this.externalSettings); - this.saveConfirm(); - await I.click(this.fields.showServiceDetails(serviceName)); - this.checkLabels(this.externalSettings); - break; - case remoteInstancesHelper.services.postgresGC: - this.clearFields(); - this.fillFields(this.postgresGCSettings); - this.saveConfirm(); - await I.click(this.fields.showServiceDetails(serviceName)); - this.checkLabels(this.postgresGCSettings); - break; - case 'rds-mysql56': - this.clearFields(); - this.fillFields(this.mysqlInputs); - this.saveConfirm(); - await I.click(this.fields.showServiceDetails(serviceName)); - this.checkLabels(this.mysqlInputs); - break; - case 'pmm-qa-mysql-8-0-30': - this.clearFields(); - this.fillFields(this.mysql80rdsInput); - this.saveConfirm(); - await I.click(this.fields.showServiceDetails(serviceName)); - this.fillFields(this.mysql80rdsInput); - break; - case 'pmm-qa-rds-mysql-5-7-39': - this.clearFields(); - this.fillFields(this.mysql57rdsInput); - this.saveConfirm(); - await I.click(this.fields.showServiceDetails(serviceName)); - this.fillFields(this.mysql57rdsInput); - break; - case 'pmm-qa-pgsql-12': - this.clearFields(); - this.fillFields(this.postgresqlInputs); - this.saveConfirm(); - await I.click(this.fields.showServiceDetails(serviceName)); - this.fillFields(this.postgresqlInputs); - break; - case 'azure-MySQL': - this.clearFields(); - this.fillFields(this.mysqlAzureInputs); - this.saveConfirm(); - await I.click(this.fields.showServiceDetails(serviceName)); - this.fillFields(this.mysqlAzureInputs); - break; - case 'azure-PostgreSQL': - this.clearFields(); - this.fillFields(this.postgresqlAzureInputs); - this.saveConfirm(); - await I.click(this.fields.showServiceDetails(serviceName)); - this.fillFields(this.postgresqlAzureInputs); - break; - default: - } - }, + this.clearFields(); + + const editActions = { + set: function (testData) { + this.data = testData; + }, + 'mysql_remote_new': function () { + return (this.data.mysqlSettings); + }, + 'mongodb_remote_new': function () { + return (this.data.mongodbSettings); + }, + 'postgresql_remote_new': function () { + return (this.data.potgresqlSettings); + }, + 'proxysql_remote_new': function () { + return (this.data.proxysqlSettings); + }, + 'external_service_new': function () { + return (this.data.externalSettings); + }, + 'rds-mysql56': function () { + return (this.data.mysqlInputs); + }, + 'pmm-qa-mysql-8-0-30': function () { + return (this.data.mysql80rdsInput); + }, + 'pmm-qa-rds-mysql-5-7-39': function () { + return (this.data.mysql57rdsInput); + }, + 'pmm-qa-pgsql-12': function () { + return (this.data.postgresqlInputs); + }, + 'azure-MySQL': function () { + return (this.data.mysqlAzureInputs); + }, + 'azure-PostgreSQL': function () { + return (this.data.postgresqlAzureInputs); + }, + }; + editActions.set(testData); + this.fillFields(editActions[serviceName](testData)); + this.saveConfirm(); + await I.click(this.fields.showServiceDetails(serviceName)); + this.verifyLabels(editActions[serviceName](testData)); + }, }; diff --git a/tests/configuration/testData.js b/tests/configuration/testData.js new file mode 100644 index 000000000..828728d77 --- /dev/null +++ b/tests/configuration/testData.js @@ -0,0 +1,81 @@ +const {remoteInstancesHelper} = inject(); + +const filterOperators = { + equal: '= (EQUAL)', + regex: '=~ (REGEX)', +}; + +module.exports = { + postgresGCSettings: { + environment: 'Remote PostgreSQL_GC env new', + cluster: 'Remote PostgreSQL_GC cluster new', + replicationSet: 'Remote PostgreSQL_GC replica-new', + }, + mysqlSettings: { + environment: 'remote-mysql-new', + cluster: 'remote-mysql-cluster-new', + replicationSet: 'remote-mysql-replica-new', + }, + potgresqlSettings: { + environment: 'remote-postgres-new', + cluster: 'remote-postgres-cluster-new', + replicationSet: 'remote-postgres-replica-new', + }, + mongodbSettings: { + environment: 'remote-mongodb-new', + cluster: 'remote-mongodb-cluster-new', + replicationSet: 'remote-mongodb-replica-new', + }, + proxysqlSettings: { + environment: 'remote-proxysql-new', + cluster: 'remote-proxysql-cluster-new', + replicationSet: 'remote-proxysql-replica-new', + }, + externalSettings: { + environment: 'remote-external-service-new', + cluster: 'remote-external-cluster-new', + replicationSet: 'remote-external-replica-new', + }, + postgresqlAzureInputs: { + userName: remoteInstancesHelper.remote_instance.azure.azure_postgresql.userName, + password: remoteInstancesHelper.remote_instance.azure.azure_postgresql.password, + environment: 'Azure PostgreSQL environment new', + cluster: 'Azure PostgreSQL cluster new', + replicationSet: 'Azure PostgreSQL replica new', + }, + mysqlAzureInputs: { + userName: remoteInstancesHelper.remote_instance.azure.azure_mysql.userName, + password: remoteInstancesHelper.remote_instance.azure.azure_mysql.password, + environment: 'Azure MySQL environment new', + cluster: 'Azure MySQL cluster new', + replicationSet: 'Azure MySQL replica new', + }, + mysqlInputs: { + userName: remoteInstancesHelper.remote_instance.aws.aws_rds_5_6.username, + password: remoteInstancesHelper.remote_instance.aws.aws_rds_5_6.password, + environment: 'RDS MySQL 5.6 new', + cluster: 'rds56-cluster new', + replicationSet: 'rds56-replication new', + }, + mysql57rdsInput: { + userName: remoteInstancesHelper.remote_instance.aws.aws_rds_5_7.username, + password: remoteInstancesHelper.remote_instance.aws.aws_rds_5_7.password, + environment: 'RDS MySQL 5.7 new', + cluster: 'rds57-cluster new', + replicationSet: 'rds57-replication new', + }, + mysql80rdsInput: { + userName: remoteInstancesHelper.remote_instance.aws.aws_rds_8_0.username, + password: remoteInstancesHelper.remote_instance.aws.aws_rds_8_0.password, + environment: 'RDS MySQL 8.0 new', + cluster: 'rds80-cluster new', + replicationSet: 'rds80-replication new', + }, + postgresqlInputs: { + userName: remoteInstancesHelper.remote_instance.aws.aws_postgresql_12.userName, + password: remoteInstancesHelper.remote_instance.aws.aws_postgresql_12.password, + environment: 'RDS Postgres new', + cluster: 'rdsPostgres-cluster new', + replicationSet: 'rdsPostgres-replication new', + }, +}; diff --git a/tests/configuration/verifyPMMInventory_test.js b/tests/configuration/verifyPMMInventory_test.js index 067c40bcd..e31c20289 100644 --- a/tests/configuration/verifyPMMInventory_test.js +++ b/tests/configuration/verifyPMMInventory_test.js @@ -282,7 +282,7 @@ Data(instances).Scenario( await remoteInstancesPage.fillRemoteFields(serviceName); remoteInstancesPage.createRemoteInstance(serviceName); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); - pmmInventoryPage.editRemoteServiceDisplayed(serviceName); + pmmInventoryPage.editRemoteService(serviceName); }, ); @@ -296,7 +296,7 @@ Scenario( I.waitForVisible(remoteInstancesPage.fields.addService, 30); I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(externalExporterServiceName); - pmmInventoryPage.editRemoteServiceDisplayed(externalExporterServiceName); + pmmInventoryPage.editRemoteService(externalExporterServiceName); }, ).retry(0); @@ -314,7 +314,7 @@ Scenario( remoteInstancesPage.fillRemoteRDSFields(serviceName); remoteInstancesPage.createRemoteInstance(serviceName); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); - pmmInventoryPage.editRemoteServiceDisplayed(serviceName); + pmmInventoryPage.editRemoteService(serviceName); }, ); @@ -341,7 +341,7 @@ Scenario( I.waitForVisible(remoteInstancesPage.fields.addService, 30); I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(haproxyServiceName); - pmmInventoryPage.editRemoteServiceDisplayed(haproxyServiceName); + pmmInventoryPage.editRemoteService(haproxyServiceName); }, ); @@ -366,7 +366,7 @@ Scenario( remoteInstancesPage.fillRemoteRDSFields(serviceName); remoteInstancesPage.createRemoteInstance(serviceName); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); - pmmInventoryPage.editRemoteServiceDisplayed(serviceName); + pmmInventoryPage.editRemoteService(serviceName); }, ); @@ -386,7 +386,7 @@ Data(azureServices).Scenario( remoteInstancesPage.fillRemoteRDSFields(serviceName); I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); - pmmInventoryPage.editRemoteServiceDisplayed(serviceName); + pmmInventoryPage.editRemoteService(serviceName); }, ); @@ -417,7 +417,7 @@ Data(aws_instances).Scenario('PMM-T2340 Verify adding and editing Aurora remote I.amOnPage(pmmInventoryPage.url); pmmInventoryPage.verifyRemoteServiceIsDisplayed(details.service_name); - pmmInventoryPage.editRemoteServiceDisplayed(details.service_name); + pmmInventoryPage.editRemoteService(details.service_name); }); Data(qanFilters).Scenario( From 1cb62fdfdcd99966d12b01b2efe84c272a26093f Mon Sep 17 00:00:00 2001 From: Saikumar Date: Sat, 23 Sep 2023 17:24:03 +0530 Subject: [PATCH 08/23] Updates, renames --- tests/configuration/pages/pmmInventoryPage.js | 84 ++----------------- tests/configuration/testData.js | 15 ++++ 2 files changed, 24 insertions(+), 75 deletions(-) diff --git a/tests/configuration/pages/pmmInventoryPage.js b/tests/configuration/pages/pmmInventoryPage.js index 7b3f79478..8b3be7dec 100644 --- a/tests/configuration/pages/pmmInventoryPage.js +++ b/tests/configuration/pages/pmmInventoryPage.js @@ -7,78 +7,6 @@ const servicesTab = require('./servicesTab'); const service = (serviceName) => `//span[contains(text(),'${serviceName}')]`; module.exports = { - postgresGCSettings: { - environment: 'Remote PostgreSQL_GC env new', - cluster: 'Remote PostgreSQL_GC cluster new', - replicationSet: 'Remote PostgreSQL_GC replica-new', - }, - mysqlSettings: { - environment: 'remote-mysql-new', - cluster: 'remote-mysql-cluster-new', - replicationSet: 'remote-mysql-replica-new', - }, - potgresqlSettings: { - environment: 'remote-postgres-new', - cluster: 'remote-postgres-cluster-new', - replicationSet: 'remote-postgres-replica-new', - }, - mongodbSettings: { - environment: 'remote-mongodb-new', - cluster: 'remote-mongodb-cluster-new', - replicationSet: 'remote-mongodb-replica-new', - }, - proxysqlSettings: { - environment: 'remote-proxysql-new', - cluster: 'remote-proxysql-cluster-new', - replicationSet: 'remote-proxysql-replica-new', - }, - externalSettings: { - environment: 'remote-external-service-new', - cluster: 'remote-external-cluster-new', - replicationSet: 'remote-external-replica-new', - }, - postgresqlAzureInputs: { - userName: remoteInstancesHelper.remote_instance.azure.azure_postgresql.userName, - password: remoteInstancesHelper.remote_instance.azure.azure_postgresql.password, - environment: 'Azure PostgreSQL environment new', - cluster: 'Azure PostgreSQL cluster new', - replicationSet: 'Azure PostgreSQL replica new', - }, - mysqlAzureInputs: { - userName: remoteInstancesHelper.remote_instance.azure.azure_mysql.userName, - password: remoteInstancesHelper.remote_instance.azure.azure_mysql.password, - environment: 'Azure MySQL environment new', - cluster: 'Azure MySQL cluster new', - replicationSet: 'Azure MySQL replica new', - }, - mysqlInputs: { - userName: remoteInstancesHelper.remote_instance.aws.aws_rds_5_6.username, - password: remoteInstancesHelper.remote_instance.aws.aws_rds_5_6.password, - environment: 'RDS MySQL 5.6 new', - cluster: 'rds56-cluster new', - replicationSet: 'rds56-replication new', - }, - mysql57rdsInput: { - userName: remoteInstancesHelper.remote_instance.aws.aws_rds_5_7.username, - password: remoteInstancesHelper.remote_instance.aws.aws_rds_5_7.password, - environment: 'RDS MySQL 5.7 new', - cluster: 'rds57-cluster new', - replicationSet: 'rds57-replication new', - }, - mysql80rdsInput: { - userName: remoteInstancesHelper.remote_instance.aws.aws_rds_8_0.username, - password: remoteInstancesHelper.remote_instance.aws.aws_rds_8_0.password, - environment: 'RDS MySQL 8.0 new', - cluster: 'rds80-cluster new', - replicationSet: 'rds80-replication new', - }, - postgresqlInputs: { - userName: remoteInstancesHelper.remote_instance.aws.aws_postgresql_12.userName, - password: remoteInstancesHelper.remote_instance.aws.aws_postgresql_12.password, - environment: 'RDS Postgres new', - cluster: 'rdsPostgres-cluster new', - replicationSet: 'rdsPostgres-replication new', - }, url: 'graph/inventory?orgId=1', fields: { servicesLink: locate('[role="tablist"] a').withText('Services').withAttr({ 'aria-label': 'Tab Services' }), @@ -97,7 +25,7 @@ module.exports = { deleteButton: locate('span').withText('Delete'), environment: '$environment-text-input', externalExporter: locate('td').withText('External exporter'), - editAction: locate('span').withText('Edit'), + editButton: locate('span').withText('Edit'), editText: locate('h3').withText('Editing'), forceModeCheckbox: locate('$force-field-label'), inventoryTable: locate('table'), @@ -492,8 +420,8 @@ module.exports = { async editRemoteService(serviceName) { I.waitForElement(this.fields.kebabMenu(serviceName), 30); I.click(this.fields.kebabMenu(serviceName)); - I.waitForElement(this.fields.editAction, 30); - I.click(this.fields.editAction); + I.waitForElement(this.fields.editButton, 30); + I.click(this.fields.editButton); I.waitForElement(this.fields.editText, 30); I.seeElement(this.fields.editText); this.clearFields(); @@ -535,6 +463,12 @@ module.exports = { 'azure-PostgreSQL': function () { return (this.data.postgresqlAzureInputs); }, + 'pmm-qa-aurora2-mysql-instance-1': function () { + return (this.data.postgresqlAzureInputs); + }, + 'pmm-qa-aurora3-mysql-instance-1': function () { + return (this.data.postgresqlAzureInputs); + }, }; editActions.set(testData); this.fillFields(editActions[serviceName](testData)); diff --git a/tests/configuration/testData.js b/tests/configuration/testData.js index 828728d77..0fa05d5ee 100644 --- a/tests/configuration/testData.js +++ b/tests/configuration/testData.js @@ -78,4 +78,19 @@ module.exports = { cluster: 'rdsPostgres-cluster new', replicationSet: 'rdsPostgres-replication new', }, + aurora2Inputs: { + userName: remoteInstancesHelper.remote_instance.aws.aurora.aurora2.address, + password: remoteInstancesHelper.remote_instance.aws.aurora.aurora2.password, + environment: 'Aurora2 Postgres new', + cluster: 'Aurora2-cluster new', + replicationSet: 'Aurora2-replication new', + }, + + aurora3Inputs: { + userName: remoteInstancesHelper.remote_instance.aws.aurora.aurora3.address, + password: remoteInstancesHelper.remote_instance.aws.aurora.aurora3.password, + environment: 'Aurora2 Postgres new', + cluster: 'Aurora2-cluster new', + replicationSet: 'Aurora2-replication new', + }, }; From fbb5bda6d5ae4c138f3dd626728eeddbff9f9b29 Mon Sep 17 00:00:00 2001 From: Saikumar Date: Sun, 24 Sep 2023 13:07:22 +0530 Subject: [PATCH 09/23] Add HAproxy test --- tests/configuration/pages/pmmInventoryPage.js | 3 +++ tests/configuration/testData.js | 22 +++++-------------- .../configuration/verifyPMMInventory_test.js | 2 +- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/tests/configuration/pages/pmmInventoryPage.js b/tests/configuration/pages/pmmInventoryPage.js index 8b3be7dec..df9e35c23 100644 --- a/tests/configuration/pages/pmmInventoryPage.js +++ b/tests/configuration/pages/pmmInventoryPage.js @@ -469,6 +469,9 @@ module.exports = { 'pmm-qa-aurora3-mysql-instance-1': function () { return (this.data.postgresqlAzureInputs); }, + 'haproxy_remote': function () { + return (this.data.haproxy); + }, }; editActions.set(testData); this.fillFields(editActions[serviceName](testData)); diff --git a/tests/configuration/testData.js b/tests/configuration/testData.js index 0fa05d5ee..b23338d35 100644 --- a/tests/configuration/testData.js +++ b/tests/configuration/testData.js @@ -37,60 +37,48 @@ module.exports = { replicationSet: 'remote-external-replica-new', }, postgresqlAzureInputs: { - userName: remoteInstancesHelper.remote_instance.azure.azure_postgresql.userName, - password: remoteInstancesHelper.remote_instance.azure.azure_postgresql.password, environment: 'Azure PostgreSQL environment new', cluster: 'Azure PostgreSQL cluster new', replicationSet: 'Azure PostgreSQL replica new', }, mysqlAzureInputs: { - userName: remoteInstancesHelper.remote_instance.azure.azure_mysql.userName, - password: remoteInstancesHelper.remote_instance.azure.azure_mysql.password, environment: 'Azure MySQL environment new', cluster: 'Azure MySQL cluster new', replicationSet: 'Azure MySQL replica new', }, mysqlInputs: { - userName: remoteInstancesHelper.remote_instance.aws.aws_rds_5_6.username, - password: remoteInstancesHelper.remote_instance.aws.aws_rds_5_6.password, environment: 'RDS MySQL 5.6 new', cluster: 'rds56-cluster new', replicationSet: 'rds56-replication new', }, mysql57rdsInput: { - userName: remoteInstancesHelper.remote_instance.aws.aws_rds_5_7.username, - password: remoteInstancesHelper.remote_instance.aws.aws_rds_5_7.password, environment: 'RDS MySQL 5.7 new', cluster: 'rds57-cluster new', replicationSet: 'rds57-replication new', }, mysql80rdsInput: { - userName: remoteInstancesHelper.remote_instance.aws.aws_rds_8_0.username, - password: remoteInstancesHelper.remote_instance.aws.aws_rds_8_0.password, environment: 'RDS MySQL 8.0 new', cluster: 'rds80-cluster new', replicationSet: 'rds80-replication new', }, postgresqlInputs: { - userName: remoteInstancesHelper.remote_instance.aws.aws_postgresql_12.userName, - password: remoteInstancesHelper.remote_instance.aws.aws_postgresql_12.password, environment: 'RDS Postgres new', cluster: 'rdsPostgres-cluster new', replicationSet: 'rdsPostgres-replication new', }, aurora2Inputs: { - userName: remoteInstancesHelper.remote_instance.aws.aurora.aurora2.address, - password: remoteInstancesHelper.remote_instance.aws.aurora.aurora2.password, environment: 'Aurora2 Postgres new', cluster: 'Aurora2-cluster new', replicationSet: 'Aurora2-replication new', }, - aurora3Inputs: { - userName: remoteInstancesHelper.remote_instance.aws.aurora.aurora3.address, - password: remoteInstancesHelper.remote_instance.aws.aurora.aurora3.password, environment: 'Aurora2 Postgres new', cluster: 'Aurora2-cluster new', replicationSet: 'Aurora2-replication new', }, + haproxy: { + environment: 'Haproxy Postgres new', + cluster: 'Haproxy-cluster new', + replicationSet: 'Haproxy-replication new', + }, }; diff --git a/tests/configuration/verifyPMMInventory_test.js b/tests/configuration/verifyPMMInventory_test.js index e31c20289..33f15cd71 100644 --- a/tests/configuration/verifyPMMInventory_test.js +++ b/tests/configuration/verifyPMMInventory_test.js @@ -319,7 +319,7 @@ Scenario( ); Scenario( - '@PMM-T635 - Verify Adding HAProxy service via UI @instances @instances-fb', + '@PMM-T2340 - Verify Adding and Editing HAProxy service via UI @inventory @inventory-fb', async ({ I, remoteInstancesPage, pmmInventoryPage, }) => { From 5483592153fde98bd400c1e0db8b9dfa3d474455 Mon Sep 17 00:00:00 2001 From: Saikumar Date: Mon, 25 Sep 2023 20:25:22 +0530 Subject: [PATCH 10/23] Updates, moved testdata out completely --- tests/configuration/pages/pmmInventoryPage.js | 56 +-------------- .../configuration/verifyPMMInventory_test.js | 69 +++++++++++++++++-- 2 files changed, 65 insertions(+), 60 deletions(-) diff --git a/tests/configuration/pages/pmmInventoryPage.js b/tests/configuration/pages/pmmInventoryPage.js index df9e35c23..689af227d 100644 --- a/tests/configuration/pages/pmmInventoryPage.js +++ b/tests/configuration/pages/pmmInventoryPage.js @@ -1,5 +1,4 @@ const { I, inventoryAPI, remoteInstancesHelper, adminPage } = inject(); -const testData = require('../testData'); const assert = require('assert'); const paginationPart = require('./paginationFragment'); @@ -417,7 +416,7 @@ module.exports = { I.waitForElement(labels, 30); }, - async editRemoteService(serviceName) { + async verifyEditRemoteService(serviceName, serviceParameters) { I.waitForElement(this.fields.kebabMenu(serviceName), 30); I.click(this.fields.kebabMenu(serviceName)); I.waitForElement(this.fields.editButton, 30); @@ -425,58 +424,9 @@ module.exports = { I.waitForElement(this.fields.editText, 30); I.seeElement(this.fields.editText); this.clearFields(); - - const editActions = { - set: function (testData) { - this.data = testData; - }, - 'mysql_remote_new': function () { - return (this.data.mysqlSettings); - }, - 'mongodb_remote_new': function () { - return (this.data.mongodbSettings); - }, - 'postgresql_remote_new': function () { - return (this.data.potgresqlSettings); - }, - 'proxysql_remote_new': function () { - return (this.data.proxysqlSettings); - }, - 'external_service_new': function () { - return (this.data.externalSettings); - }, - 'rds-mysql56': function () { - return (this.data.mysqlInputs); - }, - 'pmm-qa-mysql-8-0-30': function () { - return (this.data.mysql80rdsInput); - }, - 'pmm-qa-rds-mysql-5-7-39': function () { - return (this.data.mysql57rdsInput); - }, - 'pmm-qa-pgsql-12': function () { - return (this.data.postgresqlInputs); - }, - 'azure-MySQL': function () { - return (this.data.mysqlAzureInputs); - }, - 'azure-PostgreSQL': function () { - return (this.data.postgresqlAzureInputs); - }, - 'pmm-qa-aurora2-mysql-instance-1': function () { - return (this.data.postgresqlAzureInputs); - }, - 'pmm-qa-aurora3-mysql-instance-1': function () { - return (this.data.postgresqlAzureInputs); - }, - 'haproxy_remote': function () { - return (this.data.haproxy); - }, - }; - editActions.set(testData); - this.fillFields(editActions[serviceName](testData)); + this.fillFields(serviceParameters); this.saveConfirm(); await I.click(this.fields.showServiceDetails(serviceName)); - this.verifyLabels(editActions[serviceName](testData)); + this.verifyLabels(serviceParameters); }, }; diff --git a/tests/configuration/verifyPMMInventory_test.js b/tests/configuration/verifyPMMInventory_test.js index 33f15cd71..96898fd69 100644 --- a/tests/configuration/verifyPMMInventory_test.js +++ b/tests/configuration/verifyPMMInventory_test.js @@ -1,4 +1,5 @@ const assert = require('assert'); +const testData = require('./testData'); const { I, remoteInstancesPage, pmmInventoryPage, remoteInstancesHelper } = inject(); @@ -59,6 +60,53 @@ aws_instances.add([ remoteInstancesHelper.remote_instance.aws.aurora.aurora3.cluster_name, ]); +const editActions = { + set: function (testData) { + this.data = testData; + }, + 'mysql_remote_new': function () { + return (this.data.mysqlSettings); + }, + 'mongodb_remote_new': function () { + return (this.data.mongodbSettings); + }, + 'postgresql_remote_new': function () { + return (this.data.potgresqlSettings); + }, + 'proxysql_remote_new': function () { + return (this.data.proxysqlSettings); + }, + 'external_service_new': function () { + return (this.data.externalSettings); + }, + 'rds-mysql56': function () { + return (this.data.mysqlInputs); + }, + 'pmm-qa-mysql-8-0-30': function () { + return (this.data.mysql80rdsInput); + }, + 'pmm-qa-rds-mysql-5-7-39': function () { + return (this.data.mysql57rdsInput); + }, + 'pmm-qa-pgsql-12': function () { + return (this.data.postgresqlInputs); + }, + 'azure-MySQL': function () { + return (this.data.mysqlAzureInputs); + }, + 'azure-PostgreSQL': function () { + return (this.data.postgresqlAzureInputs); + }, + 'pmm-qa-aurora2-mysql-instance-1': function () { + return (this.data.postgresqlAzureInputs); + }, + 'pmm-qa-aurora3-mysql-instance-1': function () { + return (this.data.postgresqlAzureInputs); + }, + 'haproxy_remote': function () { + return (this.data.haproxy); + }, +}; Feature('Inventory page'); @@ -282,7 +330,8 @@ Data(instances).Scenario( await remoteInstancesPage.fillRemoteFields(serviceName); remoteInstancesPage.createRemoteInstance(serviceName); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); - pmmInventoryPage.editRemoteService(serviceName); + editActions.set(testData); + pmmInventoryPage.verifyEditRemoteService(serviceName,editActions[serviceName](testData)); }, ); @@ -296,7 +345,8 @@ Scenario( I.waitForVisible(remoteInstancesPage.fields.addService, 30); I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(externalExporterServiceName); - pmmInventoryPage.editRemoteService(externalExporterServiceName); + editActions.set(testData); + pmmInventoryPage.verifyEditRemoteService(externalExporterServiceName,editActions[serviceName](testData)); }, ).retry(0); @@ -314,7 +364,8 @@ Scenario( remoteInstancesPage.fillRemoteRDSFields(serviceName); remoteInstancesPage.createRemoteInstance(serviceName); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); - pmmInventoryPage.editRemoteService(serviceName); + editActions.set(testData); + pmmInventoryPage.verifyEditRemoteService(serviceName,editActions[serviceName](testData)); }, ); @@ -341,7 +392,8 @@ Scenario( I.waitForVisible(remoteInstancesPage.fields.addService, 30); I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(haproxyServiceName); - pmmInventoryPage.editRemoteService(haproxyServiceName); + editActions.set(testData,editActions[serviceName](testData)); + pmmInventoryPage.verifyEditRemoteService(haproxyServiceName,editActions[serviceName](testData)); }, ); @@ -366,7 +418,8 @@ Scenario( remoteInstancesPage.fillRemoteRDSFields(serviceName); remoteInstancesPage.createRemoteInstance(serviceName); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); - pmmInventoryPage.editRemoteService(serviceName); + editActions.set(testData,editActions[serviceName](testData)); + pmmInventoryPage.verifyEditRemoteService(serviceName,editActions[serviceName](testData)); }, ); @@ -386,7 +439,8 @@ Data(azureServices).Scenario( remoteInstancesPage.fillRemoteRDSFields(serviceName); I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); - pmmInventoryPage.editRemoteService(serviceName); + editActions.set(testData,editActions[serviceName](testData)); + pmmInventoryPage.verifyEditRemoteService(serviceName,editActions[serviceName](testData)); }, ); @@ -417,7 +471,8 @@ Data(aws_instances).Scenario('PMM-T2340 Verify adding and editing Aurora remote I.amOnPage(pmmInventoryPage.url); pmmInventoryPage.verifyRemoteServiceIsDisplayed(details.service_name); - pmmInventoryPage.editRemoteService(details.service_name); + editActions.set(testData,editActions[serviceName](testData)); + pmmInventoryPage.verifyEditRemoteService(details.service_name,editActions[serviceName](testData)); }); Data(qanFilters).Scenario( From d7ef680c86db5d2dbdfd2a57eb62fae5ab7e3efb Mon Sep 17 00:00:00 2001 From: Saikumar Date: Mon, 25 Sep 2023 21:12:38 +0530 Subject: [PATCH 11/23] Fixed ServiceName, in last commit. --- tests/configuration/verifyPMMInventory_test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/configuration/verifyPMMInventory_test.js b/tests/configuration/verifyPMMInventory_test.js index 96898fd69..04061f758 100644 --- a/tests/configuration/verifyPMMInventory_test.js +++ b/tests/configuration/verifyPMMInventory_test.js @@ -392,7 +392,7 @@ Scenario( I.waitForVisible(remoteInstancesPage.fields.addService, 30); I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(haproxyServiceName); - editActions.set(testData,editActions[serviceName](testData)); + editActions.set(testData,editActions[haproxyServiceName](testData)); pmmInventoryPage.verifyEditRemoteService(haproxyServiceName,editActions[serviceName](testData)); }, ); @@ -471,7 +471,7 @@ Data(aws_instances).Scenario('PMM-T2340 Verify adding and editing Aurora remote I.amOnPage(pmmInventoryPage.url); pmmInventoryPage.verifyRemoteServiceIsDisplayed(details.service_name); - editActions.set(testData,editActions[serviceName](testData)); + editActions.set(testData,editActions[details.service_name](testData)); pmmInventoryPage.verifyEditRemoteService(details.service_name,editActions[serviceName](testData)); }); From 4500cc6f79aabd9a371182203d5bf7a7a761a595 Mon Sep 17 00:00:00 2001 From: Saikumar Date: Mon, 25 Sep 2023 21:26:30 +0530 Subject: [PATCH 12/23] service names updated --- tests/configuration/verifyPMMInventory_test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/configuration/verifyPMMInventory_test.js b/tests/configuration/verifyPMMInventory_test.js index 04061f758..b2e953aaf 100644 --- a/tests/configuration/verifyPMMInventory_test.js +++ b/tests/configuration/verifyPMMInventory_test.js @@ -346,7 +346,7 @@ Scenario( I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(externalExporterServiceName); editActions.set(testData); - pmmInventoryPage.verifyEditRemoteService(externalExporterServiceName,editActions[serviceName](testData)); + pmmInventoryPage.verifyEditRemoteService(externalExporterServiceName,editActions[externalExporterServiceName](testData)); }, ).retry(0); @@ -393,7 +393,7 @@ Scenario( I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(haproxyServiceName); editActions.set(testData,editActions[haproxyServiceName](testData)); - pmmInventoryPage.verifyEditRemoteService(haproxyServiceName,editActions[serviceName](testData)); + pmmInventoryPage.verifyEditRemoteService(haproxyServiceName,editActions[haproxyServiceName](testData)); }, ); @@ -472,7 +472,7 @@ Data(aws_instances).Scenario('PMM-T2340 Verify adding and editing Aurora remote I.amOnPage(pmmInventoryPage.url); pmmInventoryPage.verifyRemoteServiceIsDisplayed(details.service_name); editActions.set(testData,editActions[details.service_name](testData)); - pmmInventoryPage.verifyEditRemoteService(details.service_name,editActions[serviceName](testData)); + pmmInventoryPage.verifyEditRemoteService(details.service_name,editActions[details.service_name](testData)); }); Data(qanFilters).Scenario( From 09c87607d8b32e736742e575b155be43d4790f50 Mon Sep 17 00:00:00 2001 From: yurkovychv Date: Tue, 3 Oct 2023 18:37:48 +0300 Subject: [PATCH 13/23] PMM-T2340 code review session --- tests/configuration/pages/pmmInventoryPage.js | 65 ++++++------ .../configuration/verifyPMMInventory_test.js | 100 ++++++++++-------- tests/pages/remoteInstancesPage.js | 21 ++-- .../remoteInstances/remoteInstancesHelper.js | 14 +-- 4 files changed, 108 insertions(+), 92 deletions(-) diff --git a/tests/configuration/pages/pmmInventoryPage.js b/tests/configuration/pages/pmmInventoryPage.js index 689af227d..169eb93ab 100644 --- a/tests/configuration/pages/pmmInventoryPage.js +++ b/tests/configuration/pages/pmmInventoryPage.js @@ -1,8 +1,11 @@ -const { I, inventoryAPI, remoteInstancesHelper, adminPage } = inject(); +const { + I, inventoryAPI, remoteInstancesHelper, adminPage, +} = inject(); const assert = require('assert'); const paginationPart = require('./paginationFragment'); const servicesTab = require('./servicesTab'); + const service = (serviceName) => `//span[contains(text(),'${serviceName}')]`; module.exports = { @@ -17,11 +20,13 @@ module.exports = { agentStatus: locate('$details-row-content').find('a'), backToServices: '//span[text()="Go back to services"]', agentsLinkNew: '//div[contains(@data-testid,"status-badge")]', - agentDetailsLabelByText: (label) => locate('[aria-label="Tags"]').find('li').withText(label), + detailsLabelByText: (label) => locate('[aria-label="Tags"]').find('li').withText(label), + // agentDetailsLabelByText: (label) => locate('[aria-label="Tags"]').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', deleteButton: locate('span').withText('Delete'), + deleteButton: locate(I.useDataQA('dsd')).withText('Delete'), environment: '$environment-text-input', externalExporter: locate('td').withText('External exporter'), editButton: locate('span').withText('Edit'), @@ -385,48 +390,40 @@ module.exports = { I.click(this.fields.backToServices); }, - async clearFields() { - adminPage.customClearField(this.fields.environment); - //I.clearField(this.fields.environment); - adminPage.customClearField(this.fields.cluster); - //I.clearField(this.fields.cluster); - adminPage.customClearField(this.fields.replicationSet); - //I.clearField(this.fields.replicationSet); - }, - - async fillFields(serviceParameters) { - I.fillField(this.fields.environment, serviceParameters.environment); - I.fillField(this.fields.cluster, serviceParameters.cluster); - I.fillField(this.fields.replicationSet, serviceParameters.replicationSet); - }, - - async saveConfirm() { + async saveAndConfirm() { I.click(this.fields.saveButton); I.seeElement(this.fields.savePopupMessage); I.click(this.fields.saveConfirmButton); }, - async verifyLabels(serviceParameters) { - let labels; - labels = `//span[contains(text(),"${serviceParameters.environment}")]`; - I.waitForElement(labels, 30); - labels = `//span[contains(text(),"${serviceParameters.cluster}")]`; - I.waitForElement(labels, 30); - labels = `//span[contains(text(),"${serviceParameters.replicationSet}")]`; - I.waitForElement(labels, 30); - }, - - async verifyEditRemoteService(serviceName, serviceParameters) { + openEditServiceWizard(serviceName) { I.waitForElement(this.fields.kebabMenu(serviceName), 30); I.click(this.fields.kebabMenu(serviceName)); I.waitForElement(this.fields.editButton, 30); I.click(this.fields.editButton); I.waitForElement(this.fields.editText, 30); I.seeElement(this.fields.editText); - this.clearFields(); - this.fillFields(serviceParameters); - this.saveConfirm(); - await I.click(this.fields.showServiceDetails(serviceName)); - this.verifyLabels(serviceParameters); + }, + + updateServiceLabels(serviceParameters) { + I.usePlaywrightTo('clear fields', async ({ page }) => { + await page.fill(I.useDataQA('environment-text-input'), serviceParameters.environment); + await page.fill(I.useDataQA('replication_set-text-input'), serviceParameters.replicationSet); + await page.fill(I.useDataQA('cluster-text-input'), serviceParameters.cluster); + }); + + this.saveAndConfirm(); + }, + + verifyEditRemoteService() { + + }, + + verifyServiceLabels(serviceParameters) { + // Verify new values for labels in details + I.waitForVisible(this.fields.detailsLabelByText(`environment=${serviceParameters.environment}`), 20); + I.seeElement(this.fields.detailsLabelByText(`environment=${serviceParameters.environment}`)); + I.seeElement(this.fields.detailsLabelByText(`cluster=${serviceParameters.cluster}`)); + I.seeElement(this.fields.detailsLabelByText(`replication_set=${serviceParameters.replicationSet}`)); }, }; diff --git a/tests/configuration/verifyPMMInventory_test.js b/tests/configuration/verifyPMMInventory_test.js index b2e953aaf..0893c3471 100644 --- a/tests/configuration/verifyPMMInventory_test.js +++ b/tests/configuration/verifyPMMInventory_test.js @@ -1,7 +1,9 @@ const assert = require('assert'); const testData = require('./testData'); -const { I, remoteInstancesPage, pmmInventoryPage, remoteInstancesHelper } = inject(); +const { + I, remoteInstancesPage, pmmInventoryPage, remoteInstancesHelper, +} = inject(); const externalExporterServiceName = 'external_service_new'; const haproxyServiceName = 'haproxy_remote'; @@ -27,7 +29,7 @@ for (const [key, value] of Object.entries(remoteInstancesHelper.services)) { break; case 'proxysql': break; - default: + default: } instances.add([key]); } @@ -61,22 +63,22 @@ aws_instances.add([ ]); const editActions = { - set: function (testData) { + set(testData) { this.data = testData; }, - 'mysql_remote_new': function () { + mysql_remote_new() { return (this.data.mysqlSettings); }, - 'mongodb_remote_new': function () { + mongodb_remote_new() { return (this.data.mongodbSettings); }, - 'postgresql_remote_new': function () { + postgresql_remote_new() { return (this.data.potgresqlSettings); }, - 'proxysql_remote_new': function () { + proxysql_remote_new() { return (this.data.proxysqlSettings); }, - 'external_service_new': function () { + external_service_new() { return (this.data.externalSettings); }, 'rds-mysql56': function () { @@ -103,9 +105,9 @@ const editActions = { 'pmm-qa-aurora3-mysql-instance-1': function () { return (this.data.postgresqlAzureInputs); }, - 'haproxy_remote': function () { - return (this.data.haproxy); - }, + haproxy_remote() { + return (this.data.haproxy); + }, }; Feature('Inventory page'); @@ -317,7 +319,7 @@ Scenario( }, ); -Data(instances).Scenario( +Data(instances).only.Scenario( 'PMM-T2340 - Verify Remote Instances can be created and edited [critical] @inventory @inventory-fb', async ({ I, pmmInventoryPage, current, @@ -327,11 +329,21 @@ Data(instances).Scenario( I.amOnPage(remoteInstancesPage.url); remoteInstancesPage.waitUntilRemoteInstancesPageLoaded(); remoteInstancesPage.openAddRemotePage(current.name); - await remoteInstancesPage.fillRemoteFields(serviceName); + const inputs = await remoteInstancesPage.fillRemoteFields(serviceName); + remoteInstancesPage.createRemoteInstance(serviceName); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); - editActions.set(testData); - pmmInventoryPage.verifyEditRemoteService(serviceName,editActions[serviceName](testData)); + + const newLabels = { + environment: `${inputs.environment} edited` || `${serviceName} environment edited`, + cluster: `${inputs.cluster} edited` || `${serviceName} cluster edited`, + replicationSet: `${inputs.replicationSet} edited` || `${serviceName} replicationSet edited`, + }; + + pmmInventoryPage.openEditServiceWizard(serviceName); + pmmInventoryPage.updateServiceLabels(newLabels); + I.click(pmmInventoryPage.fields.showServiceDetails(serviceName)); + pmmInventoryPage.verifyServiceLabels(newLabels); }, ); @@ -346,7 +358,7 @@ Scenario( I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(externalExporterServiceName); editActions.set(testData); - pmmInventoryPage.verifyEditRemoteService(externalExporterServiceName,editActions[externalExporterServiceName](testData)); + pmmInventoryPage.verifyEditRemoteService(externalExporterServiceName, editActions[externalExporterServiceName](testData)); }, ).retry(0); @@ -365,7 +377,7 @@ Scenario( remoteInstancesPage.createRemoteInstance(serviceName); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); editActions.set(testData); - pmmInventoryPage.verifyEditRemoteService(serviceName,editActions[serviceName](testData)); + pmmInventoryPage.verifyEditRemoteService(serviceName, editActions[serviceName](testData)); }, ); @@ -392,11 +404,10 @@ Scenario( I.waitForVisible(remoteInstancesPage.fields.addService, 30); I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(haproxyServiceName); - editActions.set(testData,editActions[haproxyServiceName](testData)); - pmmInventoryPage.verifyEditRemoteService(haproxyServiceName,editActions[haproxyServiceName](testData)); + editActions.set(testData, editActions[haproxyServiceName](testData)); + pmmInventoryPage.verifyEditRemoteService(haproxyServiceName, editActions[haproxyServiceName](testData)); }, ); - Scenario( 'PMM-T2340 - Verify adding and editing PostgreSQL RDS monitoring to PMM via UI @inventory @inventory-fb', @@ -418,8 +429,8 @@ Scenario( remoteInstancesPage.fillRemoteRDSFields(serviceName); remoteInstancesPage.createRemoteInstance(serviceName); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); - editActions.set(testData,editActions[serviceName](testData)); - pmmInventoryPage.verifyEditRemoteService(serviceName,editActions[serviceName](testData)); + editActions.set(testData, editActions[serviceName](testData)); + pmmInventoryPage.verifyEditRemoteService(serviceName, editActions[serviceName](testData)); }, ); @@ -439,8 +450,8 @@ Data(azureServices).Scenario( remoteInstancesPage.fillRemoteRDSFields(serviceName); I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); - editActions.set(testData,editActions[serviceName](testData)); - pmmInventoryPage.verifyEditRemoteService(serviceName,editActions[serviceName](testData)); + editActions.set(testData, editActions[serviceName](testData)); + pmmInventoryPage.verifyEditRemoteService(serviceName, editActions[serviceName](testData)); }, ); @@ -471,8 +482,8 @@ Data(aws_instances).Scenario('PMM-T2340 Verify adding and editing Aurora remote I.amOnPage(pmmInventoryPage.url); pmmInventoryPage.verifyRemoteServiceIsDisplayed(details.service_name); - editActions.set(testData,editActions[details.service_name](testData)); - pmmInventoryPage.verifyEditRemoteService(details.service_name,editActions[details.service_name](testData)); + editActions.set(testData, editActions[details.service_name](testData)); + pmmInventoryPage.verifyEditRemoteService(details.service_name, editActions[details.service_name](testData)); }); Data(qanFilters).Scenario( @@ -490,23 +501,22 @@ Data(qanFilters).Scenario( }, ).retry(2); - Data(aws_instances).Scenario( - 'PMM-T2340 Verify QAN after Aurora instance is added and eidted @inventory @inventory-fb', - async ({ - I, qanOverview, qanFilters, qanPage, current, adminPage, - }) => { - const { instance_id } = current; - - I.amOnPage(qanPage.url); - qanOverview.waitForOverviewLoaded(); - await adminPage.applyTimeRange('Last 12 hours'); - qanOverview.waitForOverviewLoaded(); - qanFilters.waitForFiltersToLoad(); - await qanFilters.applySpecificFilter(instance_id); - qanOverview.waitForOverviewLoaded(); - const count = await qanOverview.getCountOfItems(); - - assert.ok(count > 0, `The queries for service ${instance_id} instance do NOT exist, check QAN Data`); - }, - ).retry(1); + 'PMM-T2340 Verify QAN after Aurora instance is added and eidted @inventory @inventory-fb', + async ({ + I, qanOverview, qanFilters, qanPage, current, adminPage, + }) => { + const { instance_id } = current; + + I.amOnPage(qanPage.url); + qanOverview.waitForOverviewLoaded(); + await adminPage.applyTimeRange('Last 12 hours'); + qanOverview.waitForOverviewLoaded(); + qanFilters.waitForFiltersToLoad(); + await qanFilters.applySpecificFilter(instance_id); + qanOverview.waitForOverviewLoaded(); + const count = await qanOverview.getCountOfItems(); + + assert.ok(count > 0, `The queries for service ${instance_id} instance do NOT exist, check QAN Data`); + }, +).retry(1); diff --git a/tests/pages/remoteInstancesPage.js b/tests/pages/remoteInstancesPage.js index 346a7fcf9..e0da49f3e 100644 --- a/tests/pages/remoteInstancesPage.js +++ b/tests/pages/remoteInstancesPage.js @@ -284,17 +284,24 @@ module.exports = { }, async fillRemoteFields(serviceName) { + let inputs; + // eslint-disable-next-line default-case switch (serviceName) { case remoteInstancesHelper.services.mysql: - I.fillField(this.fields.hostName, remoteInstancesHelper.remote_instance.mysql.ps_5_7.host); - I.fillField(this.fields.userName, remoteInstancesHelper.remote_instance.mysql.ps_5_7.username); - I.fillField(this.fields.password, remoteInstancesHelper.remote_instance.mysql.ps_5_7.password); + inputs = { + ...remoteInstancesHelper.remote_instance.mysql.ps_5_7, + ...this.mysqlSettings, + }; + + I.fillField(this.fields.hostName, inputs.host); + I.fillField(this.fields.userName, inputs.username); + I.fillField(this.fields.password, inputs.password); adminPage.customClearField(this.fields.portNumber); - I.fillField(this.fields.portNumber, remoteInstancesHelper.remote_instance.mysql.ps_5_7.port); + I.fillField(this.fields.portNumber, inputs.port); I.fillField(this.fields.serviceName, serviceName); - I.fillField(this.fields.environment, this.mysqlSettings.environment); - I.fillField(this.fields.cluster, this.mysqlSettings.cluster); + I.fillField(this.fields.environment, inputs.environment); + I.fillField(this.fields.cluster, inputs.cluster); break; case remoteInstancesHelper.services.mysql_ssl: I.fillField(this.fields.hostName, remoteInstancesHelper.remote_instance.mysql.ms_8_0_ssl.host); @@ -484,6 +491,8 @@ module.exports = { I.fillField(this.fields.cluster, this.postgresGCSettings.cluster); } adminPage.performPageDown(1); + + return inputs; }, createRemoteInstance(serviceName) { diff --git a/tests/remoteInstances/remoteInstancesHelper.js b/tests/remoteInstances/remoteInstancesHelper.js index b2298b2ee..598238257 100644 --- a/tests/remoteInstances/remoteInstancesHelper.js +++ b/tests/remoteInstances/remoteInstancesHelper.js @@ -449,13 +449,13 @@ module.exports = { // General Remote Instances Service List, this is what UI-tests job uses to run remote instances tests. services: { mysql: (remoteInstanceStatus.mysql.ps_5_7.enabled ? 'mysql_remote_new' : undefined), - mongodb: (remoteInstanceStatus.mongodb.psmdb_4_2.enabled ? 'mongodb_remote_new' : undefined), - postgresql: (remoteInstanceStatus.postgresql.pdpgsql_13_3.enabled ? 'postgresql_remote_new' : undefined), - proxysql: (remoteInstanceStatus.proxysql.proxysql_2_1_1.enabled ? 'proxysql_remote_new' : undefined), - postgresGC: (remoteInstanceStatus.gc.gc_postgresql.enabled ? 'postgresql_GC_remote_new' : undefined), - mysql_ssl: (remoteInstanceStatus.mysql.ms_8_0_ssl.enabled ? 'mysql_ssl_new' : undefined), - mongodb_ssl: (remoteInstanceStatus.mongodb.mongodb_4_4_ssl.enabled ? 'mongodb_ssl_new' : undefined), - postgres_ssl: (remoteInstanceStatus.postgresql.postgres_13_3_ssl.enabled ? 'postgres_ssl_new' : undefined), + // mongodb: (remoteInstanceStatus.mongodb.psmdb_4_2.enabled ? 'mongodb_remote_new' : undefined), + // postgresql: (remoteInstanceStatus.postgresql.pdpgsql_13_3.enabled ? 'postgresql_remote_new' : undefined), + // proxysql: (remoteInstanceStatus.proxysql.proxysql_2_1_1.enabled ? 'proxysql_remote_new' : undefined), + // postgresGC: (remoteInstanceStatus.gc.gc_postgresql.enabled ? 'postgresql_GC_remote_new' : undefined), + // mysql_ssl: (remoteInstanceStatus.mysql.ms_8_0_ssl.enabled ? 'mysql_ssl_new' : undefined), + // mongodb_ssl: (remoteInstanceStatus.mongodb.mongodb_4_4_ssl.enabled ? 'mongodb_ssl_new' : undefined), + // postgres_ssl: (remoteInstanceStatus.postgresql.postgres_13_3_ssl.enabled ? 'postgres_ssl_new' : undefined), }, // Only add a service here when you want to include it as part of Upgrade tests cycle for AMI and Docker From 22ee2f5efbf3aa90f6d8191966ffd5b41de4ad13 Mon Sep 17 00:00:00 2001 From: Saikumar Date: Fri, 6 Oct 2023 13:59:58 +0530 Subject: [PATCH 14/23] Addressed review comments -- removed Datafile, instead using Codeceptjs way of handling it -- merging changes from reviwer --- tests/configuration/testData.js | 84 ---------- .../configuration/verifyPMMInventory_test.js | 127 +++++++------- tests/pages/remoteInstancesPage.js | 158 ++++++++++-------- .../remoteInstances/remoteInstancesHelper.js | 14 +- 4 files changed, 159 insertions(+), 224 deletions(-) delete mode 100644 tests/configuration/testData.js diff --git a/tests/configuration/testData.js b/tests/configuration/testData.js deleted file mode 100644 index b23338d35..000000000 --- a/tests/configuration/testData.js +++ /dev/null @@ -1,84 +0,0 @@ -const {remoteInstancesHelper} = inject(); - -const filterOperators = { - equal: '= (EQUAL)', - regex: '=~ (REGEX)', -}; - -module.exports = { - postgresGCSettings: { - environment: 'Remote PostgreSQL_GC env new', - cluster: 'Remote PostgreSQL_GC cluster new', - replicationSet: 'Remote PostgreSQL_GC replica-new', - }, - mysqlSettings: { - environment: 'remote-mysql-new', - cluster: 'remote-mysql-cluster-new', - replicationSet: 'remote-mysql-replica-new', - }, - potgresqlSettings: { - environment: 'remote-postgres-new', - cluster: 'remote-postgres-cluster-new', - replicationSet: 'remote-postgres-replica-new', - }, - mongodbSettings: { - environment: 'remote-mongodb-new', - cluster: 'remote-mongodb-cluster-new', - replicationSet: 'remote-mongodb-replica-new', - }, - proxysqlSettings: { - environment: 'remote-proxysql-new', - cluster: 'remote-proxysql-cluster-new', - replicationSet: 'remote-proxysql-replica-new', - }, - externalSettings: { - environment: 'remote-external-service-new', - cluster: 'remote-external-cluster-new', - replicationSet: 'remote-external-replica-new', - }, - postgresqlAzureInputs: { - environment: 'Azure PostgreSQL environment new', - cluster: 'Azure PostgreSQL cluster new', - replicationSet: 'Azure PostgreSQL replica new', - }, - mysqlAzureInputs: { - environment: 'Azure MySQL environment new', - cluster: 'Azure MySQL cluster new', - replicationSet: 'Azure MySQL replica new', - }, - mysqlInputs: { - environment: 'RDS MySQL 5.6 new', - cluster: 'rds56-cluster new', - replicationSet: 'rds56-replication new', - }, - mysql57rdsInput: { - environment: 'RDS MySQL 5.7 new', - cluster: 'rds57-cluster new', - replicationSet: 'rds57-replication new', - }, - mysql80rdsInput: { - environment: 'RDS MySQL 8.0 new', - cluster: 'rds80-cluster new', - replicationSet: 'rds80-replication new', - }, - postgresqlInputs: { - environment: 'RDS Postgres new', - cluster: 'rdsPostgres-cluster new', - replicationSet: 'rdsPostgres-replication new', - }, - aurora2Inputs: { - environment: 'Aurora2 Postgres new', - cluster: 'Aurora2-cluster new', - replicationSet: 'Aurora2-replication new', - }, - aurora3Inputs: { - environment: 'Aurora2 Postgres new', - cluster: 'Aurora2-cluster new', - replicationSet: 'Aurora2-replication new', - }, - haproxy: { - environment: 'Haproxy Postgres new', - cluster: 'Haproxy-cluster new', - replicationSet: 'Haproxy-replication new', - }, -}; diff --git a/tests/configuration/verifyPMMInventory_test.js b/tests/configuration/verifyPMMInventory_test.js index 0893c3471..666d80a49 100644 --- a/tests/configuration/verifyPMMInventory_test.js +++ b/tests/configuration/verifyPMMInventory_test.js @@ -1,5 +1,5 @@ const assert = require('assert'); -const testData = require('./testData'); +const {de} = require("@faker-js/faker/lib/locales"); const { I, remoteInstancesPage, pmmInventoryPage, remoteInstancesHelper, @@ -62,54 +62,6 @@ aws_instances.add([ remoteInstancesHelper.remote_instance.aws.aurora.aurora3.cluster_name, ]); -const editActions = { - set(testData) { - this.data = testData; - }, - mysql_remote_new() { - return (this.data.mysqlSettings); - }, - mongodb_remote_new() { - return (this.data.mongodbSettings); - }, - postgresql_remote_new() { - return (this.data.potgresqlSettings); - }, - proxysql_remote_new() { - return (this.data.proxysqlSettings); - }, - external_service_new() { - return (this.data.externalSettings); - }, - 'rds-mysql56': function () { - return (this.data.mysqlInputs); - }, - 'pmm-qa-mysql-8-0-30': function () { - return (this.data.mysql80rdsInput); - }, - 'pmm-qa-rds-mysql-5-7-39': function () { - return (this.data.mysql57rdsInput); - }, - 'pmm-qa-pgsql-12': function () { - return (this.data.postgresqlInputs); - }, - 'azure-MySQL': function () { - return (this.data.mysqlAzureInputs); - }, - 'azure-PostgreSQL': function () { - return (this.data.postgresqlAzureInputs); - }, - 'pmm-qa-aurora2-mysql-instance-1': function () { - return (this.data.postgresqlAzureInputs); - }, - 'pmm-qa-aurora3-mysql-instance-1': function () { - return (this.data.postgresqlAzureInputs); - }, - haproxy_remote() { - return (this.data.haproxy); - }, -}; - Feature('Inventory page'); Before(async ({ I }) => { @@ -319,7 +271,7 @@ Scenario( }, ); -Data(instances).only.Scenario( +Data(instances).Scenario( 'PMM-T2340 - Verify Remote Instances can be created and edited [critical] @inventory @inventory-fb', async ({ I, pmmInventoryPage, current, @@ -357,8 +309,16 @@ Scenario( I.waitForVisible(remoteInstancesPage.fields.addService, 30); I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(externalExporterServiceName); - editActions.set(testData); - pmmInventoryPage.verifyEditRemoteService(externalExporterServiceName, editActions[externalExporterServiceName](testData)); + const newLabels = { + environment: `${inputs.environment} edited` || `${serviceName} environment edited`, + cluster: `${inputs.cluster} edited` || `${serviceName} cluster edited`, + replicationSet: `${inputs.replicationSet} edited` || `${serviceName} replicationSet edited`, + }; + + pmmInventoryPage.openEditServiceWizard(serviceName); + pmmInventoryPage.updateServiceLabels(newLabels); + I.click(pmmInventoryPage.fields.showServiceDetails(serviceName)); + pmmInventoryPage.verifyServiceLabels(newLabels); }, ).retry(0); @@ -376,8 +336,16 @@ Scenario( remoteInstancesPage.fillRemoteRDSFields(serviceName); remoteInstancesPage.createRemoteInstance(serviceName); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); - editActions.set(testData); - pmmInventoryPage.verifyEditRemoteService(serviceName, editActions[serviceName](testData)); + const newLabels = { + environment: `${inputs.environment} edited` || `${serviceName} environment edited`, + cluster: `${inputs.cluster} edited` || `${serviceName} cluster edited`, + replicationSet: `${inputs.replicationSet} edited` || `${serviceName} replicationSet edited`, + }; + + pmmInventoryPage.openEditServiceWizard(serviceName); + pmmInventoryPage.updateServiceLabels(newLabels); + I.click(pmmInventoryPage.fields.showServiceDetails(serviceName)); + pmmInventoryPage.verifyServiceLabels(newLabels); }, ); @@ -404,8 +372,16 @@ Scenario( I.waitForVisible(remoteInstancesPage.fields.addService, 30); I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(haproxyServiceName); - editActions.set(testData, editActions[haproxyServiceName](testData)); - pmmInventoryPage.verifyEditRemoteService(haproxyServiceName, editActions[haproxyServiceName](testData)); + const newLabels = { + environment: `${inputs.environment} edited` || `${serviceName} environment edited`, + cluster: `${inputs.cluster} edited` || `${serviceName} cluster edited`, + replicationSet: `${inputs.replicationSet} edited` || `${serviceName} replicationSet edited`, + }; + + pmmInventoryPage.openEditServiceWizard(serviceName); + pmmInventoryPage.updateServiceLabels(newLabels); + I.click(pmmInventoryPage.fields.showServiceDetails(serviceName)); + pmmInventoryPage.verifyServiceLabels(newLabels); }, ); @@ -429,15 +405,22 @@ Scenario( remoteInstancesPage.fillRemoteRDSFields(serviceName); remoteInstancesPage.createRemoteInstance(serviceName); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); - editActions.set(testData, editActions[serviceName](testData)); - pmmInventoryPage.verifyEditRemoteService(serviceName, editActions[serviceName](testData)); + const newLabels = { + environment: `${inputs.environment} edited` || `${serviceName} environment edited`, + cluster: `${inputs.cluster} edited` || `${serviceName} cluster edited`, + replicationSet: `${inputs.replicationSet} edited` || `${serviceName} replicationSet edited`, + }; + pmmInventoryPage.openEditServiceWizard(serviceName); + pmmInventoryPage.updateServiceLabels(newLabels); + I.click(pmmInventoryPage.fields.showServiceDetails(serviceName)); + pmmInventoryPage.verifyServiceLabels(newLabels); }, ); Data(azureServices).Scenario( 'PMM-T2340 - Verify adding and editing monitoring for Azure @inventory @inventory-fb', async ({ - I, remoteInstancesPage, pmmInventoryPage, settingsAPI, current, inventoryAPI, + I, remoteInstancesPage, pmmInventoryPage, settingsAPI, current, }) => { const serviceName = current.name; @@ -450,13 +433,21 @@ Data(azureServices).Scenario( remoteInstancesPage.fillRemoteRDSFields(serviceName); I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); - editActions.set(testData, editActions[serviceName](testData)); - pmmInventoryPage.verifyEditRemoteService(serviceName, editActions[serviceName](testData)); + const newLabels = { + environment: `${inputs.environment} edited` || `${serviceName} environment edited`, + cluster: `${inputs.cluster} edited` || `${serviceName} cluster edited`, + replicationSet: `${inputs.replicationSet} edited` || `${serviceName} replicationSet edited`, + }; + + pmmInventoryPage.openEditServiceWizard(serviceName); + pmmInventoryPage.updateServiceLabels(newLabels); + I.click(pmmInventoryPage.fields.showServiceDetails(serviceName)); + pmmInventoryPage.verifyServiceLabels(newLabels); }, ); Data(aws_instances).Scenario('PMM-T2340 Verify adding and editing Aurora remote instance @inventory @inventory-fb', async ({ - I, addInstanceAPI, inventoryAPI, current, + I, addInstanceAPI, current, }) => { const { service_name, password, instance_id, cluster_name, @@ -482,8 +473,16 @@ Data(aws_instances).Scenario('PMM-T2340 Verify adding and editing Aurora remote I.amOnPage(pmmInventoryPage.url); pmmInventoryPage.verifyRemoteServiceIsDisplayed(details.service_name); - editActions.set(testData, editActions[details.service_name](testData)); - pmmInventoryPage.verifyEditRemoteService(details.service_name, editActions[details.service_name](testData)); + const newLabels = { + environment: `${details.environment} edited` || `${details.service_name} environment edited`, + cluster: `${details.cluster} edited` || `${details.service_name} cluster edited`, + replicationSet: `${details.replicationSet} edited` || `${details.service_name} replicationSet edited`, + }; + + pmmInventoryPage.openEditServiceWizard(serviceName); + pmmInventoryPage.updateServiceLabels(newLabels); + I.click(pmmInventoryPage.fields.showServiceDetails(serviceName)); + pmmInventoryPage.verifyServiceLabels(newLabels); }); Data(qanFilters).Scenario( diff --git a/tests/pages/remoteInstancesPage.js b/tests/pages/remoteInstancesPage.js index e0da49f3e..7cf4048aa 100644 --- a/tests/pages/remoteInstancesPage.js +++ b/tests/pages/remoteInstancesPage.js @@ -293,7 +293,6 @@ module.exports = { ...remoteInstancesHelper.remote_instance.mysql.ps_5_7, ...this.mysqlSettings, }; - I.fillField(this.fields.hostName, inputs.host); I.fillField(this.fields.userName, inputs.username); I.fillField(this.fields.password, inputs.password); @@ -304,19 +303,20 @@ module.exports = { I.fillField(this.fields.cluster, inputs.cluster); break; case remoteInstancesHelper.services.mysql_ssl: - I.fillField(this.fields.hostName, remoteInstancesHelper.remote_instance.mysql.ms_8_0_ssl.host); - I.fillField(this.fields.userName, remoteInstancesHelper.remote_instance.mysql.ms_8_0_ssl.username); - I.fillField(this.fields.password, remoteInstancesHelper.remote_instance.mysql.ms_8_0_ssl.password); + inputs = remoteInstancesHelper.remote_instance.mysql.ms_8_0_ssl; + I.fillField(this.fields.hostName, inputs.host); + I.fillField(this.fields.userName, inputs.username); + I.fillField(this.fields.password, inputs.password); adminPage.customClearField(this.fields.portNumber); - I.fillField(this.fields.portNumber, remoteInstancesHelper.remote_instance.mysql.ms_8_0_ssl.port); + I.fillField(this.fields.portNumber, inputs.port); I.fillField(this.fields.serviceName, serviceName); I.fillField( this.fields.environment, - remoteInstancesHelper.remote_instance.mysql.ms_8_0_ssl.environment, + inputs.environment, ); I.fillField( this.fields.cluster, - remoteInstancesHelper.remote_instance.mysql.ms_8_0_ssl.clusterName, + inputs.clusterName, ); I.dontSeeElement(this.fields.tlscaInput); I.dontSeeElement(this.fields.tlsCertificateInput); @@ -325,40 +325,45 @@ module.exports = { I.waitForElement(this.fields.tlscaInput, 30); await this.fillFileContent( this.fields.tlscaInput, - remoteInstancesHelper.remote_instance.mysql.ms_8_0_ssl.tlsCAFile, + inputs.tlsCAFile, ); await this.fillFileContent( this.fields.tlsCertificateInput, - remoteInstancesHelper.remote_instance.mysql.ms_8_0_ssl.tlsCertificateFile, + inputs.tlsCertificateFile, ); await this.fillFileContent( this.fields.tlsCertificateKeyInput, - remoteInstancesHelper.remote_instance.mysql.ms_8_0_ssl.tlsCertificateKeyFile, + inputs.tlsCertificateKeyFile, ); break; case remoteInstancesHelper.services.mongodb: - I.fillField(this.fields.hostName, remoteInstancesHelper.remote_instance.mongodb.psmdb_4_2.host); - I.fillField(this.fields.userName, remoteInstancesHelper.remote_instance.mongodb.psmdb_4_2.username); - I.fillField(this.fields.password, remoteInstancesHelper.remote_instance.mongodb.psmdb_4_2.password); + inputs = { + ...remoteInstancesHelper.remote_instance.mongodb.psmdb_4_2, + ...this.mongodbSettings, + }; + I.fillField(this.fields.hostName, inputs.host); + I.fillField(this.fields.userName, inputs.username); + I.fillField(this.fields.password, inputs.password); I.fillField(this.fields.serviceName, serviceName); - I.fillField(this.fields.environment, 'remote-mongodb'); - I.fillField(this.fields.cluster, 'remote-mongodb-cluster'); + I.fillField(this.fields.environment, inputs.environment); + I.fillField(this.fields.cluster, inputs.cluster); break; case remoteInstancesHelper.services.mongodb_ssl: - I.fillField(this.fields.hostName, remoteInstancesHelper.remote_instance.mongodb.mongodb_4_4_ssl.host); + inputs = remoteInstancesHelper.remote_instance.mongodb.mongodb_4_4_ssl; + I.fillField(this.fields.hostName, inputs.host); adminPage.customClearField(this.fields.portNumber); I.fillField( this.fields.portNumber, - remoteInstancesHelper.remote_instance.mongodb.mongodb_4_4_ssl.port, + inputs.port, ); I.fillField(this.fields.serviceName, serviceName); I.fillField( this.fields.environment, - remoteInstancesHelper.remote_instance.mongodb.mongodb_4_4_ssl.environment, + inputs.environment, ); I.fillField( this.fields.cluster, - remoteInstancesHelper.remote_instance.mongodb.mongodb_4_4_ssl.clusterName, + inputs.clusterName, ); I.dontSeeElement(this.fields.tlscaInput); I.dontSeeElement(this.fields.tlsCertificateFilePasswordInput); @@ -367,29 +372,33 @@ module.exports = { I.waitForElement(this.fields.tlscaInput, 30); await this.fillFileContent( this.fields.tlscaInput, - remoteInstancesHelper.remote_instance.mongodb.mongodb_4_4_ssl.tlsCAFile, + inputs.tlsCAFile, ); await this.fillFileContent( this.fields.tlsCertificateFilePasswordInput, - remoteInstancesHelper.remote_instance.mongodb.mongodb_4_4_ssl.tlsCertificateKeyFilePassword, + inputs.tlsCertificateKeyFilePassword, ); await this.fillFileContent( this.fields.tlsCertificateKey, - remoteInstancesHelper.remote_instance.mongodb.mongodb_4_4_ssl.tlsCertificateKeyFile, + inputs.tlsCertificateKeyFile, ); break; case remoteInstancesHelper.services.postgresql: + inputs = { + ...remoteInstancesHelper.remote_instance.postgresql.pdpgsql_13_3, + ...this.potgresqlSettings, + }; I.fillField( this.fields.hostName, - remoteInstancesHelper.remote_instance.postgresql.pdpgsql_13_3.host, + inputs.host, ); I.fillField( this.fields.userName, - remoteInstancesHelper.remote_instance.postgresql.pdpgsql_13_3.username, + inputs.username, ); I.fillField( this.fields.password, - remoteInstancesHelper.remote_instance.postgresql.pdpgsql_13_3.password, + inputs.password, ); adminPage.customClearField(this.fields.portNumber); I.fillField( @@ -397,27 +406,31 @@ module.exports = { remoteInstancesHelper.remote_instance.postgresql.pdpgsql_13_3.port, ); I.fillField(this.fields.serviceName, serviceName); - I.fillField(this.fields.environment, this.potgresqlSettings.environment); - I.fillField(this.fields.cluster, this.potgresqlSettings.cluster); + I.fillField(this.fields.environment, inputs.environment); + I.fillField(this.fields.cluster, inputs.cluster); break; case remoteInstancesHelper.services.postgres_ssl: + inputs = { + ...remoteInstancesHelper.remote_instance.postgresql.postgres_13_3_ssl, + ...this.potgresqlSettings, + }; I.fillField( this.fields.hostName, - remoteInstancesHelper.remote_instance.postgresql.postgres_13_3_ssl.host, + inputs.host, ); adminPage.customClearField(this.fields.portNumber); I.fillField( this.fields.portNumber, - remoteInstancesHelper.remote_instance.postgresql.postgres_13_3_ssl.port, + inputs.port, ); I.fillField(this.fields.serviceName, serviceName); I.fillField( this.fields.environment, - remoteInstancesHelper.remote_instance.postgresql.postgres_13_3_ssl.environment, + inputs.environment, ); I.fillField( this.fields.cluster, - remoteInstancesHelper.remote_instance.postgresql.postgres_13_3_ssl.clusterName, + inputs.clusterName, ); I.dontSeeElement(this.fields.tlscaInput); I.dontSeeElement(this.fields.tlsCertificateKeyInput); @@ -426,72 +439,72 @@ module.exports = { I.waitForElement(this.fields.tlscaInput, 30); await this.fillFileContent( this.fields.tlscaInput, - remoteInstancesHelper.remote_instance.postgresql.postgres_13_3_ssl.tlsCAFile, + inputs.tlsCAFile, ); await this.fillFileContent( this.fields.tlsCertificateInput, - remoteInstancesHelper.remote_instance.postgresql.postgres_13_3_ssl.tlsCertFile, + inputs.tlsCertFile, ); await this.fillFileContent( this.fields.tlsCertificateKeyInput, - remoteInstancesHelper.remote_instance.postgresql.postgres_13_3_ssl.tlsKeyFile, + inputs.tlsKeyFile, ); break; case remoteInstancesHelper.services.proxysql: - I.fillField(this.fields.hostName, remoteInstancesHelper.remote_instance.proxysql.proxysql_2_1_1.host); + inputs = { + ...remoteInstancesHelper.remote_instance.postgresql.proxysql_2_1_1, + ...this.potgresqlSettings, + }; + I.fillField(this.fields.hostName, inputs.host); I.fillField( this.fields.userName, - remoteInstancesHelper.remote_instance.proxysql.proxysql_2_1_1.username, + inputs.username, ); I.fillField( this.fields.password, - remoteInstancesHelper.remote_instance.proxysql.proxysql_2_1_1.password, + inputs.password, ); I.fillField(this.fields.serviceName, serviceName); - I.fillField(this.fields.environment, 'remote-proxysql'); - I.fillField(this.fields.cluster, 'remote-proxysql-cluster'); + I.fillField(this.fields.environment, inputs.environment); + I.fillField(this.fields.cluster, inputs.clusterName); break; case 'external_service_new': + inputs = remoteInstancesHelper.remote_instance.external.redis; I.fillField(this.fields.serviceName, serviceName); - I.fillField(this.fields.hostName, remoteInstancesHelper.remote_instance.external.redis.host); + I.fillField(this.fields.hostName, inputs.host); I.fillField(this.fields.metricsPath, '/metrics'); adminPage.customClearField(this.fields.portNumber); - I.fillField(this.fields.portNumber, remoteInstancesHelper.remote_instance.external.redis.port); + I.fillField(this.fields.portNumber, inputs.port); I.fillField(this.fields.environment, 'remote-external-service'); I.fillField(this.fields.cluster, 'remote-external-cluster'); break; case 'postgreDoNotTrack': case 'postgresPGStatStatements': case 'postgresPgStatMonitor': - I.fillField( - this.fields.hostName, - remoteInstancesHelper.remote_instance.postgresql.pdpgsql_13_3.host, - ); - I.fillField( - this.fields.userName, - remoteInstancesHelper.remote_instance.postgresql.pdpgsql_13_3.username, - ); - I.fillField( - this.fields.password, - remoteInstancesHelper.remote_instance.postgresql.pdpgsql_13_3.password, - ); + inputs = { + ...remoteInstancesHelper.remote_instance.postgresql.pdpgsql_13_3, + ...this.potgresqlSettings, + }; + I.fillField(this.fields.hostName,inputs.host,); + I.fillField(this.fields.userName, inputs.username,); + I.fillField(this.fields.password, inputs.password,); adminPage.customClearField(this.fields.portNumber); - I.fillField( - this.fields.portNumber, - remoteInstancesHelper.remote_instance.postgresql.pdpgsql_13_3.port, - ); + I.fillField(this.fields.portNumber, inputs.port,); I.fillField(this.fields.serviceName, serviceName); break; case remoteInstancesHelper.services.postgresGC: - I.fillField(this.fields.hostName, remoteInstancesHelper.remote_instance.gc.gc_postgresql.address); - I.fillField(this.fields.userName, remoteInstancesHelper.remote_instance.gc.gc_postgresql.userName); - I.fillField(this.fields.password, remoteInstancesHelper.remote_instance.gc.gc_postgresql.password); + inputs = { + ...remoteInstancesHelper.remote_instance.gc.gc_postgresql, + ...this.postgresGCSettings, + }; + I.fillField(this.fields.hostName, inputs.address); + I.fillField(this.fields.userName, inputs.userName); + I.fillField(this.fields.password, inputs.password); I.fillField(this.fields.serviceName, serviceName); - I.fillField(this.fields.environment, this.postgresGCSettings.environment); - I.fillField(this.fields.cluster, this.postgresGCSettings.cluster); + I.fillField(this.fields.environment, inputs.environment); + I.fillField(this.fields.cluster, inputs.cluster); } adminPage.performPageDown(1); - return inputs; }, @@ -588,29 +601,36 @@ module.exports = { }, fillRemoteRDSFields(serviceName) { + let inputs; // eslint-disable-next-line default-case switch (serviceName) { case 'rds-mysql56': - this.fillFields(this.mysqlInputs); + inputs = this.mysqlInputs; + this.fillFields(inputs); break; case 'pmm-qa-mysql-8-0-30': - this.fillFields(this.mysql80rdsInput); + inputs = this.mysql80rdsInput; + this.fillFields(inputs); break; case 'pmm-qa-rds-mysql-5-7-39': - this.fillFields(this.mysql57rdsInput); + inputs = this.mysql57rdsInput; + this.fillFields(inputs); break; case 'pmm-qa-pgsql-12': - this.fillFields(this.postgresqlInputs); + inputs = this.postgresqlInputs; + this.fillFields(inputs); break; case 'azure-MySQL': + inputs = this.mysqlAzureInputs; adminPage.customClearField(this.fields.serviceName); I.fillField(this.fields.serviceName, serviceName); - this.fillFields(this.mysqlAzureInputs); + this.fillFields(inputs); break; case 'azure-PostgreSQL': + inputs = this.postgresqlAzureInputs; adminPage.customClearField(this.fields.serviceName); I.fillField(this.fields.serviceName, serviceName); - this.fillFields(this.postgresqlAzureInputs); + this.fillFields(inputs); } I.scrollPageToBottom(); }, diff --git a/tests/remoteInstances/remoteInstancesHelper.js b/tests/remoteInstances/remoteInstancesHelper.js index 598238257..b2298b2ee 100644 --- a/tests/remoteInstances/remoteInstancesHelper.js +++ b/tests/remoteInstances/remoteInstancesHelper.js @@ -449,13 +449,13 @@ module.exports = { // General Remote Instances Service List, this is what UI-tests job uses to run remote instances tests. services: { mysql: (remoteInstanceStatus.mysql.ps_5_7.enabled ? 'mysql_remote_new' : undefined), - // mongodb: (remoteInstanceStatus.mongodb.psmdb_4_2.enabled ? 'mongodb_remote_new' : undefined), - // postgresql: (remoteInstanceStatus.postgresql.pdpgsql_13_3.enabled ? 'postgresql_remote_new' : undefined), - // proxysql: (remoteInstanceStatus.proxysql.proxysql_2_1_1.enabled ? 'proxysql_remote_new' : undefined), - // postgresGC: (remoteInstanceStatus.gc.gc_postgresql.enabled ? 'postgresql_GC_remote_new' : undefined), - // mysql_ssl: (remoteInstanceStatus.mysql.ms_8_0_ssl.enabled ? 'mysql_ssl_new' : undefined), - // mongodb_ssl: (remoteInstanceStatus.mongodb.mongodb_4_4_ssl.enabled ? 'mongodb_ssl_new' : undefined), - // postgres_ssl: (remoteInstanceStatus.postgresql.postgres_13_3_ssl.enabled ? 'postgres_ssl_new' : undefined), + mongodb: (remoteInstanceStatus.mongodb.psmdb_4_2.enabled ? 'mongodb_remote_new' : undefined), + postgresql: (remoteInstanceStatus.postgresql.pdpgsql_13_3.enabled ? 'postgresql_remote_new' : undefined), + proxysql: (remoteInstanceStatus.proxysql.proxysql_2_1_1.enabled ? 'proxysql_remote_new' : undefined), + postgresGC: (remoteInstanceStatus.gc.gc_postgresql.enabled ? 'postgresql_GC_remote_new' : undefined), + mysql_ssl: (remoteInstanceStatus.mysql.ms_8_0_ssl.enabled ? 'mysql_ssl_new' : undefined), + mongodb_ssl: (remoteInstanceStatus.mongodb.mongodb_4_4_ssl.enabled ? 'mongodb_ssl_new' : undefined), + postgres_ssl: (remoteInstanceStatus.postgresql.postgres_13_3_ssl.enabled ? 'postgres_ssl_new' : undefined), }, // Only add a service here when you want to include it as part of Upgrade tests cycle for AMI and Docker From 5f8d50aaa868a7f4baf7fc7b9ab9743571d73162 Mon Sep 17 00:00:00 2001 From: Saikumar Date: Fri, 6 Oct 2023 14:30:08 +0530 Subject: [PATCH 15/23] Fixed Lint issues and some commented code. --- tests/configuration/pages/pmmInventoryPage.js | 2 +- .../configuration/verifyPMMInventory_test.js | 22 +++++++++---------- tests/pages/remoteInstancesPage.js | 3 ++- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/tests/configuration/pages/pmmInventoryPage.js b/tests/configuration/pages/pmmInventoryPage.js index 169eb93ab..dbebeec9f 100644 --- a/tests/configuration/pages/pmmInventoryPage.js +++ b/tests/configuration/pages/pmmInventoryPage.js @@ -21,7 +21,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').withText(label), - // agentDetailsLabelByText: (label) => locate('[aria-label="Tags"]').find('li').withText(label), + agentDetailsLabelByText: (label) => locate('[aria-label="Tags"]').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/verifyPMMInventory_test.js b/tests/configuration/verifyPMMInventory_test.js index 666d80a49..42cdbe339 100644 --- a/tests/configuration/verifyPMMInventory_test.js +++ b/tests/configuration/verifyPMMInventory_test.js @@ -305,7 +305,7 @@ Scenario( I.amOnPage(remoteInstancesPage.url); remoteInstancesPage.waitUntilRemoteInstancesPageLoaded(); remoteInstancesPage.openAddRemotePage('external'); - await remoteInstancesPage.fillRemoteFields(externalExporterServiceName); + const inputs =await remoteInstancesPage.fillRemoteFields(externalExporterServiceName); I.waitForVisible(remoteInstancesPage.fields.addService, 30); I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(externalExporterServiceName); @@ -333,7 +333,7 @@ Scenario( remoteInstancesPage.verifyInstanceIsDiscovered(serviceName); remoteInstancesPage.startMonitoringOfInstance(serviceName); remoteInstancesPage.verifyAddInstancePageOpened(); - remoteInstancesPage.fillRemoteRDSFields(serviceName); + const inputs = await remoteInstancesPage.fillRemoteRDSFields(serviceName); remoteInstancesPage.createRemoteInstance(serviceName); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); const newLabels = { @@ -373,14 +373,14 @@ Scenario( I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(haproxyServiceName); const newLabels = { - environment: `${inputs.environment} edited` || `${serviceName} environment edited`, - cluster: `${inputs.cluster} edited` || `${serviceName} cluster edited`, - replicationSet: `${inputs.replicationSet} edited` || `${serviceName} replicationSet edited`, + environment: `${remoteInstancesHelper.remote_instance.haproxy.environment} edited` || `${haproxyServiceName} environment edited`, + cluster: `${remoteInstancesHelper.remote_instance.haproxy.clusterName} edited` || `${haproxyServiceName} cluster edited`, + replicationSet: `${remoteInstancesHelper.remote_instance.haproxy.replicationSet} edited` || `${haproxyServiceName} replicationSet edited`, }; - pmmInventoryPage.openEditServiceWizard(serviceName); + pmmInventoryPage.openEditServiceWizard(haproxyServiceName); pmmInventoryPage.updateServiceLabels(newLabels); - I.click(pmmInventoryPage.fields.showServiceDetails(serviceName)); + I.click(pmmInventoryPage.fields.showServiceDetails(haproxyServiceName)); pmmInventoryPage.verifyServiceLabels(newLabels); }, ); @@ -402,7 +402,7 @@ Scenario( assert.ok(grabbedHostname.startsWith(serviceName), `Hostname is incorrect: ${grabbedHostname}`); I.seeInField(remoteInstancesPage.fields.serviceName, serviceName); - remoteInstancesPage.fillRemoteRDSFields(serviceName); + const inputs = await remoteInstancesPage.fillRemoteRDSFields(serviceName); remoteInstancesPage.createRemoteInstance(serviceName); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); const newLabels = { @@ -430,7 +430,7 @@ Data(azureServices).Scenario( remoteInstancesPage.discoverAzure(); remoteInstancesPage.startMonitoringOfInstance(current.instanceToMonitor); remoteInstancesPage.verifyAddInstancePageOpened(); - remoteInstancesPage.fillRemoteRDSFields(serviceName); + const inputs = await remoteInstancesPage.fillRemoteRDSFields(serviceName); I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); const newLabels = { @@ -479,9 +479,9 @@ Data(aws_instances).Scenario('PMM-T2340 Verify adding and editing Aurora remote replicationSet: `${details.replicationSet} edited` || `${details.service_name} replicationSet edited`, }; - pmmInventoryPage.openEditServiceWizard(serviceName); + pmmInventoryPage.openEditServiceWizard(details.service_name); pmmInventoryPage.updateServiceLabels(newLabels); - I.click(pmmInventoryPage.fields.showServiceDetails(serviceName)); + I.click(pmmInventoryPage.fields.showServiceDetails(details.service_name)); pmmInventoryPage.verifyServiceLabels(newLabels); }); diff --git a/tests/pages/remoteInstancesPage.js b/tests/pages/remoteInstancesPage.js index 7cf4048aa..e2eb2ca5f 100644 --- a/tests/pages/remoteInstancesPage.js +++ b/tests/pages/remoteInstancesPage.js @@ -600,7 +600,7 @@ module.exports = { I.fillField(this.fields.replicationSet, serviceParameters.replicationSet); }, - fillRemoteRDSFields(serviceName) { + async fillRemoteRDSFields(serviceName) { let inputs; // eslint-disable-next-line default-case switch (serviceName) { @@ -633,6 +633,7 @@ module.exports = { this.fillFields(inputs); } I.scrollPageToBottom(); + return inputs; }, parseURL(url) { From b3b7632b196d977a88b39893d0f393e20428c9b8 Mon Sep 17 00:00:00 2001 From: Saikumar Date: Fri, 6 Oct 2023 14:37:36 +0530 Subject: [PATCH 16/23] Updates --- tests/configuration/verifyPMMInventory_test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/configuration/verifyPMMInventory_test.js b/tests/configuration/verifyPMMInventory_test.js index 42cdbe339..04992d4b8 100644 --- a/tests/configuration/verifyPMMInventory_test.js +++ b/tests/configuration/verifyPMMInventory_test.js @@ -310,14 +310,14 @@ Scenario( I.click(remoteInstancesPage.fields.addService); pmmInventoryPage.verifyRemoteServiceIsDisplayed(externalExporterServiceName); const newLabels = { - environment: `${inputs.environment} edited` || `${serviceName} environment edited`, - cluster: `${inputs.cluster} edited` || `${serviceName} cluster edited`, - replicationSet: `${inputs.replicationSet} edited` || `${serviceName} replicationSet edited`, + environment: `${inputs.environment} edited` || `${externalExporterServiceName} environment edited`, + cluster: `${inputs.cluster} edited` || `${externalExporterServiceName} cluster edited`, + replicationSet: `${inputs.replicationSet} edited` || `${externalExporterServiceName} replicationSet edited`, }; - pmmInventoryPage.openEditServiceWizard(serviceName); + pmmInventoryPage.openEditServiceWizard(externalExporterServiceName); pmmInventoryPage.updateServiceLabels(newLabels); - I.click(pmmInventoryPage.fields.showServiceDetails(serviceName)); + I.click(pmmInventoryPage.fields.showServiceDetails(externalExporterServiceName)); pmmInventoryPage.verifyServiceLabels(newLabels); }, ).retry(0); From 00d43145dec4d485729685d4e8a216317e3a9069 Mon Sep 17 00:00:00 2001 From: Saikumar Date: Fri, 6 Oct 2023 15:34:01 +0530 Subject: [PATCH 17/23] fix proxysql inputs on test failure --- tests/pages/remoteInstancesPage.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/pages/remoteInstancesPage.js b/tests/pages/remoteInstancesPage.js index e2eb2ca5f..7c1b1aa6b 100644 --- a/tests/pages/remoteInstancesPage.js +++ b/tests/pages/remoteInstancesPage.js @@ -451,10 +451,7 @@ module.exports = { ); break; case remoteInstancesHelper.services.proxysql: - inputs = { - ...remoteInstancesHelper.remote_instance.postgresql.proxysql_2_1_1, - ...this.potgresqlSettings, - }; + inputs = remoteInstancesHelper.remote_instance.postgresql.proxysql_2_1_1 I.fillField(this.fields.hostName, inputs.host); I.fillField( this.fields.userName, From 304aa88b52c9cc18a1d669277c863715547215eb Mon Sep 17 00:00:00 2001 From: Saikumar Date: Fri, 6 Oct 2023 19:09:07 +0530 Subject: [PATCH 18/23] fix proxysql inputs on test failure --- tests/pages/remoteInstancesPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pages/remoteInstancesPage.js b/tests/pages/remoteInstancesPage.js index 7c1b1aa6b..6db00f391 100644 --- a/tests/pages/remoteInstancesPage.js +++ b/tests/pages/remoteInstancesPage.js @@ -452,7 +452,7 @@ module.exports = { break; case remoteInstancesHelper.services.proxysql: inputs = remoteInstancesHelper.remote_instance.postgresql.proxysql_2_1_1 - I.fillField(this.fields.hostName, inputs.host); + I.fillField(this.fields.hostName, inputs.hostName); I.fillField( this.fields.userName, inputs.username, From d0b60d00082379467f3d4a98ae0789d15b578a3c Mon Sep 17 00:00:00 2001 From: Saikumar Date: Fri, 6 Oct 2023 19:50:56 +0530 Subject: [PATCH 19/23] fix proxysql inputs on test failure --- tests/pages/remoteInstancesPage.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/pages/remoteInstancesPage.js b/tests/pages/remoteInstancesPage.js index 6db00f391..a2d66b6fa 100644 --- a/tests/pages/remoteInstancesPage.js +++ b/tests/pages/remoteInstancesPage.js @@ -450,9 +450,9 @@ module.exports = { inputs.tlsKeyFile, ); break; - case remoteInstancesHelper.services.proxysql: - inputs = remoteInstancesHelper.remote_instance.postgresql.proxysql_2_1_1 - I.fillField(this.fields.hostName, inputs.hostName); + case remoteInstancesHelper.services.: + inputs = remoteInstancesHelper.remote_instance.proxysql.proxysql_2_1_1 + I.fillField(this.fields.hostName, inputs.host); I.fillField( this.fields.userName, inputs.username, From 6ad3a4c9569be818a43ece74684dc95f1c629fdf Mon Sep 17 00:00:00 2001 From: Saikumar Date: Mon, 9 Oct 2023 11:39:23 +0530 Subject: [PATCH 20/23] fix service name --- tests/pages/remoteInstancesPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pages/remoteInstancesPage.js b/tests/pages/remoteInstancesPage.js index a2d66b6fa..ce249e885 100644 --- a/tests/pages/remoteInstancesPage.js +++ b/tests/pages/remoteInstancesPage.js @@ -450,7 +450,7 @@ module.exports = { inputs.tlsKeyFile, ); break; - case remoteInstancesHelper.services.: + case remoteInstancesHelper.services.proxysql: inputs = remoteInstancesHelper.remote_instance.proxysql.proxysql_2_1_1 I.fillField(this.fields.hostName, inputs.host); I.fillField( From d923cac715583be58b35ec96b9f119c6a1e4e6f1 Mon Sep 17 00:00:00 2001 From: Saikumar Date: Mon, 9 Oct 2023 15:19:05 +0530 Subject: [PATCH 21/23] Remove not required changes --- pr.codecept.js | 2 +- tests/configuration/pages/pmmInventoryPage.js | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/pr.codecept.js b/pr.codecept.js index 0479100fb..c3711e7dc 100644 --- a/pr.codecept.js +++ b/pr.codecept.js @@ -12,7 +12,7 @@ exports.config = { Playwright: { url: process.env.PMM_UI_URL || pmmUrl, restart: true, - show: false, + show: true, browser: 'chromium', windowSize: '1920x1080', timeout: 20000, diff --git a/tests/configuration/pages/pmmInventoryPage.js b/tests/configuration/pages/pmmInventoryPage.js index dbebeec9f..6cf9ae4cb 100644 --- a/tests/configuration/pages/pmmInventoryPage.js +++ b/tests/configuration/pages/pmmInventoryPage.js @@ -26,7 +26,6 @@ module.exports = { agentsLinkOld: locate('a').withText('Agents'), cluster: '$cluster-text-input', deleteButton: locate('span').withText('Delete'), - deleteButton: locate(I.useDataQA('dsd')).withText('Delete'), environment: '$environment-text-input', externalExporter: locate('td').withText('External exporter'), editButton: locate('span').withText('Edit'), @@ -415,10 +414,6 @@ module.exports = { this.saveAndConfirm(); }, - verifyEditRemoteService() { - - }, - verifyServiceLabels(serviceParameters) { // Verify new values for labels in details I.waitForVisible(this.fields.detailsLabelByText(`environment=${serviceParameters.environment}`), 20); From d49c36514328a2f8ceed22e4652cc24f2ba82ca1 Mon Sep 17 00:00:00 2001 From: Saikumar Date: Mon, 9 Oct 2023 15:21:32 +0530 Subject: [PATCH 22/23] Remove not required changes --- pr.codecept.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr.codecept.js b/pr.codecept.js index c3711e7dc..0479100fb 100644 --- a/pr.codecept.js +++ b/pr.codecept.js @@ -12,7 +12,7 @@ exports.config = { Playwright: { url: process.env.PMM_UI_URL || pmmUrl, restart: true, - show: true, + show: false, browser: 'chromium', windowSize: '1920x1080', timeout: 20000, From b732dd308f3b05fb512fe965405aa455cb5a91a0 Mon Sep 17 00:00:00 2001 From: Saikumar Date: Mon, 9 Oct 2023 20:25:57 +0530 Subject: [PATCH 23/23] Fix environment variable declaration --- tests/remoteInstances/remoteInstancesHelper.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/remoteInstances/remoteInstancesHelper.js b/tests/remoteInstances/remoteInstancesHelper.js index b2298b2ee..98ce1a9d8 100644 --- a/tests/remoteInstances/remoteInstancesHelper.js +++ b/tests/remoteInstances/remoteInstancesHelper.js @@ -187,6 +187,7 @@ module.exports = { port: DB_CONFIG.PROXYSQL_SERVER_PORT, username: 'proxyadmin', password: 'yxZq!4SGv0A1', + environment: 'proxy_env', clusterName: 'proxy_clstr', }, },