graphdb-workbench-tests 2.8.4 → 3.0.0-NEW-JENKINS-1

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 (76) hide show
  1. package/fixtures/graph/rdf.txt +130 -0
  2. package/fixtures/graphdb-import/ontology-and-shapes.ttl +562 -0
  3. package/fixtures/graphdb-import/swapi-dataset.ttl +4393 -0
  4. package/fixtures/graphql/endpoints/graphql-endpoints-info.json +49 -0
  5. package/fixtures/graphql/endpoints/no-graphql-endpoints-info.json +3 -0
  6. package/fixtures/graphql/soml/big-swapi-schema-broken.yaml +83167 -0
  7. package/fixtures/graphql/soml/swapi-schema-broken.yaml +880 -0
  8. package/fixtures/graphql/soml/swapi-schema-broken.zip +0 -0
  9. package/fixtures/graphql/soml/swapi-schema-film-restricted.yaml +335 -0
  10. package/fixtures/graphql/soml/swapi-schema-planets.yaml +51 -0
  11. package/fixtures/graphql/soml/swapi-schema-species.yaml +66 -0
  12. package/fixtures/graphql/soml/swapi-schema.yaml +857 -0
  13. package/fixtures/graphql/soml/swapi-schemas.zip +0 -0
  14. package/fixtures/locale-en.json +666 -37
  15. package/fixtures/ttyg/agent/get-agent-list-autocomplete-query.json +23 -0
  16. package/fixtures/ttyg/autocomplete-response.json +154 -0
  17. package/integration/explore/class.hierarchy.spec.js +131 -184
  18. package/integration/explore/graphs.overview.spec.js +18 -10
  19. package/integration/explore/visual-graph/graphs-config.spec.js +17 -1
  20. package/integration/explore/visual-graph/visual-graph-node-labels.spec.js +68 -0
  21. package/integration/graphql/activate-deactivate-graphql-endpoint.spec.js +40 -0
  22. package/integration/graphql/create-graphql-endpoint.spec.js +281 -0
  23. package/integration/graphql/delete-graphql-endpoint.spec.js +46 -0
  24. package/integration/graphql/edit-graphql-enpoint.spec.js +160 -0
  25. package/integration/graphql/export-graphql-endpoint-definition.spec.js +35 -0
  26. package/integration/graphql/filter-graphql-endpoints-on-management-view.spec.js +66 -0
  27. package/integration/graphql/graphql-endpoint-management-view.spec.js +142 -0
  28. package/integration/graphql/graphql-playground.spec.js +110 -0
  29. package/integration/graphql/import-graphql-endpoint-definitions.spec.js +269 -0
  30. package/integration/graphql/set-default-graphql-endpoint.spec.js +42 -0
  31. package/integration/import/import-server-files-batch-operations.spec.js +4 -3
  32. package/integration/import/import-server-files.spec.js +29 -7
  33. package/integration/import/import-user-data-url.spec.js +33 -0
  34. package/integration/import/import-view.spec.js +2 -1
  35. package/integration/repository/repositories.spec.js +9 -4
  36. package/integration/setup/user-and-access.spec.js +695 -117
  37. package/integration/sparql-editor/actions/show-saved-queries.spec.js +1 -1
  38. package/integration/sparql-editor/saved-query/readonly-query.spec.js +66 -0
  39. package/integration/ttyg/edit-agent.spec.js +45 -0
  40. package/integration-flaky/setup/users-and-access/security-and-free-access.spec.js +54 -0
  41. package/{integration → integration-flaky}/ttyg/ttyg-permission.spec.js +4 -3
  42. package/npm-shrinkwrap.json +931 -305
  43. package/package.json +3 -3
  44. package/steps/class-views-steps.js +139 -0
  45. package/steps/explore/graphs-overview-steps.js +12 -0
  46. package/steps/graphql/create-graphql-endpoint-steps.js +277 -0
  47. package/steps/graphql/edit-graphql-endpoint-steps.js +124 -0
  48. package/steps/graphql/generation-report-modal-steps.js +34 -0
  49. package/steps/graphql/graphiql-editor-tools-steps.js +10 -0
  50. package/steps/graphql/graphiql-playground-steps.js +6 -0
  51. package/steps/graphql/graphql-endpoint-management-steps.js +147 -0
  52. package/steps/graphql/graphql-playground-steps.js +90 -0
  53. package/steps/graphql/import-endpoint-definition-modal-steps.js +80 -0
  54. package/steps/home-steps.js +1 -1
  55. package/steps/import/import-settings-dialog-steps.js +12 -0
  56. package/steps/import/import-steps.js +9 -4
  57. package/steps/import/import-test-constants.js +1 -0
  58. package/steps/import/import-user-data-steps.js +8 -0
  59. package/steps/login-steps.js +20 -0
  60. package/steps/modal-dialog-steps.js +8 -0
  61. package/steps/repository-steps.js +4 -0
  62. package/steps/setup/user-and-access-steps.js +165 -11
  63. package/steps/ttyg/ttyg-agent-settings-modal.steps.js +44 -0
  64. package/steps/visual-graph-steps.js +14 -0
  65. package/steps/yasgui/saved-queries-dialog.js +19 -3
  66. package/stubs/global-operations-statuses-stub.js +2 -2
  67. package/stubs/graphql/graphql-stubs.js +146 -0
  68. package/stubs/repositories/repositories-stubs.js +4 -0
  69. package/stubs/ttyg/ttyg-stubs.js +7 -0
  70. package/stubs/yasgui/query-stubs.js +2 -2
  71. package/support/import-commands.js +28 -0
  72. package/support/repository-commands.js +10 -3
  73. package/support/security-command.js +49 -8
  74. package/support/user-commands.js +10 -2
  75. package/utils/html-util.js +21 -0
  76. /package/fixtures/{graphql-editor → queries}/default-query-response.json +0 -0
