graphdb-workbench-tests 4.0.0-TR2 → 4.0.0-TR20

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 (115) hide show
  1. package/e2e-flaky/import/import-server-files-operations.spec.js +8 -30
  2. package/e2e-flaky/import/import-user-data-batch-operations.spec.js +7 -7
  3. package/e2e-flaky/import/import-user-data-url.spec.js +1 -1
  4. package/e2e-flaky/sparql-editor/lucene-connector.spec.js +1 -1
  5. package/e2e-legacy/cluster/cluster-configuration/cluster-configuration-multi-region.spec.js +27 -0
  6. package/e2e-legacy/cluster/edit-cluster-nodes-modal.spec.js +1 -1
  7. package/e2e-legacy/explore/graphs-overview/graphs.overview.spec.js +31 -2
  8. package/e2e-legacy/explore/visual-graph/visual.graph.spec.js +35 -4
  9. package/e2e-legacy/graph-navigator/graph-navigator-restrictions.spec.js +216 -0
  10. package/e2e-legacy/graph-navigator/graph-navigator.spec.js +447 -0
  11. package/e2e-legacy/guides/import-rdf-file/confirm-duplicate-rdf-file.spec.js +1 -1
  12. package/e2e-legacy/guides/main-menu/main-menu-guide.spec.js +6 -14
  13. package/e2e-legacy/guides/ttyg/configure-agent/configure-agent-guide.spec.js +26 -30
  14. package/e2e-legacy/guides/ttyg/edit-agent/edit-ttyg-agent-guide.spec.js +12 -20
  15. package/e2e-legacy/home/home-page-without-repositories.spec.js +3 -1
  16. package/e2e-legacy/home/home-page-without-selected-repository.spec.js +2 -1
  17. package/e2e-legacy/import/import-server-files-batch-operations.spec.js +38 -5
  18. package/e2e-legacy/import/import-server-files.spec.js +39 -23
  19. package/e2e-legacy/import/import-user-data-file-upload.spec.js +47 -22
  20. package/e2e-legacy/import/import-user-data-settings-dialog.spec.js +81 -10
  21. package/e2e-legacy/import/import-user-data-text-snippet.spec.js +6 -45
  22. package/e2e-legacy/import/import-user-data-url.spec.js +9 -5
  23. package/e2e-legacy/import/import-view.spec.js +2 -2
  24. package/e2e-legacy/monitor/global-operation-statuses-component.spec.js +13 -17
  25. package/e2e-legacy/rdf-version/rdf-version-accept-header.spec.js +145 -0
  26. package/e2e-legacy/repository/ontop-repository.spec.js +25 -34
  27. package/e2e-legacy/repository/rename-repository-restrictions.spec.js +5 -1
  28. package/e2e-legacy/repository/repositories.spec.js +3 -3
  29. package/e2e-legacy/repository/repository-picker-tooltip.spec.js +72 -0
  30. package/e2e-legacy/repository/repository-selector-tooltip.spec.js +55 -0
  31. package/e2e-legacy/resource/resource.spec.js +177 -40
  32. package/e2e-legacy/setup/aclmanagement/create-rule.spec.js +14 -25
  33. package/e2e-legacy/setup/aclmanagement/delete-rule.spec.js +6 -6
  34. package/e2e-legacy/setup/aclmanagement/edit-rule.spec.js +15 -15
  35. package/e2e-legacy/setup/aclmanagement/render-rules.spec.js +1 -1
  36. package/e2e-legacy/setup/aclmanagement/reorder-rules.spec.js +2 -2
  37. package/e2e-legacy/setup/aclmanagement/revert-rules.spec.js +2 -2
  38. package/e2e-legacy/setup/aclmanagement/update-rules.spec.js +3 -3
  39. package/e2e-legacy/setup/aclmanagement/validate-uri.spec.js +152 -0
  40. package/e2e-legacy/setup/connectors/connectors-initial-state-with-selected-repository.spec.js +1 -1
  41. package/e2e-legacy/setup/plugins/plugins-without-repository.spec.js +1 -1
  42. package/e2e-legacy/setup/settings/my-settings.spec.js +25 -15
  43. package/e2e-legacy/setup/users-and-access/user-and-access.spec.js +34 -25
  44. package/e2e-legacy/sparql-editor/saved-query/abort-query.spec.js +1 -1
  45. package/e2e-legacy/sparql-editor/sparql-editor-navigation.spec.js +219 -0
  46. package/e2e-legacy/sparql-editor/yasgui-tabs.spec.js +1 -1
  47. package/e2e-legacy/sparql-editor/yasr/download-as.spec.js +4 -7
  48. package/e2e-legacy/sparql-editor/yasr/toolbar/visual-graph-button.spec.js +8 -8
  49. package/e2e-legacy/ttyg/chat-list.spec.js +1 -1
  50. package/e2e-legacy/ttyg/create-agent.spec.js +6 -4
  51. package/e2e-legacy/ttyg/create-chat.spec.js +1 -1
  52. package/e2e-legacy/ttyg/edit-agent.spec.js +57 -0
  53. package/e2e-legacy/ttyg/ttyg-initial-state-with-configured-api-key.spec.js +1 -1
  54. package/e2e-legacy/ttyg/ttyg-initial-state-with-selected-repository.spec.js +1 -1
  55. package/e2e-legacy/ttyg/ttyg-initial-state-without-repositories.spec.js +1 -1
  56. package/e2e-security/explore/visual-graph/graph-config-owner-actions.spec.js +52 -0
  57. package/e2e-security/setup/home/cookie-policy.spec.js +4 -0
  58. package/e2e-security/setup/license/license-loading.spec.js +57 -0
  59. package/e2e-security/setup/license/license-logout.spec.js +36 -0
  60. package/e2e-security/setup/users-and-access/create-user-permissions.spec.js +1 -1
  61. package/e2e-security/setup/users-and-access/repo-admin-role.spec.js +1 -1
  62. package/e2e-security/setup/users-and-access/user-and-access.spec.js +0 -1
  63. package/fixtures/cluster/3-nodes-cluster-group-status-no-leader.json +41 -0
  64. package/fixtures/cluster/cluster-config-with-tag.json +17 -0
  65. package/fixtures/connectors/get-connectors.json +0 -1
  66. package/fixtures/graph-navigator/graph-navigator-settings-invalid.ttl +149 -0
  67. package/fixtures/graph-navigator/graph-navigator-settings.ttl +148 -0
  68. package/fixtures/graphdb-import/wine.rdf +279 -285
  69. package/npm-shrinkwrap.json +1283 -1643
  70. package/package.json +10 -1
  71. package/steps/base-steps.js +4 -0
  72. package/steps/cluster/cluster-configuration-steps.js +4 -0
  73. package/steps/cookie-policy/cookie-consent-banner-steps.js +2 -2
  74. package/steps/error-steps.js +2 -2
  75. package/steps/explore/graphs-overview-steps.js +44 -0
  76. package/steps/graph-navigator-steps.js +145 -0
  77. package/steps/header-steps.js +5 -1
  78. package/steps/home-steps.js +3 -6
  79. package/steps/import/import-server-files-steps.js +8 -0
  80. package/steps/import/import-settings-dialog-steps.js +16 -0
  81. package/steps/import/import-steps.js +88 -17
  82. package/steps/import/import-test-constants.js +1 -1
  83. package/steps/import/import-user-data-steps.js +24 -24
  84. package/steps/language-selector-steps.js +4 -0
  85. package/steps/layout-steps.js +6 -0
  86. package/steps/login-steps.js +7 -3
  87. package/steps/main-menu-steps.js +14 -14
  88. package/steps/ontop-repository-steps.js +4 -0
  89. package/steps/page-restrictions-steps.js +24 -0
  90. package/steps/repository-picker-list-steps.js +54 -0
  91. package/steps/repository-selector-steps.js +16 -0
  92. package/steps/repository-steps.js +13 -9
  93. package/steps/resource/resource-steps.js +76 -9
  94. package/steps/setup/acl-management-steps.js +4 -24
  95. package/steps/setup/settings-steps.js +42 -0
  96. package/steps/setup/user-and-access-steps.js +18 -14
  97. package/steps/toaster-steps.js +4 -0
  98. package/steps/ttyg/ttyg-view-steps.js +1 -14
  99. package/steps/visual-graph-steps.js +8 -0
  100. package/steps/widgets/repository-errors-widget-steps.js +6 -2
  101. package/steps/yasgui/yasqe-steps.js +3 -1
  102. package/steps/yasgui/yasr-steps.js +8 -0
  103. package/stubs/browser-stubs.js +40 -0
  104. package/stubs/cluster/cluster-stubs.js +15 -1
  105. package/stubs/graph-navigator-stubs.js +27 -0
  106. package/stubs/license-stubs.js +4 -3
  107. package/stubs/repositories/repositories-stubs.js +44 -0
  108. package/stubs/yasgui/query-stubs.js +5 -0
  109. package/support/visual-graph-commands.js +19 -0
  110. package/e2e-legacy/home/solr-banner/solr-banner.spec.js +0 -137
  111. package/fixtures/graphdb-import/test-trigstar.trigs +0 -32
  112. package/fixtures/graphdb-import/test_turtlestar.ttls +0 -6
  113. package/fixtures/graphdb-import/turtlestar-data.ttls +0 -77
  114. package/steps/deprecation-banner/deprecation-banner-steps.js +0 -13
  115. package/steps/deprecation-steps.js +0 -13
