graphdb-workbench-tests 4.0.0-TR5 → 4.0.0-TR7

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.
Files changed (35) hide show
  1. package/e2e-flaky/import/import-server-files-operations.spec.js +1 -23
  2. package/e2e-legacy/cluster/cluster-configuration/cluster-configuration-multi-region.spec.js +7 -0
  3. package/e2e-legacy/cluster/edit-cluster-nodes-modal.spec.js +1 -1
  4. package/e2e-legacy/explore/visual-graph/visual.graph.spec.js +35 -4
  5. package/e2e-legacy/import/import-server-files.spec.js +3 -5
  6. package/e2e-legacy/import/import-user-data-text-snippet.spec.js +0 -39
  7. package/e2e-legacy/import/import-user-data-url.spec.js +6 -3
  8. package/e2e-legacy/rdf-version/rdf-version-accept-header.spec.js +145 -0
  9. package/e2e-legacy/reactodia/reactodia.spec.js +122 -0
  10. package/e2e-legacy/resource/resource.spec.js +176 -39
  11. package/e2e-legacy/setup/aclmanagement/create-rule.spec.js +14 -25
  12. package/e2e-legacy/setup/aclmanagement/delete-rule.spec.js +6 -6
  13. package/e2e-legacy/setup/aclmanagement/edit-rule.spec.js +15 -15
  14. package/e2e-legacy/setup/aclmanagement/render-rules.spec.js +1 -1
  15. package/e2e-legacy/setup/aclmanagement/reorder-rules.spec.js +2 -2
  16. package/e2e-legacy/setup/aclmanagement/revert-rules.spec.js +2 -2
  17. package/e2e-legacy/setup/aclmanagement/update-rules.spec.js +3 -3
  18. package/e2e-legacy/setup/aclmanagement/validate-uri.spec.js +152 -0
  19. package/e2e-legacy/setup/users-and-access/user-and-access.spec.js +1 -1
  20. package/e2e-legacy/sparql-editor/yasr/download-as.spec.js +4 -7
  21. package/e2e-security/setup/users-and-access/user-and-access.spec.js +0 -1
  22. package/fixtures/cluster/cluster-config-with-tag.json +17 -0
  23. package/fixtures/graphdb-import/wine.rdf +279 -285
  24. package/npm-shrinkwrap.json +2 -2
  25. package/package.json +1 -1
  26. package/steps/error-steps.js +1 -1
  27. package/steps/import/import-test-constants.js +1 -1
  28. package/steps/main-menu-steps.js +9 -0
  29. package/steps/reactodia-steps.js +42 -0
  30. package/steps/resource/resource-steps.js +72 -5
  31. package/steps/setup/acl-management-steps.js +3 -23
  32. package/stubs/cluster/cluster-stubs.js +7 -0
  33. package/fixtures/graphdb-import/test-trigstar.trigs +0 -32
  34. package/fixtures/graphdb-import/test_turtlestar.ttls +0 -6
  35. package/fixtures/graphdb-import/turtlestar-data.ttls +0 -77
@@ -1,5 +1,5 @@
1
1
  import HomeSteps from "../../steps/home-steps";
2
- import {ResourceSteps} from "../../steps/resource/resource-steps";
2
+ import {ResourceSteps, TRIPLE_TERM_ROLE_LABEL} from "../../steps/resource/resource-steps";
3
3
  import {QueryStubs} from "../../stubs/yasgui/query-stubs";
4
4
  import {VisualGraphSteps} from "../../steps/visual-graph-steps";
5
5
  import {SparqlEditorSteps} from "../../steps/sparql-editor-steps";
@@ -9,6 +9,7 @@ import {YasguiSteps} from "../../steps/yasgui/yasgui-steps";
9
9
  import {JsonLdModalSteps} from "../../steps/json-ld-modal-steps";
10
10
  import {GraphConfigStubs} from '../../stubs/graph-config-stubs.js';
11
11
  import {VisualGraphSplitButtonSteps} from '../../steps/visual-graph-split-button-steps.js';
12
+ import {ReactodiaSteps} from '../../steps/reactodia-steps.js';
12
13
 
13
14
  const FILE_TO_IMPORT = 'resource-test-data.ttl';
14
15
  const SUBJECT_RESOURCE_ENCODED = 'http:%2F%2Fexample.com%2Fontology%23CustomerLoyalty';
@@ -17,7 +18,36 @@ const PREDICATE_SOURCE = 'http:%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23subCl
17
18
  const CONTEXT_EXPLICIT = 'http://www.ontotext.com/explicit';
18
19
  const OBJECT_RESOURCE = 'http:%2F%2Fexample.com%2Fontology%23Metric';
19
20
  const IMPLICIT_EXPLICIT_RESOURCE = 'http:%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23type';