@@ -0,0 +1,42 @@
1
+ import {GraphqlEndpointManagementSteps} from "../../steps/graphql/graphql-endpoint-management-steps";
2
+ import {ApplicationSteps} from "../../steps/application-steps";
3
+ import {GraphqlPlaygroundSteps} from "../../steps/graphql/graphql-playground-steps";
4
+
5
+ describe('Graphql: set default endpoint', () => {
6
+ let repositoryId;
7
+
8
+ beforeEach(() => {
9
+ repositoryId = 'graphql-endpoint-management-' + Date.now();
10
+ cy.createRepository({id: repositoryId});
11
+ cy.presetRepository(repositoryId);
12
+ cy.importServerFile(repositoryId, 'swapi-dataset.ttl');
13
+ cy.uploadGraphqlSchema(repositoryId, 'graphql/soml/swapi-schema.yaml', 'swapi');
14
+ cy.uploadGraphqlSchema(repositoryId, 'graphql/soml/swapi-schema-film-restricted.yaml', 'swapi');
15
+ });
16
+
17
+ afterEach(() => {
18
+ cy.deleteRepository(repositoryId);
19
+ });
20
+
21
+ it('should be able to change the default endpoint', () => {
22
+ // Given I have a repository with active GraphQL endpoint
23
+ // And I have visited the endpoint management view
24
+ GraphqlEndpointManagementSteps.visit();
25
+ GraphqlEndpointManagementSteps.getView().should('be.visible');
26
+ GraphqlEndpointManagementSteps.getEndpointsInfo().should('have.length', 2);
27
+ // And there is a default endpoint
28
+ GraphqlEndpointManagementSteps.getEndpointDefaultStatusRadio(0).should('be.checked');
29
+ // When I click on the second endpoint to set it as default
30
+ GraphqlEndpointManagementSteps.setEndpointAsDefault(1);
31
+ // Then I should see a success toast
32
+ ApplicationSteps.getSuccessNotifications().should('be.visible');
33
+ // And the default endpoint should be changed
34
+ GraphqlEndpointManagementSteps.getEndpointDefaultStatusRadio(1).should('be.checked');
35
+ GraphqlEndpointManagementSteps.getEndpointDefaultStatusRadio(0).should('not.be.checked');
36
+ // When I open the GraphQL Playground
37
+ GraphqlEndpointManagementSteps.exploreEndpoint(1);
38
+ // Then the default endpoint should be selected by default in the playground
39
+ GraphqlPlaygroundSteps.getView().should('be.visible');
40
+ GraphqlPlaygroundSteps.getSelectedEndpoint().should('contain', 'film-restricted');
41
+ });
42
+ });
@@ -1,5 +1,6 @@
1
1
  import {ImportServerFilesSteps} from "../../steps/import/import-server-files-steps";
