graphdb-workbench-tests 2.2.0-TR2 → 2.2.1-RC2

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.
@@ -238,6 +238,7 @@
238
238
  "ontop.repos.translate.data": "Ontop repositories translate data stored in an SQL database to a virtual SPARQL endpoint.",
239
239
  "fedex.virtual.sparql": "FedX Virtual SPARQL",
240
240
  "fedex.multi.sparql.endpoints": "FedX repositories provide transparent federation of multiple SPARQL endpoints under a single virtual endpoint.",
241
+ "fedex.experimental.feature.warning": "GraphDB FedX federation is currently an experimental feature. Not recommended to be used in a production environment.",
241
242
  "connector.label": "connector",
242
243
  "eta.label": "ETA:",
243
244
  "processed.entities": "Processed entities:",
@@ -14,11 +14,10 @@ describe('Monitor Resources', () => {
14
14
  cy.window();
15
15
 
16
16
  // Wait for loaders to disappear
17
- cy.get('.ot-splash').should('not.be.visible');
18
- cy.get('.ot-loader').should('not.be.visible');
17
+ getTabsPanel().should('be.visible');
19
18
 
20
19
  // Ensure the chart on the default active tab is rendered
21
- getActiveTabContent().find('svg').should('be.visible');
20
+ getActiveTabContent().should('be.visible');
22
21
  });
23
22
 
24
23
  after(() => {
@@ -29,33 +28,116 @@ describe('Monitor Resources', () => {
29
28
  return cy.get('.graphics');
30
29
  }
31
30
 
31
+ function getTabButtons() {
32
+ return getTabsPanel().find('.nav-item');
33
+ }
34
+
32
35
  function getActiveTab() {
33
- return getTabsPanel().find('.nav-link.active');
36
+ return getTabButtons().find('.nav-link.active');
34
37
  }
35
38
 
36
39
  function getTabContent() {
37
- return cy.get('.tab-content');
40
+ return cy.get('.tabs');
38
41
  }
39
42
 
40
43
  function getActiveTabContent() {
41
- return getTabContent().find('.tab-pane.active');
44
+ return getTabContent().find('.tab-pane');
45
+ }
46
+
47
+ function getChart(id) {
48
+ return getTabContent().find(`#${id}`);
49
+ }
50
+
51
+ function getErrorsPane() {
52
+ return cy.get('.errors');
53
+ }
54
+
55
+ function getErrors() {
56
+ return getErrorsPane().find('.error');
57
+ }
58
+
59
+ function getError(index) {
60
+ return getErrors().eq(index);
42
61
  }
43
62
 
44
- function getMemoryUsageChart() {
45
- return getTabContent().find('.nv-stackedAreaChart');
63
+ function verifyCharts(charts) {
64
+ charts.forEach((chart) => {
65
+ getChart(chart.id).scrollIntoView().find('.chart-header').should('contain', chart.label);
66
+ getChart(chart.id).scrollIntoView().find(`.${chart.type}`).should('be.visible');
67
+ });
46
68
  }
47
69
 
48
- it('Initial state ', () => {
70
+ it('Should display monitor tabs ', () => {
71
+ const tabs = ['Resource monitoring', 'Performance', 'Cluster health'];
72
+
49
73
  // Graphics container should be present
50
74
  getTabsPanel().should('be.visible');
51
75
  // All tabs should be visible
52
- let tabs = ['Memory', 'Threads', 'CPU', 'Classes'];
53
- getTabsPanel().find('.nav-item').should('have.length', 4).each(($tab, index) => {
76
+ getTabButtons().should('have.length', tabs.length).each(($tab, index) => {
54
77
  cy.wrap($tab).should('be.visible').contains(tabs[index]);
55
78
  });
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');
79
+ // Default tap should be Resource monitoring
80
+ getActiveTab().should('contain', 'Resource monitoring');
81
+ });
82
+
83
+ it('Resource monitoring tab should show cpu, file, storage and memory charts', () => {
84
+ const charts = [{
85
+ id: 'CPUUsageGraphic',
86
+ label: 'System CPU Load',
87
+ type: 'nv-lineChart'
88
+ }, {
89
+ id: 'openFileDescriptors',
90
+ label: 'File descriptors',
91
+ type: 'nv-lineChart'
92
+ }, {
93
+ id: 'heapMemoryGraphic',
94
+ label: 'Heap memory usage',
95
+ type: 'nv-lineChart'
96
+ }, {
97
+ id: 'offHeapMemoryGraphic',
98
+ label: 'Off-heap memory usage',
99
+ type: 'nv-lineChart'
100
+ }, {
101
+ id: 'diskStorage',
102
+ label: 'Disk Storage',
103
+ type: 'nv-multiBarHorizontalChart'
104
+ }];
105
+ verifyCharts(charts);
106
+ });
107
+
108
+ it('Performance monitoring tab should show charts', () => {
109
+ getTabButtons().eq(1).click();
110
+ const charts = [{
111
+ id: 'activeQueries',
112
+ label: 'Queries',
113
+ type: 'nv-lineChart'
114
+ }, {
115
+ id: 'globalCache',
116
+ label: 'Global cache',
117
+ type: 'nv-lineChart'
118
+ }, {
119
+ id: 'epool',
120
+ label: 'Entity pool',
121
+ type: 'multiChart'
122
+ }, {
123
+ id: 'connections',
124
+ label: 'Transactions and Connections',
125
+ type: 'nv-lineChart'
126
+ }];
127
+ verifyCharts(charts);
128
+ });
129
+
130
+ it('Should show error and no data chart for non existing cluster', () => {
131
+ getErrorsPane().should('be.visible');
132
+ getErrors().should('have.length', 1);
133
+ getError(0).should('contain', 'Cluster does not exist');
134
+
135
+ getTabButtons().eq(2).click();
136
+ const charts = [{
137
+ id: 'clusterHealth',
138
+ label: 'Cluster health',
139
+ type: 'nv-noData'
140
+ }];
141
+ verifyCharts(charts);
60
142
  });
61
143
  });
@@ -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.0-TR2",
3
+ "version": "2.2.1-RC2",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "scripts": {
6
6
  "start": "cypress open",