20
- const TRIPLE_RESOURCE = '%3C%3C%3Chttp:%2F%2Fexample.com%2Fresource%2Fperson%2FW6J1827%3E%20%3Chttp:%2F%2Fexample.com%2Fontology%23hasAddress%3E%20%3Chttp:%2F%2Fexample.com%2Fresource%2Fperson%2FW6J1827%2Faddress%3E%3E%3E';
21
+ // A triple term in the SPARQL 1.2 syntax. The resource view expects it wrapped in <<( )>>.
22
+ const TRIPLE_RESOURCE_DECODED = '<<(<http://example.com/resource/person/W6J1827> <http://example.com/ontology#hasAddress> <http://example.com/resource/person/W6J1827/address>)>>';
23
+ const TRIPLE_RESOURCE_ENCODED = encodeURIComponent(TRIPLE_RESOURCE_DECODED);
24
+ const TRIPLE_RESOURCE_LOCAL_NAMES = '<<(<W6J1827> <hasAddress> <address>)>>';
25
+ // A triple term whose object is a literal. It is deliberately not part of the test data, because it is
26
+ // used only to verify that shortening the IRIs of a triple term leaves its literals untouched.
27
+ const LITERAL_TRIPLE_RESOURCE_DECODED = '<<(<http://example.com/resource/person/W6J1827> <http://example.com/ontology#firstName> "Burgunda")>>';
28
+ const LITERAL_TRIPLE_RESOURCE_ENCODED = encodeURIComponent(LITERAL_TRIPLE_RESOURCE_DECODED);
29
+ const LITERAL_TRIPLE_RESOURCE_LOCAL_NAMES = '<<(<W6J1827> <firstName> "Burgunda")>>';
30
+ // The number of statements the resource view lists for the triple term - the four statements which
31
+ // annotate it in the test data plus the "rdf:reifies" statement which binds its reifier to it.
32
+ const TRIPLE_RESOURCE_STATEMENTS_COUNT = 5;
33
+ // The query which the resource view builds for a triple term - it looks up all statements having the triple term as an object.
34
+ const TRIPLE_TERM_LOOKUP_QUERY = `SELECT ?s ?p ?tt
35
+ WHERE {
36
+ VALUES ?tt {
37
+ ${TRIPLE_RESOURCE_DECODED}
38
+ }
39
+ ?s ?p ?tt .
40
+ }`;
41
+ // The link which both the header and the target link of a triple term point to.
42
+ const TRIPLE_TERM_LOOKUP_HREF = `sparql?query=${encodeURIComponent(TRIPLE_TERM_LOOKUP_QUERY)}`;
43
+ // The statement counts of the test data. The data annotates eleven triples with the RDF 1.2 reification
44
+ // syntax (<<s p o>>), and GraphDB expands each of them to a reifier plus an "rdf:reifies" statement
45
+ // pointing at the triple term. Those eleven extra statements are the reason why these counts are higher
46
+ // than the ones expected before the SPARQL 1.2 support was added.
47
+ const EXPLICIT_TYPE_STATEMENTS_COUNT = 24;
48
+ const IMPLICIT_TYPE_STATEMENTS_COUNT = 68;
49
+ const ALL_TYPE_STATEMENTS_COUNT = EXPLICIT_TYPE_STATEMENTS_COUNT + IMPLICIT_TYPE_STATEMENTS_COUNT;
50
+ const EXPLICIT_GRAPH_STATEMENTS_COUNT = 97;
21
51
 
