Skip to content

Commit

Permalink
PostgreSQL Services Overview Dashboard Test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartikeya99 committed Aug 12, 2019
1 parent 78a3875 commit 660601f
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 1 deletion.
3 changes: 2 additions & 1 deletion codecept.json
Expand Up @@ -47,7 +47,8 @@
"prometheusExporterOverviewPage": "./tests/pages/prometheusExporterOverviewPage.js",
"pxcGaleraClusterOverviewPage": "./tests/pages/pxcGaleraClusterOverviewPage.js",
"qanPage" : "./tests/pages/qanPage.js",
"mongoDbClusterSummaryPage": "./tests/pages/mongoDbClusterSummaryPage.js"
"mongoDbClusterSummaryPage": "./tests/pages/mongoDbClusterSummaryPage.js",
"postgreSqlServicesOverviewPage": "./tests/pages/postgreSqlServicesOverviewPage.js"
},
"multiple": {
"parallel": {
Expand Down
49 changes: 49 additions & 0 deletions tests/pages/postgreSqlServicesOverviewPage.js
@@ -0,0 +1,49 @@
const I = actor();
const { openPanel } = require("./adminPage.js");

module.exports = {

// insert your locators and methods here
// setting locators
url: "graph/d/ieOKKVDWk/postgresql-services-overview",
urlWithRecent: "graph/d/ieOKKVDWk/postgresql-services-overview?refresh=1m&orgId=1&from=now-1m&to=now",
fields: {
pageHeaderText: "PostgreSQL Services Overview",
notAvailableMetrics: "//span[contains(text(), 'N/A')]",
notAvailableDataPoints: "//div[contains(text(),'No data points')]"
},

graphsLocator(metricName) {
locator = "//span[contains(text(), '" + metricName + "')]";
return locator;
},

panelsToOpen: ["Checkpoint Stats Details", "Buffers Operations Details", "Blocks Operations Details", "Canceled Queries Details", "Cache Hit Details",
"Conflicts & Locks Details", "Temp Files Details", "Transactions Details", "Tuples Details", "Autovacuum Details", "Connections Details"],

openPanels() {
for (let i in this.panelsToOpen) openPanel(this.panelsToOpen[i]);
},

metrics: ["Services", "Total Connections", "Total Disk-Page Buffers", "Total Memory Size for each Sort", "Total Shared Buffers", "Services Autovacuum",
"Top 5 PostgreSQL Connections", "Total Connections", "Top 5 Active Connections", "Active Connections", "Autovacuum",
"Total Tuples", "Max Fetched Tuples", "Max Returned Tuples", "Max Inserted Tuples", "Max Updated Tuples", "Max Deleted Tuples",
"Top 5 Fetched Tuples Rate", "Fetched Tuples Rate", "Top 5 Returned Tuples Rate", "Returned Tuples Rate", "Inserted Tuples Rate", "Top 5 Inserted Tuples Rate",
"Top 5 Updated Tuples Rate", "Updated Tuples Rate", "Top 5 Deleted Tuples Rate", "Deleted Tuples Rate",
"Total Transactions", "Max Commits Transactions", "Max Rollback Transactions", "Max Transaction Duration", "Max Number of Temp Files", "Max Size of Temp Files",
"Commit Transactions", "Top 5 Commit Transactions", "Rollback Transactions", "Top 5 Rollbacks Transactions", "Duration of Active Transactions", "Top 5 Duration of Active Transactions",
"Duration of Other Transactions", "Top 5 Duration of Other Transactions", "Number of Temp Files", "Top 5 Number of Temp Files", "Size of Temp Files", "Top 5 Size of Temp Files",
"Total Locks", "Total Deadlocks", "Total Conflicts", "Min Cache Hit Ratio", "Max Cache Hit Ratio", "Total Canceled Queries",
"Locks", "Top 5 Locks", "Deadlocks", "Top 5 Deadlocks", "Conflicts", "Top 5 Conflicts", "Cache Hit Ratio", "Top 5 Lowest Cache Hit Ratio", "Canceled Queries", "Top 5 Canceled Queries",
"Total Blocks Operations", "Max Blocks Writes", "Max Blocks Reads", "Max Allocated Buffers", "Total Written Files to disk", "Total Files Synchronization to Disk",
"Read Operations with Blocks", "Top 5 Read Operations with Blocks", "Write Operations with Blocks", "Top 5 Write Operations with Blocks", "Allocated Buffers", "Top 5 Allocated Buffers",
"Fsync calls by a backend", "Top 5 Fsync calls by a backend", "Written directly by a backend", "Top 5 Written directly by a backend", "Written by the background writer", "Top 5 Written by the background writer",
"Written during checkpoints", "Top 5 Written during checkpoints", "Files Synchronization to disk", "Top 5 Files Synchronization to disk", "Written Files to Disk", "Top 5 Written Files to Disk"],

verifyMetricsExistence () {
for (let i in this.metrics) I.seeElement(this.graphsLocator(this.metrics[i]));

I.dontSeeElement(this.fields.notAvailableMetrics);
I.dontSeeElement(this.fields.notAvailableDataPoints);
}
};
17 changes: 17 additions & 0 deletions tests/verifyPostgreSqlServicesOverviewDashboard_test.js
@@ -0,0 +1,17 @@

Feature('to verify Postgre Sql Service Overview Dashboard');

Before((I, loginPage) => {
I.amOnPage(loginPage.url);
loginPage.login("admin", "admin");
});

Scenario('Open the Postgre Sql Service Overview Dashboard', async (I, adminPage, postgreSqlServicesOverviewPage) => {
I.amOnPage(postgreSqlServicesOverviewPage.url);
I.waitForElement(adminPage.fields.metricTitle, 30);
adminPage.applyTimer("1m");
await adminPage.handleLazyLoading(2);
postgreSqlServicesOverviewPage.openPanels();
await adminPage.handleLazyLoading(15);
postgreSqlServicesOverviewPage.verifyMetricsExistence();
});

0 comments on commit 660601f

Please sign in to comment.