graphdb-workbench-tests 3.5.0 → 3.5.1-RC1

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": "3.5.0",
3
+ "version": "3.5.1-RC1",
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
  }
@@ -94,6 +94,10 @@ export class SettingsSteps {
94
94
  return this.getSettingsPage().find('.user-repositories .table');
95
95
  }
96
96
 
97
+ static getRepositoryRightsRows() {
98
+ return this.getUserRepositoryTable().getByTestId('repository-rights-rows');
99
+ }
100
+
97
101
  static getUserRepository(name) {
98
102
  return this.getUserRepositoryTable().find(`.repository-name:contains('${name}')`).closest('tr');
99
103
  }
@@ -1,5 +1,7 @@
1
1
  import {EnvironmentStubs} from "../../stubs/environment-stubs";
2
2
 
3
+ const CENTER_SCROLL = {scrollBehavior: 'center'};
4
+
3
5
  export class UserAndAccessSteps {
4
6
  static visit() {
5
7
  cy.visit('/users');
@@ -118,7 +120,9 @@ export class UserAndAccessSteps {
118
120
  }
119
121
 
120
122
  static typeUsername(text) {
121
- this.getUsernameField().type(text);
123
+ this.getUsernameField()
124
+ .focus()
125
+ .type(text);
122
126
  }
123
127
 
124
128
  static getPasswordField() {
@@ -238,13 +242,13 @@ export class UserAndAccessSteps {
238
242
  .contains('Global (any data repository)')
239
243
  .parent('tr')
240
244
  .find('.graphql')
241
- .realClick();
245
+ .click(CENTER_SCROLL);
242
246
  }
243
247
 
244
248
  static clickGraphqlAccessRepo(repoName) {
245
249
  this.getRepositoryRightsLine(repoName)
246
250
  .find('.graphql')
247
- .realClick();
251
+ .click(CENTER_SCROLL);
248
252
  }
249
253
 
250
254
  static clickReadAccessAny() {
@@ -252,7 +256,7 @@ export class UserAndAccessSteps {
252
256
  .contains('Global (any data repository)')
253
257
  .parent('tr')
254
258
  .find('.read')
255
- .realClick();
259
+ .click(CENTER_SCROLL);
256
260
  }
257
261
 
258
262
  static clickReadAccessRepo(repoName) {
@@ -260,7 +264,7 @@ export class UserAndAccessSteps {
260
264
  .contains(repoName)
261
265
  .parent('tr')
262
266
  .find('.read')
263
- .realClick();
267
+ .click(CENTER_SCROLL);
264
268
  }
265
269
 
266
270
  static clickWriteAccessAny() {
@@ -268,7 +272,7 @@ export class UserAndAccessSteps {
268
272
  .contains('Global (any data repository)')
269
273
  .parent('tr')
270
274
  .find('.write')
271
- .realClick();
275
+ .click(CENTER_SCROLL);
272
276
  }
273
277
 
274
278
  static clickWriteAccessRepo(repoName) {
@@ -276,7 +280,7 @@ export class UserAndAccessSteps {
276
280
  .contains(repoName)
277
281
  .parent('tr')
278
282
  .find('.write')
279
- .realClick();
283
+ .click(CENTER_SCROLL);
280
284
  }
281
285
 
282
286
  static findUserRowAlias(username, aliasName = 'userRow') {
@@ -351,7 +355,7 @@ export class UserAndAccessSteps {
351
355
  }
352
356
 
353
357
  static toggleReadAccessForRepo(repoName) {
354
- return this.getReadAccessForRepo(repoName).realClick();
358
+ return this.getReadAccessForRepo(repoName).click(CENTER_SCROLL);
355
359
  }
356
360
 
357
361
  static validateReadAccessForRepo(repoName, expectedState) {
@@ -374,7 +378,7 @@ export class UserAndAccessSteps {
374
378
  }
375
379
 
376
380
  static toggleWriteAccessForRepo(repoName) {
377
- return this.getWriteAccessForRepo(repoName).realClick();
381
+ return this.getWriteAccessForRepo(repoName).click(CENTER_SCROLL);
378
382
  }
379
383
 
380
384
  static validateWriteAccessForRepo(repoName, expectedState) {
@@ -390,7 +394,7 @@ export class UserAndAccessSteps {
390
394
  }
391
395
 
392
396
  static clickMaintainAccessRepo(repoName) {
393
- UserAndAccessSteps.getMaintainAccessRepoCheckbox(repoName).realClick();
397
+ UserAndAccessSteps.getMaintainAccessRepoCheckbox(repoName).click(CENTER_SCROLL);
394
398
  }
395
399
 
396
400
  static toggleMaintainRepoForRepo(repoName) {
@@ -405,15 +409,12 @@ export class UserAndAccessSteps {
405
409
  // ============= GraphQL Access Toggles and Validations =============
406
410
 
407
411
  static getGraphqlAccessForRepo(repoName) {
408
- const matchText = (repoName === '*') ? 'Global (any data repository)' : repoName;
409
- return cy.get('#user-repos')
410
- .contains(matchText)
411
- .parent('tr')
412
- .find('.graphql')
412
+ const testId = (repoName === '*') ? 'graphql-any-checkbox' : 'graphql-repository-checkbox';
413
+ return this.getRepositoryRightsLine(repoName).getByTestId(testId);
413
414
  }
414
415
 
415
416
  static toggleGraphqlAccessForRepo(repoName) {
416
- return this.getGraphqlAccessForRepo(repoName).realClick();
417
+ return this.getGraphqlAccessForRepo(repoName).click(CENTER_SCROLL);
417
418
  }
418
419
 
419
420
  static validateGraphqlAccessForRepo(repoName, expectedState) {
@@ -421,6 +422,30 @@ export class UserAndAccessSteps {
421
422
  this.validateRightsForRepo(repoName, graphqlAccessCheckbox, expectedState);
422
423
  }
423
424
 
425
+ static getRepositoryRightsRows() {
426
+ return cy.getByTestId('repository-rights-rows');
427
+ }
428
+
429
+ static getGraphqlAnyRoleTooltip() {
430
+ return cy.getByTestId('graphql-any-role-tooltip');
431
+ }
432
+
433
+ static getGraphqlRepositoryTypeTooltipForRepo(repoName) {
434
+ return this.getRepositoryRightsLine(repoName).getByTestId('graphql-repository-type-tooltip');
435
+ }
436
+
437
+ static hoverGraphQlRightsCheckbox(repoName) {
438
+ this.getGraphqlRepositoryTypeTooltipForRepo(repoName).trigger('mouseover');
439
+ }
440
+
441
+ static blurGraphQlRightsCheckbox(repoName) {
442
+ this.getGraphqlRepositoryTypeTooltipForRepo(repoName).trigger('mouseout');
443
+ }
444
+
445
+ static getAngularTooltip() {
446
+ return cy.get('.angular-tooltip');
447
+ }
448
+
424
449
  static clickMenuItem(label) {
425
450
  return cy.get('.main-menu').contains(label).click({force: true});
426
451
  }
@@ -434,19 +459,19 @@ export class UserAndAccessSteps {
434
459
  .contains(repoName)
435
460
  .parent('.row')
436
461
  .find('.read')
437
- .realClick();
462
+ .click(CENTER_SCROLL);
438
463
  }
439
464
 
440
465
  static clickFreeWriteAccessRepo(repoName) {
441
466
  cy.get('.repo-fields').contains(repoName).parent('.row').as('row');
442
467
  cy.get('@row').scrollIntoView();
443
- cy.get('@row').find('.write').realClick();
468
+ cy.get('@row').find('.write').click(CENTER_SCROLL);
444
469
  }
445
470
 
446
471
  static clickFreeGraphqlAccessRepo(repoName) {
447
472
  cy.get('.repo-fields').contains(repoName).parent('.row').as('row');
448
473
  cy.get('@row').scrollIntoView();
449
- cy.get('@row').find('.graphql').realClick();
474
+ cy.get('@row').find('.graphql').click(CENTER_SCROLL);
450
475
  }
451
476
 
452
477
  }
@@ -451,6 +451,14 @@ export class TtygAgentSettingsModalSteps extends ModalDialogSteps {
451
451
  return this.getDialog().find('.temperature');
452
452
  }
453
453
 
454
+ static getTemperatureToggle() {
455
+ return TtygAgentSettingsModalSteps.getTemperatureFormGroup().find('.temperature-toggle label');
456
+ }
457
+
458
+ static toggleTemperature() {
459
+ TtygAgentSettingsModalSteps.getTemperatureToggle().click();
460
+ }
461
+
454
462
  static getTemperatureField() {
455
463
  return this.getTemperatureFormGroup().find('#temperature');
456
464
  }
@@ -477,6 +485,14 @@ export class TtygAgentSettingsModalSteps extends ModalDialogSteps {
477
485
  return this.getDialog().find('.top-p');
478
486
  }
479
487
 
488
+ static getTopPToggle() {
489
+ return TtygAgentSettingsModalSteps.getTopPFormGroup().find('.top-p-toggle label');
490
+ }
491
+
492
+ static toggleTop() {
493
+ TtygAgentSettingsModalSteps.getTopPToggle().click();
494
+ }
495
+
480
496
  static getTopPField() {
481
497
  return this.getTopPFormGroup().find('#topP');
482
498
  }
@@ -77,6 +77,13 @@ export class ClusterStubs extends Stubs {
77
77
  }).as('cluster-config');
78
78
  }
79
79
 
80
+ static stubClusterConfigWithTag() {
81
+ cy.intercept('/rest/cluster/config', {
82
+ fixture: '/cluster/cluster-config-with-tag.json',
83
+ statusCode: 200
84
+ }).as('cluster-config-with-tag');
85
+ }
86
+
80
87
  static stubDeleteCluster() {
81
88
  cy.intercept('/rest/cluster/config?force=false', {
82
89
  fixture: '/cluster/delete-cluster.json',
@@ -132,7 +139,7 @@ export class ClusterStubs extends Stubs {
132
139
  added.forEach((node) => {
133
140
  response[node] = "Node was successfully added in the cluster.";
134
141
  });
135
- added.forEach((node) => {
142
+ removed.forEach((node) => {
136
143
  response[node] = "Node was successfully removed from the cluster.";
137
144
  });
138
145
 
@@ -210,6 +217,13 @@ export class ClusterStubs extends Stubs {
210
217
  }).as('3-nodes-cluster-group-status-tag');
211
218
  }
212
219
 
220
+ static stubClusterGroupStatusWithoutLeader() {
221
+ cy.intercept('/rest/cluster/group/status', {
222
+ fixture: '/cluster/3-nodes-cluster-group-status-no-leader.json',
223
+ statusCode: 200
224
+ }).as('3-nodes-cluster-group-status-no-leader');
225
+ }
226
+
213
227
  static stubDeleteTag(uri) {
214
228
  cy.intercept(`rest/cluster/config/tag`, {
215
229
  body: `"Removed primary tag '${uri}' from cluster`,