graphdb-workbench-tests 4.0.0-TR3 → 4.0.0-TR5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "4.0.0-TR3",
3
+ "version": "4.0.0-TR5",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -119,6 +119,10 @@ export class ClusterConfigurationSteps {
119
119
  return this.getMultiRegionTabContent().find('.title');
120
120
  }
121
121
 
122
+ static getNoLeaderAlert() {
123
+ return this.getMultiRegionTabContent().find('.no-leader-alert');
124
+ }
125
+
122
126
  static getAddTagButton() {
123
127
  return this.getMultiRegionTabContent().find('.create-tag-btn');
124
128
  }
@@ -161,17 +161,29 @@ class ImportSteps {
161
161
  return this.getSelectedResources().eq(index).closest('.title-row');
162
162
  }
163
163
 
164
- static getResource(index) {
164
+ static getResourceTitleRow(index) {
165
165
  return this.getResources().eq(index);
166
166
  }
167
167
 
168
+ static getResourceByIndex(index) {
169
+ return this.getResourcesTable().find(`[data-test="resource-${index}"]`);
170
+ }
171
+
172
+ static getResourceNameByIndex(index) {
173
+ return this.getResourceByIndex(index).find('.cell-title').invoke('text');
174
+ }
175
+
176
+ static getResourceStatusByIndex(index) {
177
+ return this.getResourceByIndex(index).find('.import-resource-message');
178
+ }
179
+
168
180
  static getResourceByName(name) {
169
181
  return this.getResources().find('.cell-title').contains(name)
170
182
  .closest('.row.title-row');
171
183
  }
172
184
 
173
185
  static selectFileByIndex(index) {
174
- this.getResource(index).find('.select-checkbox').click();
186
+ this.getResourceTitleRow(index).find('.select-checkbox').click();
175
187
  }
176
188
 
177
189
  static selectFileByName(name) {
@@ -194,8 +206,16 @@ class ImportSteps {
194
206
  return this.getResources().find('.import-resource-message');
195
207
  }
196
208
 
197
- static checkImportedResource(index, resourceName, expectedStatus) {
209
+ static checkImportedResourceByIndex(index, resourceName, expectedStatus) {
198
210
  const status = expectedStatus || 'Imported successfully';
211
+
212
+ this.getResourceNameByIndex(index).should('contain', resourceName);
213
+ this.getResourceStatusByIndex(index).should('contain', status);
214
+ }
215
+
216
+ static checkImportedResourceByName(resourceName, expectedStatus) {
217
+ const status = expectedStatus || 'Imported successfully';
218
+
199
219
  this.getResourceByName(resourceName).should('contain', resourceName);
200
220
  this.getResourceStatus(resourceName).should('contain', status);
201
221
  }
@@ -263,11 +283,11 @@ class ImportSteps {
263
283
  }
264
284
 
265
285
  static deleteUploadedFile(index) {
266
- this.getResource(index).find('.import-resource-action-remove-btn').invoke('show').trigger('click');
286
+ this.getResourceTitleRow(index).find('.import-resource-action-remove-btn').invoke('show').trigger('click');
267
287
  }
268
288
 
269
289
  static importFile(index) {
270
- this.getResource(index).find('.import-resource-action-import-btn').invoke('show').trigger('click');
290
+ this.getResourceTitleRow(index).find('.import-resource-action-import-btn').invoke('show').trigger('click');
271
291
  }
272
292
 
273
293
  static importResourceByName(name) {
@@ -275,7 +295,7 @@ class ImportSteps {
275
295
  }
276
296
 
277
297
  static resetFileStatus(index) {
278
- this.getResource(index).find('.import-resource-action-reset-btn').click();
298
+ this.getResourceTitleRow(index).find('.import-resource-action-reset-btn').click();
279
299
  }
280
300
 
281
301
  static resetResourceStatusByName(name) {
@@ -132,7 +132,7 @@ export class ClusterStubs extends Stubs {
132
132
  added.forEach((node) => {
133
133
  response[node] = "Node was successfully added in the cluster.";
134
134
  });
135
- added.forEach((node) => {
135
+ removed.forEach((node) => {
136
136
  response[node] = "Node was successfully removed from the cluster.";
137
137
  });
138
138
 
@@ -210,6 +210,13 @@ export class ClusterStubs extends Stubs {
210
210
  }).as('3-nodes-cluster-group-status-tag');
211
211
  }
212
212
 
213
+ static stubClusterGroupStatusWithoutLeader() {
214
+ cy.intercept('/rest/cluster/group/status', {
215
+ fixture: '/cluster/3-nodes-cluster-group-status-no-leader.json',
216
+ statusCode: 200
217
+ }).as('3-nodes-cluster-group-status-no-leader');
218
+ }
219
+
213
220
  static stubDeleteTag(uri) {
214
221
  cy.intercept(`rest/cluster/config/tag`, {
215
222
  body: `"Removed primary tag '${uri}' from cluster`,
@@ -20,6 +20,10 @@ export class RepositoriesStubs extends Stubs {
20
20
  cy.intercept('GET', '/rest/locations/active').as('getActiveLocations');
21
21
  }
22
22
 
23
+ static spyGetRepository(id) {
24
+ cy.intercept(`GET`, `${REPOSITORIES_URL}/${id}?location=`).as('getRepository');
25
+ }
26
+
23
27
  static stubLocations(withDelay = 0) {
24
28
  RepositoriesStubs.stubQueryResponse('/rest/locations', '/repositories/get-locations.json', 'get-locations', withDelay);
25
29
  }