@@ -9,8 +9,6 @@ describe('Import server files - Operations', () => {
9
9
  const CONTEXT = 'http://example.org/context';
10
10
  const FILE_FOR_IMPORT = 'italian_public_schools_links.nt.gz';
11
11
  const FILE_FROM_DIRECTORY_FOR_IMPORT = 'rdfxml.rdf';
12
- const TTLS_FOR_IMPORT = 'test_turtlestar.ttls';
13
- const TRIGS_FOR_IMPORT = 'test-trigstar.trigs';
14
12
  const JSONLD_FILE_FOR_IMPORT = '0007-import-file.jsonld';
15
13
  const JSONLD_CONTEXT = 'https://w3c.github.io/json-ld-api/tests/compact/0007-context.jsonld';
16
14
 
@@ -18,7 +16,7 @@ describe('Import server files - Operations', () => {
18
16
  repositoryId = 'server-import-' + Date.now();
19
17
  cy.createRepository({id: repositoryId});
20
18
  ImportServerFilesSteps.visitServerImport(repositoryId);
21
- ImportServerFilesSteps.getResources().should('have.length', 18);
19
+ ImportServerFilesSteps.getResources().should('have.length', 17);
22
20
  });
23
21
 
24
22
  afterEach(() => {
@@ -31,7 +29,7 @@ describe('Import server files - Operations', () => {
31
29
  ImportServerFilesSteps.importResourceByName(FILE_FOR_IMPORT);
32
30
  ImportSettingsDialogSteps.import();
33
31
  // Then I should see the file imported successfully
34
- ImportServerFilesSteps.checkImportedResource(0, FILE_FOR_IMPORT);
32
+ ImportServerFilesSteps.checkImportedResourceByIndex(0, FILE_FOR_IMPORT);
35
33
  // TODO: this and all similar check in the tests below are a checking for the default import settings which we probably should not verify here.
36
34
  // ImportServerFilesSteps.verifyImportStatusDetails(FILE_FOR_IMPORT, '"preserveBNodeIds": false,');
37
35
  });
@@ -42,7 +40,7 @@ describe('Import server files - Operations', () => {
42
40
  ImportServerFilesSteps.importResourceByName(FILE_FROM_DIRECTORY_FOR_IMPORT);
43
41
  ImportSettingsDialogSteps.import();
44
42
  // Then I should see the file imported successfully
45
- ImportServerFilesSteps.checkImportedResource(0, FILE_FROM_DIRECTORY_FOR_IMPORT);
43
+ ImportServerFilesSteps.checkImportedResourceByIndex(0, FILE_FROM_DIRECTORY_FOR_IMPORT);
46
44
  });
47
45
 
48
46
  it('Should import Server files successfully with changing settings', () => {
@@ -57,7 +55,7 @@ describe('Import server files - Operations', () => {
57
55
  ImportSettingsDialogSteps.enablePreserveBNodes();
58
56
  ImportSettingsDialogSteps.import();
59
57
  // Then I should see the file imported successfully
60
- ImportServerFilesSteps.checkImportedResource(0, FILE_FOR_IMPORT);
58
+ ImportServerFilesSteps.checkImportedResourceByIndex(0, FILE_FOR_IMPORT);
61
59
  // ImportSteps.verifyImportStatusDetails(FILE_FOR_IMPORT, [CONTEXT, BASE_URI, '"preserveBNodeIds": true,']);
62
60
  });
63
61
 
@@ -75,7 +73,7 @@ describe('Import server files - Operations', () => {
75
73
  ImportSettingsDialogSteps.enablePreserveBNodes();
76
74
  ImportSettingsDialogSteps.import();
77
75
  // Then I should see the file imported successfully
78
- ImportServerFilesSteps.checkImportedResource(0, JSONLD_FILE_FOR_IMPORT);
76
+ ImportServerFilesSteps.checkImportedResourceByIndex(0, JSONLD_FILE_FOR_IMPORT);
79
77
  // ImportSteps.verifyImportStatusDetails(JSONLD_FILE_FOR_IMPORT, [CONTEXT, BASE_URI, '"preserveBNodeIds": true,', JSONLD_CONTEXT]);
80
78
  });
81
79
 
@@ -92,7 +90,7 @@ describe('Import server files - Operations', () => {
92
90
  ImportSettingsDialogSteps.enablePreserveBNodes();
93
91
  ImportSettingsDialogSteps.import();
94
92
  // Then I should see the file imported successfully
95
- ImportServerFilesSteps.checkImportedResource(0, JSONLD_FILE_FOR_IMPORT);
93
+ ImportServerFilesSteps.checkImportedResourceByIndex(0, JSONLD_FILE_FOR_IMPORT);
96
94
  // ImportSteps.verifyImportStatusDetails(JSONLD_FILE_FOR_IMPORT, [CONTEXT, BASE_URI, '"preserveBNodeIds": true,']);
97
95
  });
98
96
 
@@ -101,7 +99,7 @@ describe('Import server files - Operations', () => {
101
99
  // And I have imported a file
102
100
  ImportServerFilesSteps.importResourceByName(FILE_FOR_IMPORT);
103
101
  ImportSettingsDialogSteps.import();
104
- ImportServerFilesSteps.checkImportedResource(0, FILE_FOR_IMPORT);
102
+ ImportServerFilesSteps.checkImportedResourceByIndex(0, FILE_FOR_IMPORT);
105
103
  // When I reset the status of the imported file
106
104
  ImportServerFilesSteps.resetResourceStatusByName(FILE_FOR_IMPORT);
107
105
  // Then Import status of the file should not be visible
@@ -113,30 +111,10 @@ describe('Import server files - Operations', () => {
113
111
  // And I have imported a file
114
112
  ImportServerFilesSteps.importResourceByName(FILE_FROM_DIRECTORY_FOR_IMPORT);
115
113
  ImportSettingsDialogSteps.import();
116
- ImportServerFilesSteps.checkImportedResource(0, FILE_FROM_DIRECTORY_FOR_IMPORT);
114
+ ImportServerFilesSteps.checkImportedResourceByIndex(0, FILE_FROM_DIRECTORY_FOR_IMPORT);
117
115
  // When I reset the status of the imported file
118
116
  ImportServerFilesSteps.resetResourceStatusByName(FILE_FROM_DIRECTORY_FOR_IMPORT);
119
117
  // Then Import status of the file should not be visible
120
118
  ImportServerFilesSteps.getResourceStatus(FILE_FROM_DIRECTORY_FOR_IMPORT).should('be.hidden');
121
119
  });
122
-
123
- it('Should import turtlestar from Server files successfully without changing settings', () => {
124
- // Given I have opened the server files tab
125
- ImportServerFilesSteps.importResourceByName(TTLS_FOR_IMPORT);
126
- // When I select to import a ttl file without changing settings
127
- ImportSettingsDialogSteps.import();
128
- // Then I should see the file imported successfully
129
- ImportServerFilesSteps.checkImportedResource(0, TTLS_FOR_IMPORT);
130
- // ImportSteps.verifyImportStatusDetails(TTLS_FOR_IMPORT, '"preserveBNodeIds": false,');
131
- });
132
-
133
- it('Should import trigstar from Server files successfully without changing settings', () => {
134
- // Given I have opened the server files tab
135
- ImportServerFilesSteps.importResourceByName(TRIGS_FOR_IMPORT);
136
- // When I select to import a trigstar file without changing settings
137
- ImportSettingsDialogSteps.import();
138
- // Then I should see the file imported successfully
139
- ImportServerFilesSteps.checkImportedResource(0, TRIGS_FOR_IMPORT);
140
- // ImportSteps.verifyImportStatusDetails(TRIGS_FOR_IMPORT, '"preserveBNodeIds": false,');
141
- });
142
120
  });
@@ -56,7 +56,7 @@ describe('Import user data: Batch operations', () => {
56
56
  ImportSettingsDialogSteps.getDialog().should('be.visible');
57
57
  ImportSettingsDialogSteps.import();
58
58
  ImportUserDataSteps.getResources().should('have.length', 3);
59
- ImportUserDataSteps.checkImportedResource(0, 'jsonld-2.jsonld');
59
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'jsonld-2.jsonld');
60
60
  // When I select Imported from the menu
61
61
  ImportUserDataSteps.selectImportedResources();
62
62
  // Then I should see only imported files selected
@@ -83,7 +83,7 @@ describe('Import user data: Batch operations', () => {
83
83
  ImportUserDataSteps.batchImport();
84
84
  ImportSettingsDialogSteps.import();
85
85
  // Then the file should be imported
86
- ImportUserDataSteps.checkImportedResource(0, 'jsonld-2.jsonld');
86
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'jsonld-2.jsonld');
87
87
  ImportUserDataSteps.selectImportedResources();
88
88
  ImportUserDataSteps.getSelectedResources().should('have.length', 1);
89
89
  ImportUserDataSteps.deselectAllResources();
@@ -94,8 +94,8 @@ describe('Import user data: Batch operations', () => {
94
94
  ImportUserDataSteps.batchImport();
95
95
  ImportSettingsDialogSteps.import();
96
96
  // Then the files should be imported
97
- ImportUserDataSteps.checkImportedResource(1, 'jsonld.jsonld');
98
- ImportUserDataSteps.checkImportedResource(2, 'bnodes.ttl');
97
+ ImportUserDataSteps.checkImportedResourceByIndex(1, 'jsonld.jsonld');
98
+ ImportUserDataSteps.checkImportedResourceByIndex(2, 'bnodes.ttl');
99
99
  ImportUserDataSteps.selectImportedResources();
100
100
  ImportUserDataSteps.getSelectedResources().should('have.length', 3);
101
101
  });
@@ -162,9 +162,9 @@ function uploadWithImportFiles(files) {
162
162
  ImportUserDataSteps.selectFile([file1, file2, file3]);
163
163
  ImportSettingsDialogSteps.import();
164
164
  ImportUserDataSteps.getResources().should('have.length', 3);
165
- ImportUserDataSteps.checkImportedResource(0, 'jsonld-2.jsonld');
166
- ImportUserDataSteps.checkImportedResource(1, 'jsonld.jsonld');
167
- ImportUserDataSteps.checkImportedResource(2, 'bnodes.ttl');
165
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'jsonld-2.jsonld');
166
+ ImportUserDataSteps.checkImportedResourceByIndex(1, 'jsonld.jsonld');
167
+ ImportUserDataSteps.checkImportedResourceByIndex(2, 'bnodes.ttl');
168
168
  }
169
169
 
170
170
  function uploadFiles(data) {
@@ -58,6 +58,6 @@ describe('Import user data: URL import', () => {
58
58
  return xhr.response.body[0]?.status === 'ERROR'
59
59
  }), {timeout: 10000, interval: 1000}
60
60
  )
61
- ImportUserDataSteps.checkImportedResource(0, IMPORT_JSONLD_URL, 'https://example.com/0007-context.jsonld');
61
+ ImportUserDataSteps.checkImportedResourceByIndex(0, IMPORT_JSONLD_URL, 'https://example.com/0007-context.jsonld');
62
62
  });
63
63
  });
@@ -36,7 +36,7 @@ describe('Connectors - Lucene', () => {
36
36
  it('should create Lucene connector.', () => {
37
37
  // When I execute create lucene connector query.
38
38
  YasqeSteps.pasteQuery(LuceneConnectorSteps.getCreateConnectorQuery('my_index'));
39
- YasqeSteps.executeQueryWithoutWaiteResult();
39
+ YasqeSteps.executeQueryWithoutWaitingForResult();
40
40
 
41
41
  // Then I expect Lucene connector to be created.
42
42
  TablePluginSteps.getQueryResultInfo().contains('Created connector my_index');
@@ -42,7 +42,9 @@ describe('Cluster configuration', () => {
42
42
  });
43
43
 
44
44
  ClusterStubs.stubClusterGroupStatusWithTag();
45
+ ClusterStubs.stubClusterConfigWithTag();
45
46
  cy.wait('@3-nodes-cluster-group-status-tag');
47
+ cy.wait('@cluster-config-with-tag');
46
48
  // Assert the tags table contains the expected tag
47
49
  ClusterConfigurationSteps.getTagsTable().should('be.visible');
48
50
  ClusterConfigurationSteps.getTagsTableRows().should('contain.text', tagName);
@@ -62,6 +64,31 @@ describe('Cluster configuration', () => {
62
64
  cy.wait('@delete-tag').then((interception) => {
63
65
  expect(interception.request.body).to.deep.equal({tag: tagName});
64
66
  });
67
+ ClusterStubs.stubClusterGroupStatus();
68
+ ClusterStubs.stubClusterConfig();
69
+ cy.wait('@3-nodes-cluster-group-status');
70
+ cy.wait('@cluster-config');
71
+ ClusterConfigurationSteps.getTagsTable().should('not.exist');
72
+ });
73
+
74
+ it('should show an alert when there is no elected leader in the cluster', () => {
75
+ // Given there is no elected leader in the cluster
76
+ ClusterStubs.stubClusterGroupStatusWithoutLeader();
77
+
78
+ // When I have opened the cluster management page
79
+ ClusterPageSteps.visit();
80
+ // And I click on edit properties and open Multi-region tab
81
+ ClusterPageSteps.previewClusterConfig();
82
+ ClusterConfigurationSteps.selectMultiRegionConfigTab();
83
+
84
+ // Then I expect to see an alert that the leader is not elected
85
+ ClusterConfigurationSteps.getNoLeaderAlert().should('be.visible')
86
+ .and('contain.text', 'Leader is not elected');
87
+ // And no primary or secondary cluster configuration should be rendered
88
+ ClusterConfigurationSteps.getMultiRegionHeader().should('not.exist');
89
+ ClusterConfigurationSteps.getAddTagButton().should('not.exist');
90
+ ClusterConfigurationSteps.getEnableSecondaryModeButton().should('not.exist');
91
+ ClusterConfigurationSteps.getTagsTable().should('not.exist');
65
92
  });
66
93
 
67
94
  it('should be able to switch modes', () => {
@@ -460,7 +460,7 @@ describe('Cluster management', () => {
460
460
  "verificationTimeout": 1500,
461
461
  "transactionLogMaximumSizeGB": 50.0,
462
462
  "batchUpdateInterval": 5000,
463
- "nodes": ['http://pc-desktop:7200', 'http://pc-desktop:7203']
463
+ "nodes": ['http://pc-desktop:7200', 'http://pc-desktop:7203'],
464
464
  });
465
465
  });
466
466
  // And expect success message to be displayed.
@@ -18,7 +18,7 @@ describe('Graphs overview screen validation', () => {
18
18
  cy.window();
19
19
 
20
20
  cy.fixture('graph/rdf.txt').then((rdf) => {
21
- return new Cypress.Promise((resolve, reject) => {
21
+ return new Cypress.Promise((resolve) => {
22
22
  cy.importRDFTextSnippet(repositoryId, rdf, {format: "application/x-trig"});
23
23
  resolve();
24
24
  });
@@ -76,6 +76,7 @@ describe('Graphs overview screen validation', () => {
76
76
  it('Should switch pages', () => {
77
77
  // Makes this less flaky - is it possible the page elements don't have an event attached
78
78
  // yet when this fails? It looks like the click has never happened
79
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
79
80
  cy.wait(100);
80
81
 
81
82
  // Switch through pages and verify that the respective pager button is active.
@@ -111,6 +112,33 @@ describe('Graphs overview screen validation', () => {
111
112
  verifyGraphExistence('urn:11', false);
112
113
  });
113
114
 
115
+ it('Should give the controls on the page accessible names', () => {
116
+ // Then the search field should have a screen reader label and a placeholder
117
+ GraphsOverviewSteps.getGraphsSearchLabel()
118
+ .should('have.class', 'screen-reader-only')
119
+ .and('contain.text', 'Search Graphs');
120
+ GraphsOverviewSteps.getGraphsSearchInput()
121
+ .should('have.attr', 'id', 'search-graphs')
122
+ .and('have.attr', 'placeholder', 'Search Graphs');
123
+ // And the table and the header controls should have accessible names
124
+ GraphsOverviewSteps.getResultsElement().should('have.attr', 'aria-label', 'Graphs')
125
+ .and('not.have.attr', 'aria-describedby');
126
+ GraphsOverviewSteps.getSelectAllGraphsCheckbox().should('have.attr', 'aria-label', 'Select all graphs');
127
+ GraphsOverviewSteps.getExportSelectedGraphsButton().should('have.attr', 'aria-label', 'Export selected graphs');
128
+ GraphsOverviewSteps.getDeleteSelectedGraphsButton().should('have.attr', 'aria-label', 'Removes all data from the selected graphs');
129
+ GraphsOverviewSteps.getActionsColumnHeader().should('contain.text', 'Actions');
130
+ // And no empty label should wrap the checkbox
131
+ GraphsOverviewSteps.getResultsHeader().find('label').should('not.exist');
132
+ // And the controls in each row should include the graph name
133
+ GraphsOverviewSteps.getSelectGraphCheckbox('urn:9').should('have.attr', 'aria-label', 'Select graph urn:9');
134
+ GraphsOverviewSteps.getExportGraphButton('urn:9').should('have.attr', 'aria-label', 'Export graph urn:9');
135
+ GraphsOverviewSteps.getDeleteGraphButton('urn:9').should('have.attr', 'aria-label', 'Remove all data from graph urn:9');
136
+ GraphsOverviewSteps.getGraphRow('urn:9').find('label').should('not.exist');
137
+ // And the default graph row should use the translated graph name
138
+ GraphsOverviewSteps.getDefaultGraphRow().find('.select-graph-checkbox')
139
+ .should('have.attr', 'aria-label', 'Select graph The default graph');
140
+ });
141
+
114
142
  it('Delete graph', () => {
115
143
  let graphToDelete = 'urn:9';
116
144
  cy.get(`${EXPORT_GRAPHS_TABLE_ID} tbody a[title="${graphToDelete}"]`)
@@ -125,7 +153,8 @@ describe('Graphs overview screen validation', () => {
125
153
  verifyVisibleGraphsCount(1);
126
154
  verifyGraphExistence('The default graph');
127
155
  // open default graph through the link and verify that the table view is rendered
128
- cy.getByTestId('graph-is-not-shaql').contains('The default graph').trigger('mouseover').click();
156
+ cy.getByTestId('graph-is-not-shaql').contains('The default graph').trigger('mouseover');
157
+ cy.getByTestId('graph-is-not-shaql').contains('The default graph').click();
129
158
  cy.url().should('contain', Cypress.config('baseUrl') + '/resource');
130
159
  YasrSteps.getResultTableHeader().should('be.visible');
131
160
  YasrSteps.getResultTableHeaderColumns().should('have.length', 5);
@@ -8,6 +8,19 @@ import HomeSteps from '../../../steps/home-steps.js';
8
8
  const FILE_TO_IMPORT = 'wine.rdf';
9
9
  const VALID_RESOURCE = 'USRegion';
10
10
 
11
+ /**
12
+ * Updates the links limit and waits for the graph reload it triggers to complete.
13
+ *
14
+ * @param {string} value the new links limit
15
+ */
16
+ function updateLinksLimit(value) {
17
+ VisualGraphSteps.updateLinksLimitField(value);
18
+ VisualGraphSteps.getLinksNumberField().should('have.value', value);
19
+ VisualGraphSteps.getUrl().should('match', new RegExp(`[?&]linksLimit=${value}(&|$)`));
20
+ VisualGraphSteps.getGraphVisualizationPane().should('be.visible');
21
+ VisualGraphSteps.getNodes();
22
+ }
23
+
11
24
  describe('Visual graph screen validation', () => {
12
25
 
13
26
  let repositoryId;
@@ -311,6 +324,20 @@ describe('Visual graph screen validation', () => {
311
324
  VisualGraphSteps.getPredicates().should('have.length', 36);
312
325
  });
313
326
 
327
+ it('Should close the settings panel when navigating away from the graph', () => {
328
+ // Given I have opened a graph
329
+ VisualGraphSteps.openUSRegionUri();
330
+ // And I have opened the visual graph settings
331
+ VisualGraphSteps.openVisualGraphSettings();
332
+ VisualGraphSteps.getSettingsPanel().should('be.visible');
333
+
334
+ // When I click the visual graph submenu
335
+ MainMenuSteps.clickOnSubmenuVisualGraph();
336
+
337
+ // Then I expect the settings panel to be closed
338
+ VisualGraphSteps.getSettingsPanel().should('not.exist');
339
+ });
340
+
314
341
  it('Test include inferred Statements', () => {
315
342
  VisualGraphSteps.openUSRegionUri();
316
343
  // Check include inferred
@@ -361,9 +388,11 @@ describe('Visual graph screen validation', () => {
361
388
  // Pick a type that is displayed in the diagram for example "vin:Zinfandel"
362
389
  VisualGraphSteps.getNodes().and('contain', 'Zinfandel');
363
390
 
391
+ // Set the connections limit to 10 and wait for the graph reload it triggers,
392
+ // so that the settings are opened after the navigation has completed
393
+ updateLinksLimit('10');
394
+
364
395
  VisualGraphSteps.openVisualGraphSettings();
365
- // Set the connections limit to 10
366
- VisualGraphSteps.updateLinksLimitField('10');
367
396
  // Go to Settings and set "vin:Zinfandel" as an ignored type
368
397
  VisualGraphSteps.getIgnoredTypesField().clear().type('vin:Zinfandel').type('{enter}');
369
398
 
@@ -395,12 +424,14 @@ describe('Visual graph screen validation', () => {
395
424
  // Pick a type that is displayed in the diagram for example "vin:Zinfandel"
396
425
  VisualGraphSteps.getPredicates().should('contain', 'hasSugar');
397
426
 
427
+ // Set the connections limit to 10 and wait for the graph reload it triggers,
428
+ // so that the settings are opened after the navigation has completed
429
+ updateLinksLimit('10');
430
+
398
431
  VisualGraphSteps.openVisualGraphSettings();
399
432
  // Go to predicates tab
400
433
  VisualGraphSteps.openPredicatesTab();
401
434
 
402
- // Set the connections limit to 10
403
- VisualGraphSteps.updateLinksLimitField('10');
404
435
  // Set "vin:hasSugar" as an ignored predicate
405
436
  VisualGraphSteps.getIgnoredPredicatesField().clear().type('vin:hasSugar').type('{enter}');
406
437
 
@@ -0,0 +1,216 @@
1
+ import {GraphNavigatorSteps} from '../../steps/graph-navigator-steps.js';
2
+ import {PageRestrictionsSteps} from '../../steps/page-restrictions-steps.js';
3
+ import {RepositoryPickerListSteps} from '../../steps/repository-picker-list-steps.js';
4
+ import {LicenseStubs} from '../../stubs/license-stubs.js';
5
+ import {RepositorySteps} from '../../steps/repository-steps.js';
6
+
7
+ const NO_REPOSITORY_MESSAGE = 'you are not connected to any repository';
8
+ const INVALID_LICENSE_MESSAGE = 'your license is not valid';
9
+ const SELECT_OR_CREATE_REPOSITORY_MESSAGE = 'Select a repository below or create a new one.';
10
+ const SELECT_REPOSITORY_MESSAGE = 'Select a repository below.';
11
+ // TODO: Remove once GraphDB creates the system repository itself.
12
+ // The graph-navigator settings endpoint requires this repository.
13
+ const SYSTEM_REPOSITORY_ID = 'SystemRepository';
14
+
15
+ describe('Graph Navigator view restrictions', () => {
16
+ let repositoryId;
17
+
18
+ // TODO: Remove once GraphDB creates the system repository itself.
19
+ before(() => {
20
+ cy.deleteRepository(SYSTEM_REPOSITORY_ID);
21
+ cy.createRepository({id: SYSTEM_REPOSITORY_ID});
22
+ });
23
+
24
+ // TODO: Remove once GraphDB creates the system repository itself.
25
+ after(() => {
26
+ cy.deleteRepository(SYSTEM_REPOSITORY_ID);
27
+ });
28
+
29
+ beforeEach(() => {
30
+ repositoryId = 'graph-navigator-view-restrictions-' + Date.now();
31
+ cy.createRepository({id: repositoryId});
32
+ });
33
+
34
+ afterEach(() => {
35
+ cy.deleteRepository(repositoryId);
36
+ });
37
+
38
+ it('should show the repository picker when no repository is selected', () => {
39
+ // GIVEN no repository is selected
40
+
41
+ // WHEN I open the Graph Navigator view
42
+ GraphNavigatorSteps.visit();
43
+ // THEN I expect the repository restriction is shown
44
+ PageRestrictionsSteps.getMessages().should('have.length', 1);
45
+ PageRestrictionsSteps.getMessage(NO_REPOSITORY_MESSAGE).should('be.visible');
46
+ // AND the existing repository is available in the picker
47
+ RepositoryPickerListSteps.getRepositoryRow(repositoryId).should('be.visible');
48
+ // AND its location is not shown, because only the local repositories are listed
49
+ RepositoryPickerListSteps.getRepositoryLocation(repositoryId).should('not.exist');
50
+ // AND the graph is not rendered
51
+ GraphNavigatorSteps.getComponent().should('not.exist');
52
+ });
53
+
54
+ it('should render the graph when a repository is selected from the picker', () => {
55
+ // GIVEN the Graph Navigator view is open with no repository selected
56
+ GraphNavigatorSteps.visit();
57
+
58
+ // WHEN I select a repository
59
+ RepositoryPickerListSteps.selectRepository(repositoryId);
60
+ // THEN I expect the restriction is removed and the graph is rendered
61
+ PageRestrictionsSteps.getRestrictions().should('not.exist');
62
+ GraphNavigatorSteps.getWorkspace().should('exist');
63
+ });
64
+
65
+ it('should not restrict the view when the license is valid and a repository is selected', () => {
66
+ // GIVEN a valid license and a selected repository
67
+ cy.presetRepository(repositoryId);
68
+
69
+ // WHEN I open the Graph Navigator view
70
+ GraphNavigatorSteps.visit();
71
+ // THEN I expect the view is not restricted
72
+ GraphNavigatorSteps.getWorkspace().should('exist');
73
+ PageRestrictionsSteps.getRestrictions().should('not.exist');
74
+ });
75
+
76
+ context('when the license is invalid', () => {
77
+ beforeEach(() => {
78
+ LicenseStubs.stubNoValidLicense();
79
+ });
80
+
81
+ it('should show the license restriction when a repository is selected', () => {
82
+ // GIVEN an invalid license and a selected repository
83
+ cy.presetRepository(repositoryId);
84
+
85
+ // WHEN I open the Graph Navigator view
86
+ GraphNavigatorSteps.visit();
87
+ // THEN I expect the license restriction is shown
88
+ PageRestrictionsSteps.getMessages().should('have.length', 1);
89
+ PageRestrictionsSteps.getMessage(INVALID_LICENSE_MESSAGE).should('be.visible');
90
+ // AND the "Set a new license" link is displayed
91
+ PageRestrictionsSteps.getInternalLink()
92
+ .should('contain.text', 'Set a new license')
93
+ .and('have.attr', 'href')
94
+ .and('include', '/license');
95
+ // AND the repository picker and graph are not rendered
96
+ RepositoryPickerListSteps.getRepositoryPickerList().should('not.exist');
97
+ GraphNavigatorSteps.getComponent().should('not.exist');
98
+ });
99
+
100
+ it('should show both restrictions when no repository is selected', () => {
101
+ // GIVEN an invalid license and no repository selected
102
+
103
+ // WHEN I open the Graph Navigator view
104
+ GraphNavigatorSteps.visit();
105
+ // THEN both restrictions are shown
106
+ PageRestrictionsSteps.getMessages().should('have.length', 2);
107
+ PageRestrictionsSteps.getMessage(INVALID_LICENSE_MESSAGE).should('be.visible');
108
+ PageRestrictionsSteps.getMessage(NO_REPOSITORY_MESSAGE)
109
+ .should('be.visible')
110
+ .and('not.contain.text', 'create a new one');
111
+ // AND the existing repository is available, but repository creation is not
112
+ RepositoryPickerListSteps.getRepositoryRow(repositoryId).should('be.visible');
113
+ RepositoryPickerListSteps.getCreateRepositoryButton().should('not.exist');
114
+ // AND the graph is not rendered
115
+ GraphNavigatorSteps.getComponent().should('not.exist');
116
+ });
117
+ });
118
+
119
+ context('with security enabled', () => {
120
+ const readOnlyUser = 'graph-navigator-reader-' + Date.now();
121
+ const repoManagerUser = 'graph-navigator-repo-manager-' + Date.now();
122
+ const repoMaintainerUser = 'graph-navigator-repo-maintainer-' + Date.now();
123
+ const password = 'root';
124
+
125
+ beforeEach(() => {
126
+ cy.createUser({
127
+ username: readOnlyUser,
128
+ password,
129
+ grantedAuthorities: ['ROLE_USER', `READ_REPO_${repositoryId}`]
130
+ });
131
+ cy.createUser({
132
+ username: repoManagerUser,
133
+ password,
134
+ grantedAuthorities: ['ROLE_USER', 'ROLE_REPO_MANAGER']
135
+ });
136
+ cy.createUser({
137
+ username: repoMaintainerUser,
138
+ password,
139
+ grantedAuthorities: [
140
+ 'ROLE_USER',
141
+ `READ_REPO_${repositoryId}`,
142
+ `WRITE_REPO_${repositoryId}`,
143
+ `MAINTAIN_REPO_${repositoryId}`
144
+ ]
145
+ });
146
+ cy.switchOnSecurity();
147
+ });
148
+
149
+ afterEach(() => {
150
+ cy.loginAsAdmin().then(() => {
151
+ cy.deleteUser(readOnlyUser, true);
152
+ cy.deleteUser(repoManagerUser, true);
153
+ cy.deleteUser(repoMaintainerUser, true);
154
+ cy.switchOffSecurity(true);
155
+ });
156
+ });
157
+
158
+ it('should not restrict the view for a user without write permission', () => {
159
+ // GIVEN a user with read-only access to the selected repository
160
+ cy.loginAs(readOnlyUser, password);
161
+ cy.presetRepository(repositoryId);
162
+
163
+ // WHEN I open the Graph Navigator view
164
+ GraphNavigatorSteps.visit();
165
+ // THEN I expect the view is not restricted
166
+ GraphNavigatorSteps.getWorkspace().should('exist');
167
+ PageRestrictionsSteps.getRestrictions().should('not.exist');
168
+ });
169
+
170
+ it('should offer repository creation to the administrator', () => {
171
+ // GIVEN the administrator is logged in with no repository selected
172
+ cy.loginAs('admin', password);
173
+
174
+ // WHEN I open the Graph Navigator view
175
+ GraphNavigatorSteps.visit();
176
+ // THEN I expect the option to select or create a repository is displayed
177
+ PageRestrictionsSteps.getMessage(SELECT_OR_CREATE_REPOSITORY_MESSAGE).should('be.visible');
178
+ RepositoryPickerListSteps.getRepositoryRow(repositoryId).should('be.visible');
179
+ RepositoryPickerListSteps.getCreateRepositoryButton().should('be.visible');
180
+ });
181
+
182
+ it('should offer repository creation to a repository manager', () => {
183
+ // GIVEN a repository manager is logged in with no repository selected
184
+ cy.loginAs(repoManagerUser, password);
185
+
186
+ // WHEN I open the Graph Navigator view
187
+ GraphNavigatorSteps.visit();
188
+ // THEN the option to select or create a repository is displayed
189
+ PageRestrictionsSteps.getMessage(SELECT_OR_CREATE_REPOSITORY_MESSAGE).should('be.visible');
190
+ RepositoryPickerListSteps.getRepositoryRow(repositoryId).should('be.visible');
191
+
192
+ // WHEN I click the create repository button
193
+ RepositoryPickerListSteps.clickCreateRepositoryButton();
194
+ // THEN the create repository view is opened
195
+ RepositorySteps.verifyRepositoryCreateViewUrl().and('include', 'previous=%2Fgraph-navigator');
196
+ });
197
+
198
+ [
199
+ {role: 'a read-only user', username: readOnlyUser},
200
+ {role: 'a repository maintainer', username: repoMaintainerUser},
201
+ ].forEach(({role, username}) => {
202
+ it(`should not offer repository creation to ${role}`, () => {
203
+ // GIVEN a user without repository management rights is logged in with no repository selected
204
+ cy.loginAs(username, password);
205
+
206
+ // WHEN I open the Graph Navigator view
207
+ GraphNavigatorSteps.visit();
208
+ // THEN only the option to select a repository is displayed
209
+ PageRestrictionsSteps.getMessage(SELECT_REPOSITORY_MESSAGE).should('be.visible');
210
+ PageRestrictionsSteps.getMessages().should('not.contain.text', 'create a new one');
211
+ RepositoryPickerListSteps.getRepositoryRow(repositoryId).should('be.visible');
212
+ RepositoryPickerListSteps.getCreateRepositoryButton().should('not.exist');
213
+ });
214
+ });
215
+ });
216
+ });