graphdb-workbench-tests 2.2.1-TR1 → 2.2.1-TR3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,6 @@
1
- describe('Monitor Resources', () => {
1
+ // Skipped because cluster health throws an error as there is no cluster.
2
+ // TODO Unskip this either when cluster is available for cypress tests or when proper error handling in the monitor view is implemented
3
+ describe.skip('Monitor Resources', () => {
2
4
 
3
5
  let repositoryId;
4
6
 
@@ -18,7 +20,7 @@ describe('Monitor Resources', () => {
18
20
  cy.get('.ot-loader').should('not.be.visible');
19
21
 
20
22
  // Ensure the chart on the default active tab is rendered
21
- getActiveTabContent().find('svg').should('be.visible');
23
+ getActiveTabContent().should('be.visible');
22
24
  });
23
25
 
24
26
  after(() => {
@@ -29,33 +31,100 @@ describe('Monitor Resources', () => {
29
31
  return cy.get('.graphics');
30
32
  }
31
33
 
34
+ function getTabButtons() {
35
+ return getTabsPanel().find('.nav-item');
36
+ }
37
+
32
38
  function getActiveTab() {
33
- return getTabsPanel().find('.nav-link.active');
39
+ return getTabButtons().find('.nav-link.active');
34
40
  }
35
41
 
36
42
  function getTabContent() {
37
- return cy.get('.tab-content');
43
+ return cy.get('.tabs');
38
44
  }
39
45
 
40
46
  function getActiveTabContent() {
41
- return getTabContent().find('.tab-pane.active');
47
+ return getTabContent().find('.tab-pane');
48
+ }
49
+
50
+ function getChart(id) {
51
+ return getTabContent().find(`#${id}`);
42
52
  }
43
53
 
44
- function getMemoryUsageChart() {
45
- return getTabContent().find('.nv-stackedAreaChart');
54
+ function verifyCharts(charts) {
55
+ charts.forEach((chart) => {
56
+ getChart(chart.id).scrollIntoView().find('.chart-header').should('contain', chart.label);
57
+ getChart(chart.id).scrollIntoView().find(`.${chart.type}`).should('be.visible');
58
+ });
46
59
  }
47
60
 
48
- it('Initial state ', () => {
61
+ it('Should display monitor tabs ', () => {
62
+ const tabs = ['Resource monitoring', 'Performance', 'Cluster health'];
63
+
49
64
  // Graphics container should be present
50
65
  getTabsPanel().should('be.visible');
51
66
  // All tabs should be visible
52
- let tabs = ['Memory', 'Threads', 'CPU', 'Classes'];
53
- getTabsPanel().find('.nav-item').should('have.length', 4).each(($tab, index) => {
67
+ getTabButtons().should('have.length', tabs.length).each(($tab, index) => {
54
68
  cy.wrap($tab).should('be.visible').contains(tabs[index]);
55
69
  });
56
- // And "Memory" tab should be opened by default
57
- getActiveTab().contains('Memory');
58
- getMemoryUsageChart().should('be.visible');
59
- getActiveTabContent().find('h2').contains('Heap Memory Usage');
70
+ // Default tap should be Resource monitoring
71
+ getActiveTab().should('contain', 'Resource monitoring');
72
+ });
73
+
74
+ it('Resource monitoring tab should show cpu, file, storage and memory charts', () => {
75
+ const charts = [{
76
+ id: 'CPUUsageGraphic',
77
+ label: 'System CPU Load',
78
+ type: 'nv-lineChart'
79
+ }, {
80
+ id: 'openFileDescriptors',
81
+ label: 'File descriptors',
82
+ type: 'nv-lineChart'
83
+ }, {
84
+ id: 'heapMemoryGraphic',
85
+ label: 'Heap memory usage',
86
+ type: 'nv-lineChart'
87
+ }, {
88
+ id: 'offHeapMemoryGraphic',
89
+ label: 'Off-heap memory usage',
90
+ type: 'nv-lineChart'
91
+ }, {
92
+ id: 'diskStorage',
93
+ label: 'Disk Storage',
94
+ type: 'nv-multiBarHorizontalChart'
95
+ }];
96
+ verifyCharts(charts);
97
+ });
98
+
99
+ it('Performance monitoring tab should show charts', () => {
100
+ getTabButtons().eq(1).click();
101
+ const charts = [{
102
+ id: 'activeQueries',
103
+ label: 'Queries',
104
+ type: 'nv-lineChart'
105
+ }, {
106
+ id: 'globalCache',
107
+ label: 'Global cache',
108
+ type: 'nv-lineChart'
109
+ }, {
110
+ id: 'epool',
111
+ label: 'Entity pool',
112
+ type: 'multiChart'
113
+ }, {
114
+ id: 'connections',
115
+ label: 'Transactions and Connections',
116
+ type: 'nv-lineChart'
117
+ }];
118
+ verifyCharts(charts);
119
+ });
120
+
121
+ it('Cluster health monitoring tab should show charts', () => {
122
+ getTabButtons().eq(2).click();
123
+ const charts = [{
124
+ id: 'clusterHealth',
125
+ label: 'Cluster health',
126
+ type: 'nv-stackedarea'
127
+ }];
128
+ verifyCharts(charts);
60
129
  });
61
130
  });
@@ -41,7 +41,8 @@ describe('Repositories', () => {
41
41
 
42
42
  beforeEach(() => {
43
43
  repositoryId = 'repo-' + Date.now();
44
- cy.intercept('/rest/locations').as('getLocations');
44
+ cy.intercept('/rest/locations?filterClusterLocations=true').as('getLocations');
45
+ cy.intercept('/rest/repositories/all').as('getRepositories');
45
46
 
46
47
  cy.visit('/repository');
47
48
  waitLoader();
@@ -89,7 +90,7 @@ describe('Repositories', () => {
89
90
  cy.url().should('include', '/repository/create/');
90
91
 
91
92
  // Create a repository by supplying only an identifier
92
- getRepositoryCreateForm().should('be.visible');
93
+ getRepositoryCreateForm();
93
94
  getRepositoryIdField()
94
95
  .should('have.value', '')
95
96
  .type(repositoryId)
@@ -160,7 +161,7 @@ describe('Repositories', () => {
160
161
 
161
162
  saveRepository();
162
163
 
163
- getRepositoryCreateForm().should('be.visible');
164
+ getRepositoryCreateForm();
164
165
  getRepositoryIdField().should('have.attr', 'placeholder', 'This field is required');
165
166
 
166
167
  getToast()
@@ -208,7 +209,7 @@ describe('Repositories', () => {
208
209
 
209
210
  cy.url().should('include', '/repository/edit/' + repositoryId);
210
211
 
211
- getRepositoryCreateForm().should('be.visible');
212
+ getRepositoryCreateForm();
212
213
  getRepositoryIdField().should('have.value', repositoryId);
213
214
  getRepositoryTitleField().should('have.value', repoTitle);
214
215
  // OWL-Horst (Optimized) has become 4
@@ -228,7 +229,6 @@ describe('Repositories', () => {
228
229
 
229
230
  typeRepositoryId(repositoryId);
230
231
  saveRepository();
231
- cy.wait('@getLocations');
232
232
 
233
233
  createRepository();
234
234
  chooseRepositoryType(GDB_REPOSITORY_TYPE);
@@ -236,6 +236,11 @@ describe('Repositories', () => {
236
236
 
237
237
  typeRepositoryId(secondRepoId);
238
238
  saveRepository();
239
+ cy.wait('@getRepositories');
240
+
241
+ // Wait for redirection to previous '/repository'
242
+ cy.waitUntil(() =>
243
+ cy.url().then(url => url === (Cypress.config('baseUrl') + '/repository')));
239
244
 
240
245
  // Connect to the first repo via the connection icon
241
246
  // Note: Not using within() because the whole row will be re-rendered & detached
@@ -304,7 +309,6 @@ describe('Repositories', () => {
304
309
  typeRepositoryId(repositoryId);
305
310
  typeRepositoryTitle('Title');
306
311
  saveRepository();
307
- cy.wait('@getLocations');
308
312
  editRepository(repositoryId);
309
313
 
310
314
  // Some fields should be disabled
@@ -344,7 +348,6 @@ describe('Repositories', () => {
344
348
 
345
349
  typeRepositoryId(repositoryId);
346
350
  saveRepository();
347
- cy.wait('@getLocations');
348
351
  selectRepoFromDropdown(repositoryId);
349
352
 
350
353
  getRepositoryFromList(repositoryId)
@@ -356,8 +359,6 @@ describe('Repositories', () => {
356
359
 
357
360
  confirmModal();
358
361
 
359
- getRepositoriesList().should('not.exist');
360
-
361
362
  // Check the repo has been deselected and is not present in the repo dropdown menu
362
363
  getRepositoriesDropdown().click().within(() => {
363
364
  cy.get('#btnReposGroup').should('not.contain', repositoryId);
@@ -519,7 +520,7 @@ describe('Repositories', () => {
519
520
  cy.url().should('include', '/repository/create/ontop');
520
521
 
521
522
  // Create a repository by supplying only an identifier
522
- getRepositoryCreateForm().should('be.visible');
523
+ getRepositoryCreateForm();
523
524
  getRepositoryIdField()
524
525
  .should('have.value', '')
525
526
  .type(repositoryId)
@@ -629,7 +630,7 @@ describe('Repositories', () => {
629
630
  cy.url().should('include', '/repository/create');
630
631
 
631
632
  // Create a repository by supplying only an identifier
632
- getRepositoryCreateForm().should('be.visible');
633
+ getRepositoryCreateForm();
633
634
  getRepositoryIdField()
634
635
  .should('have.value', '')
635
636
  .type(repositoryId)
@@ -807,7 +808,7 @@ describe('Repositories', () => {
807
808
  }
808
809
 
809
810
  function getRepositoryCreateForm() {
810
- return cy.get('#newRepoForm');
811
+ return cy.get('#newRepoForm').should('be.visible');
811
812
  }
812
813
 
813
814
  function getRepositoryIdField() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "2.2.1-TR1",
3
+ "version": "2.2.1-TR3",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "scripts": {
6
6
  "start": "cypress open",