22
52
  describe('Resource view', () => {
23
53
  let repositoryId;
@@ -34,7 +64,7 @@ describe('Resource view', () => {
34
64
  });
35
65
 
36
66
  it('should open resource view with active role tab depend on url role parameter', () => {
37
- ResourceSteps.getAllRoles().forEach((role) => {
67
+ ResourceSteps.getPlainResourceRoles().forEach((role) => {
38
68
  ResourceSteps.visit(`uri=${SUBJECT_RESOURCE_ENCODED}&role=${role}`);
39
69
  ResourceSteps.verifyActiveRoleTab(role);
40
70
  });
@@ -75,6 +105,18 @@ describe('Resource view', () => {
75
105
  VisualGraphSteps.verifyUrl();
76
106
  });
77
107
 
108
+ it('should open reactodia view when click on the "Visualize Reactodia" button', () => {
109
+ // When I am on resource view and page loaded a resource.
110
+ ResourceSteps.visit(`uri=${SUBJECT_RESOURCE_ENCODED}`);
111
+
112
+ // When I click on "Visualize Reactodia" button.
113
+ ResourceSteps.clickOnVisualizeReactodiaButton();
114
+
115
+ // Then I expect to be redirected to the reactodia view with the resource as the start uri.
116
+ ReactodiaSteps.verifyUrl();
117
+ ReactodiaSteps.verifyStartResourceUri(SUBJECT_RESOURCE);
118
+ });
119
+
78
120
  it('should open graphs-visualizations view when select a graph configuration', () => {
79
121
  // When I am on resource view and page loaded a resource.
80
122
  ResourceSteps.visit(`uri=${SUBJECT_RESOURCE_ENCODED}&role=subject`);
@@ -98,29 +140,29 @@ describe('Resource view', () => {
98
140
  ResourceSteps.visit(`uri=${IMPLICIT_EXPLICIT_RESOURCE}&role=all`);
99
141
 
100
142
  // Then I expect to see all triples of explicit context, because default value of the dropdown is "Explicit only".
101
- YasrSteps.getResults().should('have.length', 24);
143
+ YasrSteps.getResults().should('have.length', EXPLICIT_TYPE_STATEMENTS_COUNT);
102
144
  YasrSteps.getResultLink(0, 4).should('contain', CONTEXT_EXPLICIT);
103
145
 
104
146
  // When I chose to display implicit only.
105
147
  ResourceSteps.selectImplicitOnlyInference();
106
148
 
107
149
  // Then I expect triples of implicit context to be displayed only.
108
- YasrSteps.getResults().should('have.length', 67);
150
+ YasrSteps.getResults().should('have.length', IMPLICIT_TYPE_STATEMENTS_COUNT);
109
151
 
110
152
  // When I chose to display both context.
111
153
  ResourceSteps.selectExplicitAndImplicitInference();
112
154
 
113
155
  // Then I expect the triples of both context to be displayed.
114
- YasrSteps.getResults().should('have.length', 91);
156
+ YasrSteps.getResults().should('have.length', ALL_TYPE_STATEMENTS_COUNT);
115
157
 
116
158
  // When I chose to display explicit context only.
117
159
  ResourceSteps.selectExplicitOnlyInference();
118
160
 
119
161
  // Then I expect triples of explicit context to be displayed only.
120
- YasrSteps.getResults().should('have.length', 24);
162
+ YasrSteps.getResults().should('have.length', EXPLICIT_TYPE_STATEMENTS_COUNT);
121
163
  });
122
164
 
123
- context('Same as', () => {
165
+ describe('Same as', () => {
124
166
 
125
167
  it('should display sameAs button when is enabled by user settings', () => {
126
168
  // When I am on resource view and page loaded a resource that has triplets in explicit and implicit context,
@@ -190,7 +232,7 @@ describe('Resource view', () => {
190
232
  });
191
233
  });
192
234
 
193
- context('Role tabs', () => {
235
+ describe('Role tabs', () => {
194
236
 
195
237
  it('should list the triples of a resource used as subject', () => {
196
238
  // When I am on resource view,
@@ -330,7 +372,7 @@ describe('Resource view', () => {
330
372
  ResourceSteps.selectContextRole();
331
373
 
332
374
  // Then I expect to see all triples of resource without mater of its role,
333
- YasrSteps.getResults().should('have.length', 86);
375
+ YasrSteps.getResults().should('have.length', EXPLICIT_GRAPH_STATEMENTS_COUNT);
334
376
  // and inference dropdown should be disabled.
335
377
  ResourceSteps.getInferenceSelectElement().should('be.disabled');
336
378
 
@@ -338,50 +380,145 @@ describe('Resource view', () => {
338
380
  ResourceSteps.selectAllRole();
339
381
 
340
382
  // Then I expect to see all triples of resource without mater of its role.
341
- YasrSteps.getResults().should('have.length', 86);
383
+ YasrSteps.getResults().should('have.length', EXPLICIT_GRAPH_STATEMENTS_COUNT);
384
+ });
385
+
386
+ it('should keep all role tabs enabled when the resource is not a triple term', () => {
387
+ // When I load a resource which is not a triple term.
388
+ ResourceSteps.visit(`uri=${SUBJECT_RESOURCE_ENCODED}&role=subject`);
389
+
390
+ // Then I expect all role tabs to be enabled,
391
+ ResourceSteps.getPlainResourceRoles().forEach((role) => ResourceSteps.verifyRoleTabEnabled(role));
392
+
393
+ // and the triple term links to not be rendered,
394
+ ResourceSteps.getTripleResourceLink().should('not.exist');
395
+ ResourceSteps.getTargetLink().should('not.exist');
396
+
397
+ // but the source link of a plain resource to be rendered instead.
398
+ ResourceSteps.getSourceLink().should('exist');
399
+ });
400
+
401
+ it('should not offer the "triple term" role tab when the resource is not a triple term', () => {
402
+ // When I load a resource which is not a triple term.
403
+ ResourceSteps.visit(`uri=${SUBJECT_RESOURCE_ENCODED}&role=subject`);
404
+
405
+ // Then I expect the "triple term" tab to not be rendered at all, because that role
406
+ // applies to triple terms only,
407
+ ResourceSteps.verifyRoleTabMissing(TRIPLE_TERM_ROLE_LABEL);
408
+ // and only the roles of a plain resource to be offered.
409
+ ResourceSteps.getRoleTabs().should('have.length', ResourceSteps.getPlainResourceRoles().length);
410
+ });
411
+
412
+ it('should fall back to the subject role when the url asks for the "triple term" role of a plain resource', () => {
413
+ // When I load a resource which is not a triple term with the triple term role.
414
+ ResourceSteps.visit(`uri=${SUBJECT_RESOURCE_ENCODED}&role=triple-term`);
415
+
416
+ // Then I expect the role to fall back to the default one,
417
+ ResourceSteps.verifyActiveRoleTab('subject');
418
+ // and the role url parameter to be corrected as well.
419
+ cy.getQueryParam('role').should('eq', 'subject');
420
+
421
+ // And I expect the triples of the resource as subject to be listed.
422
+ YasrSteps.getResults().should('have.length', 1);
423
+ YasrSteps.getResultLink(0, 1).should('contain', SUBJECT_RESOURCE);
342
424
  });
343
425
  });
344
426
 
345
- context('Triple resource', () => {
346
- it('should show triple resource', () => {
427
+ describe('Triple resource', () => {
428
+ it('should show triple resource shortened in the header and in full as a target', () => {
347
429
  // When I visit resource view with triple resource.
348
- ResourceSteps.visit(`triple=${TRIPLE_RESOURCE}&role=subject`);
430
+ ResourceSteps.visit(`triple=${TRIPLE_RESOURCE_ENCODED}&role=subject`);
431
+
432
+ // Then I expect the header link to show the triple term with shortened IRIs,
433
+ ResourceSteps.verifyTrimmedText(ResourceSteps.getTripleResourceLink(), TRIPLE_RESOURCE_LOCAL_NAMES);
434
+ // and the full triple term to be shown as a tooltip.
435
+ ResourceSteps.getTripleResourceLink().should('have.attr', 'gdb-tooltip', TRIPLE_RESOURCE_DECODED);
349
436
 
350
- // Then I expect resource link to exist.
351
- ResourceSteps.getTripleResourceLink().should('contain.text', '<<<W6J1827> <hasAddress> <address>>>');
437
+ // And I expect the target link to show the triple term with its full IRIs.
438
+ ResourceSteps.verifyTrimmedText(ResourceSteps.getTargetLink(), TRIPLE_RESOURCE_DECODED);
352
439
 
353
- // And I expect to see data table
440
+ // And I expect the source link of a plain resource to not be rendered.
441
+ ResourceSteps.getSourceLink().should('not.exist');
442
+
443
+ // And I expect to see data table with the statements annotating the triple term.
354
444
  ResourceSteps.getDataTable().should('exist').and('be.visible');
355
- // When I click on the link.
356
- ResourceSteps.clickOnTripleResourceLink();
445
+ YasrSteps.getResults().should('have.length', TRIPLE_RESOURCE_STATEMENTS_COUNT);
446
+ });
357
447
 
358
- // Then I expect to see sparql query view,
359
- SparqlEditorSteps.verifyUrl();
360
- YasguiSteps.getTabs().should('have.length', 2);
361
- // and a describe query to be present
362
- YasqeSteps.getActiveTabQuery().should('contain', 'describe <<<http://example.com/resource/person/W6J1827> <http://example.com/ontology#hasAddress> <http://example.com/resource/person/W6J1827/address>>>');
448
+ it('should shorten only the IRIs of a triple term and leave its literals unchanged', () => {
449
+ // When I visit resource view with a triple term whose object is a literal.
450
+ ResourceSteps.visit(`triple=${LITERAL_TRIPLE_RESOURCE_ENCODED}&role=subject`);
363
451
 
452
+ // Then I expect the header link to show the IRIs shortened and the literal as it is,
453
+ ResourceSteps.verifyTrimmedText(ResourceSteps.getTripleResourceLink(), LITERAL_TRIPLE_RESOURCE_LOCAL_NAMES);
454
+ // and the target link to show the whole triple term as it is.
455
+ ResourceSteps.verifyTrimmedText(ResourceSteps.getTargetLink(), LITERAL_TRIPLE_RESOURCE_DECODED);
456
+ });
457
+
458
+ it('should point both the header and the target link to the triple term lookup query', () => {
364
459
  // When I visit resource view with triple resource.
365
- ResourceSteps.visit(`triple=${TRIPLE_RESOURCE}&role=subject`);
460
+ ResourceSteps.visit(`triple=${TRIPLE_RESOURCE_ENCODED}&role=subject`);
366
461
 
367
- // Then I expect target link to exist.
368
- ResourceSteps.getTargetLink().should('contain.text', '<<<http://example.com/resource/person/W6J1827> <http://example.com/ontology#hasAddress> <http://example.com/resource/person/W6J1827/address>>>');
462
+ // Then I expect both links to point to the sparql editor with the triple term lookup query.
463
+ ResourceSteps.getTripleResourceLink().should('have.attr', 'href', TRIPLE_TERM_LOOKUP_HREF);
464
+ ResourceSteps.getTargetLink().should('have.attr', 'href', TRIPLE_TERM_LOOKUP_HREF);
465
+ });
369
466
 
370
- // And I expect to see data table
371
- ResourceSteps.getDataTable().should('exist').and('be.visible');
372
- // When I click on the link.
373
- ResourceSteps.clickOnTripleResourceLink();
374
-
375
- // Then I expect to see sparql query view,
376
- SparqlEditorSteps.verifyUrl();
377
- YasguiSteps.getTabs().should('have.length', 2);
378
- // and a describe query to be present
379
- YasqeSteps.getActiveTabQuery().should('contain', 'describe <<<http://example.com/resource/person/W6J1827> <http://example.com/ontology#hasAddress> <http://example.com/resource/person/W6J1827/address>>>');
380
- YasguiSteps.getCurrentTab().should('contain', 'Unnamed 1');
467
+ it('should activate the "triple term" role tab and disable all other role tabs', () => {
468
+ // When I visit resource view with triple resource.
469
+ ResourceSteps.visit(`triple=${TRIPLE_RESOURCE_ENCODED}&role=subject`);
470
+
471
+ // Then I expect the "triple term" tab to be the active one, regardless of the role url parameter,
472
+ ResourceSteps.verifyActiveRoleTab(TRIPLE_TERM_ROLE_LABEL);
473
+ // and the role url parameter to be corrected to the triple term role.
474
+ cy.getQueryParam('role').should('eq', 'triple-term');
475
+
476
+ // And I expect all other role tabs to be disabled.
477
+ ResourceSteps.getRoleTabs().should('have.length', ResourceSteps.getAllRoles().length);
478
+ ResourceSteps.getPlainResourceRoles().forEach((role) => ResourceSteps.verifyRoleTabDisabled(role));
479
+
480
+ // When I click on a disabled role tab.
481
+ ResourceSteps.selectSubjectRole();
482
+
483
+ // Then I expect the role to remain unchanged.
484
+ ResourceSteps.verifyActiveRoleTab(TRIPLE_TERM_ROLE_LABEL);
485
+ cy.getQueryParam('role').should('eq', 'triple-term');
486
+ });
487
+
488
+ it('should activate the "triple term" role tab when the role url parameter is missing', () => {
489
+ // When I visit resource view with a triple resource and without a role parameter.
490
+ ResourceSteps.visit(`triple=${TRIPLE_RESOURCE_ENCODED}`);
491
+
492
+ // Then I expect the "triple term" tab to be the active one,
493
+ ResourceSteps.verifyActiveRoleTab(TRIPLE_TERM_ROLE_LABEL);
494
+ // and the role url parameter to be set to the triple term role.
495
+ cy.getQueryParam('role').should('eq', 'triple-term');
496
+ });
497
+
498
+ // The header link and the target link render the same triple term, so both of them have to lead
499
+ // to the same lookup query in the sparql editor.
500
+ [
501
+ {label: 'header', click: () => ResourceSteps.clickOnTripleResourceLink()},
502
+ {label: 'target', click: () => ResourceSteps.clickOnTargetLink()}
503
+ ].forEach(({label, click}) => {
504
+ it(`should open the sparql editor with a triple term lookup query when the ${label} link is clicked`, () => {
505
+ // When I visit resource view with triple resource.
506
+ ResourceSteps.visit(`triple=${TRIPLE_RESOURCE_ENCODED}&role=subject`);
507
+
508
+ // When I click on the link.
509
+ click();
510
+
511
+ // Then I expect to see sparql query view,
512
+ SparqlEditorSteps.verifyUrl();
513
+ YasguiSteps.getTabs().should('have.length', 2);
514
+ YasguiSteps.getCurrentTab().should('contain', 'Unnamed 1');
515
+ // and the triple term lookup query to be present.
516
+ YasqeSteps.getActiveTabQuery().should('eq', TRIPLE_TERM_LOOKUP_QUERY);
517
+ });
381
518
  });
382
519
  });
383
520
 
384
- context('Download as', () => {
521
+ describe('Download as', () => {
385
522
  it('should download as JSON-LD and then restore defaults', () => {
386
523
  // Given I am in the Resource view
387
524
  ResourceSteps.visit(`uri=${SUBJECT_RESOURCE_ENCODED}&role=subject`);
@@ -27,16 +27,16 @@ describe('ACL Management: create rule', () => {
27
27
 
28
28
  it('Should add a new rule in the beginning of the list and cancel operation', () => {
29
29
  AclManagementSteps.addRuleInBeginning();
30
- AclManagementSteps.getAclRules().should('have.length', 6);
31
- AclManagementSteps.cancelRuleEditing(0);
32
30
  AclManagementSteps.getAclRules().should('have.length', 5);
31
+ AclManagementSteps.cancelRuleEditing(0);
32
+ AclManagementSteps.getAclRules().should('have.length', 4);
33
33
  });
34
34
 
35
35
  it('Should add a new rule in the list and cancel operation', () => {
36
36
  AclManagementSteps.addRule(1);
37
- AclManagementSteps.getAclRules().should('have.length', 6);
38
- AclManagementSteps.cancelRuleEditing(2);
39
37
  AclManagementSteps.getAclRules().should('have.length', 5);
38
+ AclManagementSteps.cancelRuleEditing(2);
39
+ AclManagementSteps.getAclRules().should('have.length', 4);
40
40
  });
41
41
 
42
42
  it('Should add a new rule in the list', () => {
@@ -80,7 +80,7 @@ describe('ACL Management: create rule', () => {
80
80
  // When I save the rule
81
81
  AclManagementSteps.saveRule(2);
82
82
  // Then the rule should be saved
83
- AclManagementSteps.getAclRules().should('have.length', 6);
83
+ AclManagementSteps.getAclRules().should('have.length', 5);
84
84
  const newRule = {
85
85
  "scope": "statement",
86
86
  "policy": "deny",
@@ -93,7 +93,7 @@ describe('ACL Management: create rule', () => {
93
93
  "moveUp": true,
94
94
  "moveDown": true
95
95
  };
96
- AclManagementSteps.checkStatementRules([ACL_VIEW[0], ACL_VIEW[1], newRule, ACL_VIEW[2], ACL_VIEW[3], ACL_VIEW[4]]);
96
+ AclManagementSteps.checkStatementRules([ACL_VIEW[0], ACL_VIEW[1], newRule, ACL_VIEW[2], ACL_VIEW[3]]);
97
97
 
98
98
  cy.intercept('PUT', '/rest/repositories/acl-management-*/acl').as('putCall');
99
99
  // When I save the rules
@@ -134,17 +134,6 @@ describe('ACL Management: create rule', () => {
134
134
  "context": "*",
135
135
  "warnForPrefix": false
136
136
  },
137
- {
138
- "scope": "statement",
139
- "policy": "deny",
140
- "role": "CUSTOM_ROLE3",
141
- "operation": "read",
142
- "subject": "<<<http://example.com/test> <http://www.w3.org/2000/01/rdf-schema#label> \"test aber auf Deutsch\"@de>>",
143
- "predicate": "*",
144
- "object": "\"test aber auf Deutsch\"@en",
145
- "context": "<http://example.com/graph1>",
146
- "warnForPrefix": false
147
- },
148
137
  {
149
138
  "scope": "statement",
150
139
  "policy": "allow",
@@ -163,7 +152,7 @@ describe('ACL Management: create rule', () => {
163
152
  "operation": "write",
164
153
  "subject": "<urn:Cat>",
165
154
  "predicate": "*",
166
- "object": "<<<http://example.com/test> <http://www.w3.org/2000/01/rdf-schema#label> \"test aber auf Deutsch\"@de>>",
155
+ "object": "<<( <http://example.com/test> <http://www.w3.org/2000/01/rdf-schema#label> \"test aber auf Deutsch\"@de )>>",
167
156
  "context": "*",
168
157
  "warnForPrefix": false
169
158
  }
@@ -175,11 +164,11 @@ describe('ACL Management: create rule', () => {
175
164
  it('Should hide all unnecessary actions during rule creation', () => {
176
165
  // When there is no rule opened for edit
177
166
  // Then I expect that move up, move down, edit rule, create rule, delete rule buttons to be visible
178
- AclManagementSteps.getMoveUpButtons().should('have.length', 4);
179
- AclManagementSteps.getMoveDownButtons().should('have.length', 4);
180
- AclManagementSteps.deleteRuleButtons().should('have.length', 5);
181
- AclManagementSteps.editRuleButtons().should('have.length', 5);
182
- AclManagementSteps.createRuleButtons().should('have.length', 5);
167
+ AclManagementSteps.getMoveUpButtons().should('have.length', 3);
168
+ AclManagementSteps.getMoveDownButtons().should('have.length', 3);
169
+ AclManagementSteps.deleteRuleButtons().should('have.length', 4);
170
+ AclManagementSteps.editRuleButtons().should('have.length', 4);
171
+ AclManagementSteps.createRuleButtons().should('have.length', 4);
183
172
  // When a rule is in edit mode
184
173
  AclManagementSteps.addRule(1);
185
174
  // Then I expect that move up, move down, edit rule, create rule, delete rule buttons to be hidden
@@ -228,7 +217,7 @@ describe('ACL Management: create rule', () => {
228
217
 
229
218
  it('should allow creating a new rule if CUSTOM ROLE is a wildcard (*)', () => {
230
219
  // Given I have a defined number of rules at the beginning
231
- AclManagementSteps.getAclRules().should('have.length', 5);
220
+ AclManagementSteps.getAclRules().should('have.length', 4);
232
221
  // When I am on "ACL Management" page and create a new rule with a CUSTOM ROLE of 1 symbol (a wildcard)
233
222
  AclManagementSteps.addRuleInBeginning();
234
223
  AclManagementSteps.selectPolicy(0, 'allow');
@@ -247,7 +236,7 @@ describe('ACL Management: create rule', () => {
247
236
  AclManagementSteps.saveAcl();
248
237
  // Then the table should contain the new rule
249
238
  AclManagementSteps.getSavedRoleField(0).should('contain', '*');
250
- AclManagementSteps.getAclRules().should('have.length', 6);
239
+ AclManagementSteps.getAclRules().should('have.length', 5);
251
240
  });
252
241
 
253
242
  it('should show message if role prefix is CUSTOM_', () => {
@@ -26,7 +26,7 @@ describe('ACL Management: delete rule', () => {
26
26
 
27
27
  it('Should be able to delete rule', () => {
28
28
  // When I try to remove a rule
29
- AclManagementSteps.getAclRules().should('have.length', 5);
29
+ AclManagementSteps.getAclRules().should('have.length', 4);
30
30
  AclManagementSteps.deleteRule(0);
31
31
  // Then I expect a confirmation dialog
32
32
  ModalDialogSteps.getDialog().should('be.visible');
@@ -35,14 +35,14 @@ describe('ACL Management: delete rule', () => {
35
35
  ModalDialogSteps.clickOnCancelButton();
36
36
  // Then I expect the rule to remain in the list
37
37
  ModalDialogSteps.getDialog().should('not.exist');
38
- AclManagementSteps.getAclRules().should('have.length', 5);
38
+ AclManagementSteps.getAclRules().should('have.length', 4);
39
39
  // When I try remove it again and confirm the operation
40
- AclManagementSteps.deleteRule(4);
41
- ModalDialogSteps.getDialogBody().should('contain', 'Are you sure you want to delete the selected rule #5?');
40
+ AclManagementSteps.deleteRule(3);
41
+ ModalDialogSteps.getDialogBody().should('contain', 'Are you sure you want to delete the selected rule #4?');
42
42
  ModalDialogSteps.clickOnConfirmButton();
43
43
  // Then I expect the rule to be removed from the list
44
44
  ModalDialogSteps.getDialog().should('not.exist');
45
- AclManagementSteps.getAclRules().should('have.length', 4);
46
- AclManagementSteps.checkStatementRules([ACL_VIEW[0], ACL_VIEW[1], ACL_VIEW[2], ACL_VIEW[3]]);
45
+ AclManagementSteps.getAclRules().should('have.length', 3);
46
+ AclManagementSteps.checkStatementRules([ACL_VIEW[0], ACL_VIEW[1], ACL_VIEW[2]]);
47
47
  });
48
48
  });
@@ -26,11 +26,11 @@ describe('ACL Management: edit rule', () => {
26
26
  it('Should hide all unnecessary actions during rule editing', () => {
27
27
  // When there is no rule opened for edit
28
28
  // Then I expect that move up, move down, edit rule, create rule, delete rule buttons to be visible
29
- AclManagementSteps.getMoveUpButtons().should('have.length', 4);
30
- AclManagementSteps.getMoveDownButtons().should('have.length', 4);
31
- AclManagementSteps.deleteRuleButtons().should('have.length', 5);
32
- AclManagementSteps.editRuleButtons().should('have.length', 5);
33
- AclManagementSteps.createRuleButtons().should('have.length', 5);
29
+ AclManagementSteps.getMoveUpButtons().should('have.length', 3);
30
+ AclManagementSteps.getMoveDownButtons().should('have.length', 3);
31
+ AclManagementSteps.deleteRuleButtons().should('have.length', 4);
32
+ AclManagementSteps.editRuleButtons().should('have.length', 4);
33
+ AclManagementSteps.createRuleButtons().should('have.length', 4);
34
34
  // When a rule is in edit mode
35
35
  AclManagementSteps.editRule(1);
36
36
  // Then I expect that move up, move down, edit rule, create rule, delete rule buttons to be hidden
@@ -43,23 +43,23 @@ describe('ACL Management: edit rule', () => {
43
43
 
44
44
  it('Should be able to edit rule', () => {
45
45
  // When I edit a rule
46
- AclManagementSteps.getAclRules().should('have.length', 5);
46
+ AclManagementSteps.getAclRules().should('have.length', 4);
47
47
  AclManagementSteps.editRule(2);
48
48
  // Then I expect rule edit form to be opened
49
- AclManagementSteps.getAclRules().should('have.length', 5);
49
+ AclManagementSteps.getAclRules().should('have.length', 4);
50
50
  AclManagementSteps.checkRuleEditForm(2, {
51
- subject: '<<<http://example.com/test> <http://www.w3.org/2000/01/rdf-schema#label> "test aber auf Deutsch"@de>>',
52
- predicate: '*',
53
- object: '"test aber auf Deutsch"@en',
54
- context: '<http://example.com/graph1>',
55
- role: 'ROLE3',
56
- policy: 'deny'
51
+ subject: "*",
52
+ predicate: "*",
53
+ object: "\"15\"^^<http://www.w3.org/2001/XMLSchema#int>",
54
+ context: "*",
55
+ role: "ROLE3",
56
+ policy: "allow"
57
57
  });
58
58
  AclManagementSteps.checkIfRuleSavingIsAllowed(2);
59
59
  // When I cancel the edit operation
60
60
  AclManagementSteps.cancelRuleEditing(2);
61
61
  // Then I expect that the rule will be opened in preview mode again with the same values
62
- AclManagementSteps.getAclRules().should('have.length', 5);
62
+ AclManagementSteps.getAclRules().should('have.length', 4);
63
63
  AclManagementSteps.checkStatementRules(ACL_VIEW);
64
64
  // When I edit the rule again
65
65
  AclManagementSteps.editRule(2);
@@ -84,7 +84,7 @@ describe('ACL Management: edit rule', () => {
84
84
  object: '*',
85
85
  context: '*'
86
86
  };
87
- AclManagementSteps.checkStatementRules([ACL_VIEW[0], ACL_VIEW[1], editedRule, ACL_VIEW[3], ACL_VIEW[4]]);
87
+ AclManagementSteps.checkStatementRules([ACL_VIEW[0], ACL_VIEW[1], editedRule, ACL_VIEW[3]]);
88
88
  });
89
89
  });
90
90
 
@@ -42,7 +42,7 @@ describe('ACL Management: render rules', () => {
42
42
  });
43
43
 
44
44
  it('Should render ACL rules in a table', () => {
45
- AclManagementSteps.getAclRules().should('have.length', 5);
45
+ AclManagementSteps.getAclRules().should('have.length', 4);
46
46
  AclManagementSteps.getAddFirstRuleButton().should('be.visible');
47
47
  AclManagementSteps.checkStatementRules(ACL_VIEW);
48
48
  });
@@ -24,11 +24,11 @@ describe('ACL Management: reorder rules', () => {
24
24
 
25
25
  it('Should move rule up', () => {
26
26
  AclManagementSteps.moveRuleUp(1);
27
- AclManagementSteps.checkStatementRules([ACL_VIEW[1], ACL_VIEW[0], ACL_VIEW[2], ACL_VIEW[3], ACL_VIEW[4]]);
27
+ AclManagementSteps.checkStatementRules([ACL_VIEW[1], ACL_VIEW[0], ACL_VIEW[2], ACL_VIEW[3]]);
28
28
  });
29
29
 
30
30
  it('Should move rule down', () => {
31
31
  AclManagementSteps.moveRuleDown(1);
32
- AclManagementSteps.checkStatementRules([ACL_VIEW[0], ACL_VIEW[2], ACL_VIEW[1], ACL_VIEW[3], ACL_VIEW[4]]);
32
+ AclManagementSteps.checkStatementRules([ACL_VIEW[0], ACL_VIEW[2], ACL_VIEW[1], ACL_VIEW[3]]);
33
33
  });
34
34
  });
@@ -45,14 +45,14 @@ describe('ACL Management: revert rules', () => {
45
45
  AclManagementSteps.selectPolicy(1, 'allow');
46
46
  AclManagementSteps.saveRule(1);
47
47
  // And I delete an existing rule
48
- AclManagementSteps.deleteRule(5);
48
+ AclManagementSteps.deleteRule(4);
49
49
  ModalDialogSteps.clickOnConfirmButton();
50
50
  // And I click on cancel button (reverting the ACL list)
51
51
  AclManagementSteps.cancelAclSaving();
52
52
  ModalDialogSteps.clickOnConfirmButton();
53
53
  // Then I expect that all changes in the ACL should be reverted
54
54
  ApplicationSteps.getSuccessNotifications().should('be.visible');
55
- AclManagementSteps.getAclRules().should('have.length', 5);
55
+ AclManagementSteps.getAclRules().should('have.length', 4);
56
56
  AclManagementSteps.checkStatementRules(ACL_VIEW);
57
57
  // And the model should become pristine again after the revert
58
58
  // I should be able to navigate away from the page without any confirmation
@@ -47,14 +47,14 @@ describe('ACL Management: update rules', () => {
47
47
  AclManagementSteps.selectOperation(1, 'write');
48
48
  AclManagementSteps.saveRule(1);
49
49
  // And I delete an existing rule
50
- AclManagementSteps.deleteRule(5);
50
+ AclManagementSteps.deleteRule(4);
51
51
  ModalDialogSteps.clickOnConfirmButton();
52
52
  // And I save the ACL list
53
53
  AclManagementSteps.saveAcl();
54
54
  ApplicationSteps.getLoader().should('not.exist');
55
55
  // Then I expect the ACL to be saved
56
56
  ApplicationSteps.getSuccessNotifications().should('be.visible');
57
- AclManagementSteps.getAclRules().should('have.length', 5);
57
+ AclManagementSteps.getAclRules().should('have.length', 4);
58
58
  const editedRule = {
59
59
  "scope": "statement",
60
60
  "policy": "deny",
@@ -79,7 +79,7 @@ describe('ACL Management: update rules', () => {
79
79
  "moveUp": true,
80
80
  "moveDown": true
81
81
  };
82
- AclManagementSteps.checkStatementRules([ACL_VIEW[0], newRule, editedRule, ACL_VIEW[2], ACL_VIEW[3]]);
82
+ AclManagementSteps.checkStatementRules([ACL_VIEW[0], newRule, editedRule, ACL_VIEW[2]]);
83
83
  });
84
84
 
85
85
  it('Should prevent leaving the page when there is new rule added', () => {