graphdb-workbench-tests 2.4.0 → 2.4.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.
@@ -2,6 +2,8 @@ import HomeSteps from "../../steps/home-steps";
2
2
  import ImportSteps from "../../steps/import-steps";
3
3
  import {RepositorySteps} from "../../steps/repository-steps";
4
4
  import {ToasterSteps} from "../../steps/toaster-steps";
5
+ import {GlobalOperationsStatusesStub} from "../../stubs/global-operations-statuses-stub";
6
+ import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
5
7
 
6
8
  describe('Repositories', () => {
7
9
 
@@ -449,6 +451,35 @@ describe('Repositories', () => {
449
451
  .verifyImportStatus('Text snippet', 'org.eclipse.rdf4j.sail.shacl.GraphDBShaclSailValidationException: Failed SHACL validation');
450
452
  });
451
453
 
454
+ it('should not allow editing of repository name if repository is in cluster', () => {
455
+ // When I create a repository,
456
+ cy.createRepository({id: repositoryId});
457
+ // set the repository be in a cluster.
458
+ GlobalOperationsStatusesStub.stubGlobalOperationsStatusesResponse(repositoryId);
459
+ // and go to the edit repository page.
460
+ RepositorySteps.visitEditPage(repositoryId);
461
+
462
+ // When I try to edit the repository id.
463
+ RepositorySteps.editRepositoryId();
464
+
465
+ // Then I expect the repository name can't be edited.
466
+ ModalDialogSteps.getDialog().should('not.exist');
467
+ RepositorySteps.getRepositoryIdEditElement().should('have.css', 'cursor').and('match', /not-allowed/);
468
+ });
469
+
470
+ it('should allow editing of repository name if repository is not in cluster', () => {
471
+ // When I create a repository,
472
+ cy.createRepository({id: repositoryId});
473
+ // and go to edit the repository page.
474
+ RepositorySteps.visitEditPage(repositoryId);
475
+
476
+ // When I try to edit the repository id.
477
+ RepositorySteps.editRepositoryId();
478
+
479
+ // Then I expect to see a confirmation dialog.
480
+ ModalDialogSteps.verifyDialogBody('Changing the repository ID is a dangerous operation since it renames the repository folder and enforces repository shutdown.');
481
+ });
482
+
452
483
  function assertRepositoryStatus(repositoryId, status) {
453
484
  cy.waitUntil(() =>
454
485
  RepositorySteps.getRepositoryFromList(repositoryId)
@@ -16,6 +16,7 @@ describe('ACL Management: create rule', () => {
16
16
  cy.createRepository({id: repositoryId});
17
17
  cy.presetRepository(repositoryId);
18
18
  cy.initializeRepository(repositoryId);
19
+ cy.enableAutocomplete(repositoryId);
19
20
  AclManagementSteps.importRules(repositoryId);
20
21
  AclManagementSteps.visit();
21
22
  // ensure rules are rendered
@@ -15,6 +15,7 @@ describe('ACL Management: delete rule', () => {
15
15
  cy.createRepository({id: repositoryId});
16
16
  cy.presetRepository(repositoryId);
17
17
  cy.initializeRepository(repositoryId);
18
+ cy.enableAutocomplete(repositoryId);
18
19
  AclManagementSteps.importRules(repositoryId);
19
20
  AclManagementSteps.visit();
20
21
  // ensure rules are rendered
@@ -14,6 +14,7 @@ describe('ACL Management: edit rule', () => {
14
14
  cy.createRepository({id: repositoryId});
15
15
  cy.presetRepository(repositoryId);
16
16
  cy.initializeRepository(repositoryId);
17
+ cy.enableAutocomplete(repositoryId);
17
18
  AclManagementSteps.importRules(repositoryId);
18
19
  AclManagementSteps.visit();
19
20
  // ensure rules are rendered
@@ -61,7 +62,8 @@ describe('ACL Management: edit rule', () => {
61
62
  // When I edit the rule again
62
63
  AclManagementSteps.editRule(2);
63
64
  AclManagementSteps.fillSubject(2, '<urn:Me>');
64
- AclManagementSteps.fillPredicate(2, 'rdf:type');
65
+ // this will be autocompleted to "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>"
66
+ AclManagementSteps.fillPredicate(2, 'rdf:');
65
67
  AclManagementSteps.fillObject(2, '*');
66
68
  AclManagementSteps.fillContext(2, '*');
67
69
  AclManagementSteps.fillRole(2, 'TEST');
@@ -71,7 +73,7 @@ describe('ACL Management: edit rule', () => {
71
73
  // Then I expect the rule to be saved with the new data
72
74
  const editedRule = {
73
75
  subject: '<urn:Me>',
74
- predicate: 'rdf:type',
76
+ predicate: '<http://www.w3.org/1999/02/22-rdf-syntax-ns#>',
75
77
  object: '*',
76
78
  context: '*',
77
79
  role: 'TEST',
@@ -15,6 +15,7 @@ describe('ACL Management: revert rules', () => {
15
15
  cy.createRepository({id: repositoryId});
16
16
  cy.presetRepository(repositoryId);
17
17
  cy.initializeRepository(repositoryId);
18
+ cy.enableAutocomplete(repositoryId);
18
19
  AclManagementSteps.importRules(repositoryId);
19
20
  AclManagementSteps.visit();
20
21
  // ensure rules are rendered
@@ -15,6 +15,7 @@ describe('ACL Management: update rules', () => {
15
15
  cy.createRepository({id: repositoryId});
16
16
  cy.presetRepository(repositoryId);
17
17
  cy.initializeRepository(repositoryId);
18
+ cy.enableAutocomplete(repositoryId);
18
19
  AclManagementSteps.importRules(repositoryId);
19
20
  AclManagementSteps.visit();
20
21
  // ensure rules are rendered
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "2.4.0",
3
+ "version": "2.4.1-RC1",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "scripts": {
6
6
  "start": "cypress open",
@@ -12,6 +12,10 @@ export class RepositorySteps {
12
12
  RepositorySteps.waitUntilRepositoriesPageIsLoaded();
13
13
  }
14
14
 
15
+ static visitEditPage(repositoryId) {
16
+ cy.visit(`repository/edit/${repositoryId}?location=`);
17
+ }
18
+
15
19
  static getCreateRepositoryButton() {
16
20
  return cy.get('#wb-repositories-addRepositoryLink');
17
21
  }
@@ -109,6 +113,14 @@ export class RepositorySteps {
109
113
  return RepositorySteps.getRepositoryCreateForm().find('#title');
110
114
  }
111
115
 
116
+ static getRepositoryIdEditElement() {
117
+ return cy.get('.ot-edit-input');
118
+ }
119
+
120
+ static editRepositoryId() {
121
+ this.getRepositoryIdEditElement().click();
122
+ }
123
+
112
124
  static typeRepositoryTitle(title) {
113
125
  RepositorySteps.getRepositoryTitleField().clear().type(title);
114
126
  }