Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for editing services for mysql, pgsql, proxysql and mongo, rds, azzure #680

Merged
merged 26 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
151af4e
Initial tests for mysql, pgsql, proxysql and mongo
saikumar-vs Sep 4, 2023
a1ed048
Added Mising Class Name
saikumar-vs Sep 4, 2023
a9df7c4
Fixed a typo
saikumar-vs Sep 4, 2023
c31a678
Merge branch 'main' into PMM-T2340
saikumar-vs Sep 11, 2023
5c61865
Add tests for RDS, AWS and QAN checks
saikumar-vs Sep 11, 2023
adeebcd
Updates
saikumar-vs Sep 11, 2023
8e24127
Improvements
saikumar-vs Sep 11, 2023
d7840bb
Merge branch 'main' into PMM-T2340
Sep 19, 2023
9eeddde
Addressed review comments
saikumar-vs Sep 23, 2023
1cb62fd
Updates, renames
saikumar-vs Sep 23, 2023
fbb5bda
Add HAproxy test
saikumar-vs Sep 24, 2023
5483592
Updates, moved testdata out completely
saikumar-vs Sep 25, 2023
d7ef680
Fixed ServiceName, in last commit.
saikumar-vs Sep 25, 2023
4500cc6
service names updated
saikumar-vs Sep 25, 2023
b006047
Merge branch 'main' into PMM-T2340
Oct 3, 2023
09c8760
PMM-T2340 code review session
yurkovychv Oct 3, 2023
22ee2f5
Addressed review comments
saikumar-vs Oct 6, 2023
5f8d50a
Fixed Lint issues and some commented code.
saikumar-vs Oct 6, 2023
b3b7632
Updates
saikumar-vs Oct 6, 2023
00d4314
fix proxysql inputs on test failure
saikumar-vs Oct 6, 2023
304aa88
fix proxysql inputs on test failure
saikumar-vs Oct 6, 2023
d0b60d0
fix proxysql inputs on test failure
saikumar-vs Oct 6, 2023
6ad3a4c
fix service name
saikumar-vs Oct 9, 2023
d923cac
Remove not required changes
saikumar-vs Oct 9, 2023
d49c365
Remove not required changes
saikumar-vs Oct 9, 2023
b732dd3
Fix environment variable declaration
saikumar-vs Oct 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 56 additions & 3 deletions tests/configuration/pages/pmmInventoryPage.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,42 @@
const { I, inventoryAPI } = 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 = {
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'),
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),
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'),

Check failure on line 29 in tests/configuration/pages/pmmInventoryPage.js

View workflow job for this annotation

GitHub Actions / lint

Duplicate key 'deleteButton'
saikumar-vs marked this conversation as resolved.
Show resolved Hide resolved
environment: '$environment-text-input',
externalExporter: locate('td').withText('External exporter'),
editButton: 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)}//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()
Expand All @@ -50,7 +62,11 @@
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"]',
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,
Expand Down Expand Up @@ -373,4 +389,41 @@
await I.waitForVisible(agent, 30);
I.click(this.fields.backToServices);
},

async saveAndConfirm() {
I.click(this.fields.saveButton);
I.seeElement(this.fields.savePopupMessage);
I.click(this.fields.saveConfirmButton);
},

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

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() {
saikumar-vs marked this conversation as resolved.
Show resolved Hide resolved

},

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}`));
},
};
Loading
Loading