Skip to content

Commit

Permalink
Updates, moved testdata out completely
Browse files Browse the repository at this point in the history
  • Loading branch information
saikumar-vs committed Sep 25, 2023
1 parent fbb5bda commit 5483592
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 60 deletions.
56 changes: 3 additions & 53 deletions tests/configuration/pages/pmmInventoryPage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { I, inventoryAPI, remoteInstancesHelper, adminPage } = inject();
const testData = require('../testData');

const assert = require('assert');
const paginationPart = require('./paginationFragment');
Expand Down Expand Up @@ -417,66 +416,17 @@ 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);
I.click(this.fields.editButton);
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);
},
};
69 changes: 62 additions & 7 deletions tests/configuration/verifyPMMInventory_test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const assert = require('assert');
const testData = require('./testData');

const { I, remoteInstancesPage, pmmInventoryPage, remoteInstancesHelper } = inject();

Expand Down Expand Up @@ -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);
},

Check warning on line 84 in tests/configuration/verifyPMMInventory_test.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected unnamed method 'rds-mysql56'
'pmm-qa-mysql-8-0-30': function () {
return (this.data.mysql80rdsInput);
},

Check warning on line 87 in tests/configuration/verifyPMMInventory_test.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected unnamed method 'pmm-qa-mysql-8-0-30'
'pmm-qa-rds-mysql-5-7-39': function () {
return (this.data.mysql57rdsInput);
},

Check warning on line 90 in tests/configuration/verifyPMMInventory_test.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected unnamed method 'pmm-qa-rds-mysql-5-7-39'
'pmm-qa-pgsql-12': function () {
return (this.data.postgresqlInputs);
},

Check warning on line 93 in tests/configuration/verifyPMMInventory_test.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected unnamed method 'pmm-qa-pgsql-12'
'azure-MySQL': function () {
return (this.data.mysqlAzureInputs);
},

Check warning on line 96 in tests/configuration/verifyPMMInventory_test.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected unnamed method 'azure-MySQL'
'azure-PostgreSQL': function () {
return (this.data.postgresqlAzureInputs);
},

Check warning on line 99 in tests/configuration/verifyPMMInventory_test.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected unnamed method 'azure-PostgreSQL'
'pmm-qa-aurora2-mysql-instance-1': function () {
return (this.data.postgresqlAzureInputs);
},

Check warning on line 102 in tests/configuration/verifyPMMInventory_test.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected unnamed method 'pmm-qa-aurora2-mysql-instance-1'
'pmm-qa-aurora3-mysql-instance-1': function () {
return (this.data.postgresqlAzureInputs);
},

Check warning on line 105 in tests/configuration/verifyPMMInventory_test.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected unnamed method 'pmm-qa-aurora3-mysql-instance-1'
'haproxy_remote': function () {
return (this.data.haproxy);
},
};

Feature('Inventory page');

Expand Down Expand Up @@ -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));
},
);

Expand All @@ -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);

Check failure on line 351 in tests/configuration/verifyPMMInventory_test.js

View workflow job for this annotation

GitHub Actions / lint

'serviceName' is not defined

Expand All @@ -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));
},
);

Expand All @@ -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));
},

Check failure on line 397 in tests/configuration/verifyPMMInventory_test.js

View workflow job for this annotation

GitHub Actions / lint

'serviceName' is not defined
);

Check failure on line 398 in tests/configuration/verifyPMMInventory_test.js

View workflow job for this annotation

GitHub Actions / lint

'serviceName' is not defined

Expand All @@ -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));
},
);

Expand All @@ -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));
},
);

Expand Down Expand Up @@ -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));

Check failure on line 475 in tests/configuration/verifyPMMInventory_test.js

View workflow job for this annotation

GitHub Actions / lint

'serviceName' is not defined
});

Check failure on line 476 in tests/configuration/verifyPMMInventory_test.js

View workflow job for this annotation

GitHub Actions / lint

'serviceName' is not defined

Data(qanFilters).Scenario(
Expand Down

0 comments on commit 5483592

Please sign in to comment.