2
2
  import {ImportSettingsDialogSteps} from "../../steps/import/import-settings-dialog-steps";
3
+ import {SERVER_FILES_COUNT} from "../../steps/import/import-test-constants";
3
4
 
4
5
  describe('Import server files - Batch operations', () => {
5
6
 
@@ -11,7 +12,7 @@ describe('Import server files - Batch operations', () => {
11
12
  repositoryId = 'server-import-' + Date.now();
12
13
  cy.createRepository({id: repositoryId});
13
14
  ImportServerFilesSteps.visitServerImport(repositoryId);
14
- ImportServerFilesSteps.getResources().should('have.length', 18);
15
+ ImportServerFilesSteps.getResources().should('have.length', SERVER_FILES_COUNT);
15
16
  });
16
17
 
17
18
  afterEach(() => {
@@ -48,7 +49,7 @@ describe('Import server files - Batch operations', () => {
48
49
  // When I select All files from the menu
49
50
  ImportServerFilesSteps.selectAllResources();
50
51
  // Then I should see all files selected
51
- ImportServerFilesSteps.getSelectedResources().should('have.length', 18);
52
+ ImportServerFilesSteps.getSelectedResources().should('have.length', SERVER_FILES_COUNT);
52
53
  // When I select None from the menu
53
54
  ImportServerFilesSteps.deselectAllResources();
54
55
  // Then I should see no files selected
@@ -65,7 +66,7 @@ describe('Import server files - Batch operations', () => {
65
66
  // When I select Not Imported from the menu
66
67
  ImportServerFilesSteps.selectNotImportedResources();
67
68
  // Then I should see only not imported files selected
68
- ImportServerFilesSteps.getSelectedResources().should('have.length', 17);
69
+ ImportServerFilesSteps.getSelectedResources().should('have.length', SERVER_FILES_COUNT - 1);
69
70
  // Deselect all for the next step
70
71
  ImportServerFilesSteps.deselectAllResources();
71
72
  ImportServerFilesSteps.getSelectedResources().should('have.length', 0);
@@ -2,7 +2,7 @@ import {ImportUserDataSteps} from "../../steps/import/import-user-data-steps";
2
2
  import {ImportServerFilesSteps} from "../../steps/import/import-server-files-steps";
3
3
  import {ImportSettingsDialogSteps} from "../../steps/import/import-settings-dialog-steps";
4
4
  import {ImportResourceMessageDialog} from "../../steps/import/import-resource-message-dialog";
5
- import {ApplicationSteps} from "../../steps/application-steps";
5
+ import {SERVER_FILES_COUNT} from "../../steps/import/import-test-constants";
6
6
 
7
7
  describe('Import server files', () => {
8
8
 
@@ -14,7 +14,7 @@ describe('Import server files', () => {
14
14
  repositoryId = 'server-import-' + Date.now();
15
15
  cy.createRepository({id: repositoryId});
16
16
  ImportServerFilesSteps.visitServerImport(repositoryId);
17
- ImportServerFilesSteps.getResources().should('have.length', 18);
17
+ ImportServerFilesSteps.getResources().should('have.length', SERVER_FILES_COUNT);
18
18
  });
19
19
 
20
20
  afterEach(() => {
@@ -66,7 +66,7 @@ describe('Import server files', () => {
66
66
  // When the server files tab is loaded
67
67
  // Then I should see all the files and folders by default
68
68
  ImportServerFilesSteps.getShowAllResourceTypesButton().should('have.class', 'active');
69
- ImportServerFilesSteps.getResources().should('have.length', 18);
69
+ ImportServerFilesSteps.getResources().should('have.length', SERVER_FILES_COUNT);
70
70
  // When I select the folders only filter
71
71
  ImportServerFilesSteps.selectFoldersOnlyFilter();
72
72
  // Then I should see only the folders
@@ -75,7 +75,7 @@ describe('Import server files', () => {
75
75
  // When I select the files only filter
76
76
  ImportServerFilesSteps.selectFilesOnlyFilter();
77
77
  // Then I should see only the files
78
- ImportServerFilesSteps.getResources().should('have.length', 16);
78
+ ImportServerFilesSteps.getResources().should('have.length', SERVER_FILES_COUNT - 2);
79
79
  });
80
80
 
81
81
  it('should be able to import the whole directory', () => {
@@ -180,8 +180,30 @@ describe('Import server files', () => {
180
180
  ImportServerFilesSteps.getResource(5).should('contain', "rdfxml.rdf");
181
181
  ImportServerFilesSteps.getResource(6).should('contain', "jsonld-file.jsonld");
182
182
  // checks files in root
183
- ImportServerFilesSteps.getResource(15).should('contain', "0007-import-file.jsonld");
184
- ImportServerFilesSteps.getResource(16).should('contain', "test_turtlestar.ttls");
185
- ImportServerFilesSteps.getResource(17).should('contain', "bnodes.ttl");
183
+ ImportServerFilesSteps.getResource(17).should('contain', "0007-import-file.jsonld");
184
+ ImportServerFilesSteps.getResource(18).should('contain', "test_turtlestar.ttls");
185
+ ImportServerFilesSteps.getResource(19).should('contain', "bnodes.ttl");
186
+ });
187
+
188
+ it('should allow importing jsonld with empty "JSON-LD Context"', () => {
189
+ // Given: The server files tab is loaded
190
+
191
+ // When: I open the import dialog for a file with JSON-LD content,
192
+ ImportServerFilesSteps.importResourceByName('import-resource-with-correct-data.jsonld');
193
+ // Then: I expect the import button be enabled, because the "JSON-LD Context" is not mandatory field.
194
+ ImportSettingsDialogSteps.getImportButton().should('be.enabled');
195
+
196
+ // When: I enter an invalid field.
197
+ ImportSettingsDialogSteps.getJSONLDContextInput().type('invalid context URL')
198
+ // Then I expect
199
+ // the import button be disabled because JSON-LD context URL is not valid
200
+ ImportSettingsDialogSteps.getImportButton().should('be.disabled');
201
+ // and an error message is displayed
202
+ ImportSettingsDialogSteps.getError().contains('Not a valid IRI!');
203
+
204
+ // When: I clear the URI
205
+ ImportSettingsDialogSteps.getJSONLDContextInput().clear().blur();
206
+ // Then: I expect the import button be enabled, because the "JSON-LD Context" is not mandatory field.
207
+ ImportSettingsDialogSteps.getImportButton().should('be.enabled');
186
208
  });
187
209
  });
@@ -21,6 +21,39 @@ describe('Import user data: URL import', () => {
21
21
  cy.deleteRepository(repositoryId);
22
22
  });
23
23
 
24
+ it('should not allow import if the URL is not valid or empty', () => {
25
+ // Given: I have opened the "Import" view.
26
+
27
+ // When: I open the import menu
28
+ ImportUserDataSteps.openImportURLDialog();
29
+ // Then: I expect the import button to be disabled because the URL is a mandatory field.
30
+ ImportUserDataSteps.getImportUrlButton().should('be.disabled');
31
+
32
+ // When: I type an invalid URL
33
+ ImportUserDataSteps.getImportUrlInput().type('invalid url');
34
+ // Then: I expect
35
+ // an error message to be displayed,
36
+ ImportUserDataSteps.getError().contains('Not valid url!');
37
+ // and the import button to remain disabled because the URL is not valid.
38
+ ImportUserDataSteps.getImportUrlButton().should('be.disabled');
39
+
40
+ // When: I clear the URL
41
+ ImportUserDataSteps.getImportUrlInput().clear().blur();
42
+ // Then: I expect an error message to be displayed
43
+ ImportUserDataSteps.getError().contains('This field is required');
44
+ // and the import button to remain disabled because the URL is a mandatory field.
45
+ ImportUserDataSteps.getImportUrlButton().should('be.disabled');
46
+
47
+ // When: I type a valid URL
48
+ ImportUserDataSteps.getImportUrlInput().type(IMPORT_URL);
49
+ // Then: I expect
50
+ // no errors to be displayed,
51
+ ImportUserDataSteps.getErrors().should('have.length', 0);
52
+ // and the import button to be enabled because the URL is valid.
53
+ ImportUserDataSteps.getImportUrlButton().should('be.enabled');
54
+ });
55
+
56
+
24
57
  it('Test import file via URL successfully with Auto format selected', () => {
25
58
  ImportUserDataSteps.openImportURLDialog(IMPORT_URL);
26
59
  ImportUserDataSteps.clickImportUrlButton();
@@ -3,6 +3,7 @@ import {ImportUserDataSteps} from "../../steps/import/import-user-data-steps";
3
3
  import {ImportServerFilesSteps} from "../../steps/import/import-server-files-steps";
4
4
  import ImportSteps from "../../steps/import/import-steps";
5
5
  import HomeSteps from "../../steps/home-steps";
6
+ import {SERVER_FILES_COUNT} from "../../steps/import/import-test-constants";
6
7
 
7
8
  const bnodes = `_:node0 <http://purl.org/dc/elements/1.1/title> "A new book" ;
8
9
  \t<http://purl.org/dc/elements/1.1/creator> "A.N.Other" .`;
@@ -39,7 +40,7 @@ describe('Import view', () => {
39
40
  // When I switch to the server files tab
40
41
  ImportUserDataSteps.openServerFilesTab();
41
42
  // Then I should see the server files only
42
- ImportServerFilesSteps.getResources().should('have.length', 18);
43
+ ImportServerFilesSteps.getResources().should('have.length', SERVER_FILES_COUNT);
43
44
  // When I switch back to the user data tab
44
45
  ImportServerFilesSteps.openUserDataTab();
45
46
  // Then I should see the uploaded file
@@ -87,6 +87,10 @@ describe('Repositories', () => {
87
87
  .type(repositoryId)
88
88
  .should('have.value', repositoryId);
89
89
 
90
+ RepositorySteps.getEntityIndexSize()
91
+ .should('be.visible')
92
+ .and('have.value', 10000000);
93
+
90
94
  RepositorySteps.saveRepository();
91
95
 
92
96
  // Verify we are back at the setup page after saving
@@ -329,6 +333,7 @@ describe('Repositories', () => {
329
333
  // Some fields should be disabled
330
334
  RepositorySteps.getRepositoryRulesetMenu().should('be.disabled');
331
335
  RepositorySteps.getRepositoryDisableSameAsCheckbox().should('be.disabled');
336
+ RepositorySteps.getEntityIndexSize().should('be.disabled');
332
337
 
333
338
  RepositorySteps.typeRepositoryTitle(newTitle);
334
339
  RepositorySteps.getRepositoryContextIndexCheckbox().check();
@@ -476,7 +481,7 @@ describe('Repositories', () => {
476
481
  ImportUserDataSteps.checkImportedResource(0, 'Text snippet', 'org.eclipse.rdf4j.sail.shacl.GraphDBShaclSailValidationException: Failed SHACL validation');
477
482
  });
478
483
 
479
- it('should not allow editing of repository name if repository is in cluster', () => {
484
+ it('should allow editing of repository name if repository is in cluster', () => {
480
485
  // When I create a repository,
481
486
  cy.createRepository({id: repositoryId});
482
487
  // set the repository be in a cluster.
@@ -487,9 +492,9 @@ describe('Repositories', () => {
487
492
  // When I try to edit the repository id.
488
493
  RepositorySteps.editRepositoryId();
489
494
 
490
- // Then I expect the repository name can't be edited.
491
- ModalDialogSteps.getDialog().should('not.exist');
492
- RepositorySteps.getRepositoryIdEditElement().should('have.css', 'cursor').and('match', /not-allowed/);
495
+ // Then I expect to be allowed to edit.
496
+ ModalDialogSteps.getDialog().should('be.visible');
497
+ RepositorySteps.getRepositoryIdEditElement().should('have.css', 'cursor').and('match', /pointer/);
493
498
  });
494
499
 
495
500
  it('should allow editing of repository name if repository is not in cluster', () => {