graphdb-workbench-tests 2.6.4 → 2.7.0-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.
Files changed (73) hide show
  1. package/Dockerfile +3 -1
  2. package/fixtures/cluster/3-nodes-cluster-group-status-receiving-snapshot.json +7 -7
  3. package/fixtures/graphdb-import/0007-import-file.jsonld +27 -0
  4. package/fixtures/graphdb-import/more-files/jsonld-file.jsonld +8 -0
  5. package/fixtures/graphdb-import/more-files/rdfxml.rdf +15 -0
  6. package/fixtures/graphdb-import/more-files-with-error/import-resource-with-correct-data.jsonld +8 -0
  7. package/fixtures/graphdb-import/more-files-with-error/import-resource-with-incorrect-data.rdf +13 -0
  8. package/fixtures/graphdb-import/more-files-with-error/import-resource-with-long-error.rdf +13 -0
  9. package/fixtures/graphdb-import/sample-jsonld.json +8 -0
  10. package/fixtures/locale-en.json +251 -111
  11. package/fixtures/url-import-template.json +1 -0
  12. package/integration/cluster/cluster-legend.spec.js +36 -0
  13. package/integration/cluster/cluster-management.spec.js +4 -92
  14. package/integration/cluster/cluster-states.spec.js +117 -0
  15. package/integration/explore/graphs.overview.spec.js +62 -0
  16. package/integration/explore/similarity.spec.js +20 -2
  17. package/integration/guides/movies-interactive-guide.spec.js +1 -1
  18. package/integration/guides/star-wars-interactive-guide.js +1 -0
  19. package/integration/import/import-server-files-batch-operations.spec.js +121 -0
  20. package/integration/import/import-server-files.spec.js +145 -0
  21. package/integration/import/import-user-data-file-upload.spec.js +194 -0
  22. package/integration/import/import-user-data-settings-dialog.spec.js +70 -0
  23. package/integration/import/import-user-data-text-snippet.spec.js +246 -0
  24. package/integration/import/import-user-data-url.spec.js +70 -0
  25. package/integration/import/import-user-data.spec.js +119 -0
  26. package/integration/import/import-view.spec.js +108 -0
  27. package/integration/monitor/global-operation-statuses-component.spec.js +2 -2
  28. package/integration/repository/repositories.spec.js +20 -17
  29. package/integration/resource/resource.spec.js +40 -0
  30. package/integration/setup/aclmanagement/create-rule.spec.js +15 -0
  31. package/integration/setup/sparql-template-create.js +4 -4
  32. package/integration/setup/user-and-access.spec.js +98 -138
  33. package/integration/sparql-editor/internationalization.spec.js +62 -12
  34. package/integration/sparql-editor/yasgui-tabs.spec.js +15 -1
  35. package/integration/sparql-editor/yasr/download-as.spec.js +71 -0
  36. package/integration-flaky/import/import-server-files-operations.spec.js +142 -0
  37. package/integration-flaky/import/import-user-data-batch-operations.spec.js +185 -0
  38. package/integration-flaky/import/import.server.files.spec.js +3 -2
  39. package/integration-flaky/setup/sparql-template-create.js +1 -1
  40. package/integration-flaky/sparql-editor/actions/share-query.spec.js +1 -1
  41. package/npm-shrinkwrap.json +3198 -0
  42. package/package.json +10 -11
  43. package/steps/cluster/cluster-configuration-steps.js +17 -0
  44. package/steps/cluster/cluster-page-steps.js +20 -8
  45. package/steps/cluster/cluster-view-steps.js +6 -2
  46. package/steps/explore/graphs-overview-steps.js +32 -0
  47. package/steps/explore/similarity-indexes-steps.js +26 -0
  48. package/steps/guides/guide-steps.js +5 -19
  49. package/steps/home-steps.js +4 -0
  50. package/steps/import/file-overwrite-dialog-steps.js +16 -0
  51. package/steps/import/import-resource-message-dialog.js +46 -0
  52. package/steps/import/import-server-files-steps.js +36 -0
  53. package/steps/import/import-settings-dialog-steps.js +60 -0
  54. package/steps/import/import-steps.js +463 -0
  55. package/steps/import/import-user-data-steps.js +167 -0
  56. package/steps/json-ld-modal-steps.js +41 -0
  57. package/steps/language-selector-steps.js +12 -0
  58. package/steps/main-menu-steps.js +4 -0
  59. package/steps/resource/resource-steps.js +7 -2
  60. package/steps/setup/acl-management-steps.js +4 -0
  61. package/steps/setup/user-and-access-steps.js +189 -0
  62. package/steps/sparql-steps.js +1 -1
  63. package/steps/yasgui/yasgui-steps.js +6 -0
  64. package/steps/yasgui/yasr-steps.js +5 -0
  65. package/stubs/yasgui/query-stubs.js +4 -0
  66. package/support/commands.js +23 -0
  67. package/support/import-commands.js +10 -0
  68. package/support/sparql-commands.js +1 -1
  69. package/bin/graphdb-workbench-cypress +0 -29
  70. package/integration/help/rest-api.spec.js +0 -121
  71. package/integration/import/import.server.files.spec.js +0 -69
  72. package/integration/import/import.user.data.spec.js +0 -338
  73. package/steps/import-steps.js +0 -277
@@ -0,0 +1,70 @@
1
+ import {ImportUserDataSteps} from "../../steps/import/import-user-data-steps";
2
+ import {ImportSettingsDialogSteps} from "../../steps/import/import-settings-dialog-steps";
3
+
4
+ describe('Import user data: URL import', () => {
5
+
6
+ let repositoryId;
7
+
8
+ const IMPORT_URL = 'https://www.w3.org/TR/owl-guide/wine.rdf';
9
+ const JSONLD_FORMAT = 'JSON-LD';
10
+ const VALID_URL_RDF_FORMAT = 'RDF/XML';
11
+ const RDF_ERROR_MESSAGE = 'RDF Parse Error:';
12
+ const IMPORT_JSONLD_URL = 'https://example.com/0007-context.jsonld';
13
+
14
+ beforeEach(() => {
15
+ repositoryId = 'user-import-' + Date.now();
16
+ cy.createRepository({id: repositoryId});
17
+ ImportUserDataSteps.visitUserImport(repositoryId);
18
+ });
19
+
20
+ afterEach(() => {
21
+ cy.deleteRepository(repositoryId);
22
+ });
23
+
24
+ it('Test import file via URL successfully with Auto format selected', () => {
25
+ ImportUserDataSteps.openImportURLDialog(IMPORT_URL);
26
+ ImportUserDataSteps.clickImportUrlButton();
27
+ // Without changing settings
28
+ ImportSettingsDialogSteps.import();
29
+ ImportUserDataSteps.checkImportedResource(0, IMPORT_URL);
30
+ });
31
+
32
+ it('Test import file via URL with invalid RDF format selected', () => {
33
+ ImportUserDataSteps.openImportURLDialog(IMPORT_URL);
34
+ ImportUserDataSteps.selectRDFFormat(JSONLD_FORMAT);
35
+ ImportUserDataSteps.clickImportUrlButton();
36
+ ImportSettingsDialogSteps.import();
37
+ ImportUserDataSteps.checkImportedResource(0, IMPORT_URL, RDF_ERROR_MESSAGE);
38
+ });
39
+
40
+ it('Test import file via URL successfully with valid RDF format selected', () => {
41
+ ImportUserDataSteps.openImportURLDialog(IMPORT_URL);
42
+ ImportUserDataSteps.selectRDFFormat(VALID_URL_RDF_FORMAT);
43
+ ImportUserDataSteps.clickImportUrlButton();
44
+ ImportSettingsDialogSteps.import();
45
+ ImportUserDataSteps.checkImportedResource(0, IMPORT_URL);
46
+ });
47
+
48
+ it('should import JSON-LD file via URL with correct request body', () => {
49
+ ImportUserDataSteps.stubPostJSONLDFromURL(repositoryId);
50
+ ImportUserDataSteps.openImportURLDialog(IMPORT_JSONLD_URL);
51
+ ImportUserDataSteps.selectRDFFormat(JSONLD_FORMAT);
52
+ ImportUserDataSteps.clickImportUrlButton();
53
+ ImportSettingsDialogSteps.import();
54
+ cy.wait('@postJsonldUrl').then((xhr) => {
55
+ expect(xhr.request.body.name).to.eq('https://example.com/0007-context.jsonld');
56
+ expect(xhr.request.body.data).to.eq('https://example.com/0007-context.jsonld');
57
+ expect(xhr.request.body.type).to.eq('url');
58
+ expect(xhr.request.body.hasContextLink).to.be.true;
59
+ });
60
+ });
61
+
62
+ it('should show error on invalid JSON-LD URL', () => {
63
+ ImportUserDataSteps.stubPostJSONLDFromURL();
64
+ ImportUserDataSteps.openImportURLDialog(IMPORT_JSONLD_URL);
65
+ ImportUserDataSteps.selectRDFFormat(JSONLD_FORMAT);
66
+ ImportUserDataSteps.clickImportUrlButton();
67
+ ImportSettingsDialogSteps.import();
68
+ ImportUserDataSteps.checkImportedResource(0, IMPORT_JSONLD_URL, 'https://example.com/0007-context.jsonld');
69
+ });
70
+ });
@@ -0,0 +1,119 @@
1
+ import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
2
+ import {ImportUserDataSteps} from "../../steps/import/import-user-data-steps";
3
+ import {ImportSettingsDialogSteps} from "../../steps/import/import-settings-dialog-steps";
4
+
5
+ const RDF_TEXT_SNIPPET = '@prefix ab:<http://learningsparql.com/ns/addressbook#>.\n\n' +
6
+ 'ab:richard ab:homeTel "(229)276-5135".\n' +
7
+ 'ab:richard ab:email "richard491@hotmail.com".';
8
+
9
+ describe('Import user data', () => {
10
+
11
+ let repositoryId;
12
+
13
+ beforeEach(() => {
14
+ repositoryId = 'user-import-' + Date.now();
15
+ cy.createRepository({id: repositoryId});
16
+ cy.presetRepository(repositoryId);
17
+ });
18
+
19
+ afterEach(() => {
20
+ cy.deleteRepository(repositoryId);
21
+ });
22
+
23
+ it('Should load user data import tab by default', () => {
24
+ // Given I have visited the import page
25
+ ImportUserDataSteps.visit();
26
+ // When the page is loaded
27
+ cy.url().should('include', '/import#user');
28
+ // Then I should see the user help icons
29
+ ImportUserDataSteps.showPageInfoPopover();
30
+ ImportUserDataSteps.getPageInfoPopover().should('be.visible');
31
+ // And user data import tab should be selected by default
32
+ ImportUserDataSteps.getActiveTab().should('have.text', 'User data');
33
+ ImportUserDataSteps.getUserDataTab().should('be.visible');
34
+ ImportUserDataSteps.getUploadRdfFilesButton().should('be.visible');
35
+ ImportUserDataSteps.getUploadFromUrlButton().should('be.visible');
36
+ ImportUserDataSteps.getUploadTextSnippetButton().should('be.visible');
37
+ });
38
+
39
+ it('Should show the file size limit warning', () => {
40
+ // Given I have visited the import page
41
+ ImportUserDataSteps.visit();
42
+ // When the page is loaded
43
+ // Then I should see the file size limit warning
44
+ ImportUserDataSteps.getFileSizeLimitWarning().should('be.visible');
45
+ // When I click the server files tab through the link in the warning
46
+ ImportUserDataSteps.openServerFilesTabFromWarning();
47
+ // Then I should see the server files tab
48
+ ImportUserDataSteps.getActiveTab().should('have.text', 'Server files');
49
+ cy.url().should('include', '/import#server');
50
+ ImportUserDataSteps.getServerFilesTab().should('be.visible');
51
+ // When I click on the API link in the warning
52
+ ImportUserDataSteps.openUserDataTab();
53
+ ImportUserDataSteps.getUserDataTab().should('be.visible');
54
+ ImportUserDataSteps.openAPIViewFromWarning();
55
+ // Then I should see the API view
56
+ cy.url().should('include', '/webapi');
57
+ });
58
+
59
+ it('Should be able to toggle the user data import help', () => {
60
+ // Given I have visited the import page
61
+ ImportUserDataSteps.visit();
62
+ // When the page is loaded and no uploaded files are present
63
+ // Then I should see the user data import help
64
+ ImportUserDataSteps.getHelpMessage().should('be.visible');
65
+ // When I close the help
66
+ ImportUserDataSteps.closeHelpMessage();
67
+ // Then the help should disappear
68
+ ImportUserDataSteps.getHelpMessage().should('not.exist');
69
+ // When I visit the import page again the help should appear again in the empty state
70
+ ImportUserDataSteps.openAPIViewFromWarning();
71
+ cy.url().should('include', '/webapi');
72
+ ImportUserDataSteps.visit();
73
+ ImportUserDataSteps.getHelpMessage().should('be.visible');
74
+ });
75
+
76
+ it('Should be able to open and close help message', () => {
77
+ // Given I have visited the import page
78
+ ImportUserDataSteps.visit();
79
+ // When the page is loaded and no uploaded files are present
80
+ ImportUserDataSteps.getResources().should('have.length', 0);
81
+ // Then I should not see the user data import help
82
+ ImportUserDataSteps.getHelpMessage().should('be.visible');
83
+ // When I have uploaded a text snippet
84
+ ImportUserDataSteps.openImportTextSnippetDialog();
85
+ ImportUserDataSteps.fillRDFTextSnippet(RDF_TEXT_SNIPPET);
86
+ ImportUserDataSteps.clickImportTextSnippetButton();
87
+ ImportSettingsDialogSteps.import();
88
+ ImportUserDataSteps.getResources().should('have.length', 1);
89
+ ImportUserDataSteps.getHelpMessage().should('not.exist');
90
+ ImportUserDataSteps.toggleHelpMessage();
91
+ // And I close the help
92
+ ImportUserDataSteps.closeHelpMessage();
93
+ // And I visit another page and return
94
+ cy.visit('/webapi');
95
+ cy.url().should('include', '/webapi');
96
+ ImportUserDataSteps.visit();
97
+ ImportUserDataSteps.getResources().should('have.length', 1);
98
+ // Then the help should not appear because I have closed it explicitly
99
+ ImportUserDataSteps.getHelpMessage().should('not.exist');
100
+ // When I delete the uploaded file
101
+ ImportUserDataSteps.deleteUploadedFile(0);
102
+ ModalDialogSteps.getDialog().should('be.visible');
103
+ ModalDialogSteps.clickOnConfirmButton();
104
+ ModalDialogSteps.getDialog().should('not.exist');
105
+ // Then the help should appear again
106
+ ImportUserDataSteps.getHelpMessage().should('be.visible');
107
+ });
108
+
109
+ // Can't test this on CI
110
+ it.skip('should be able to copy the max file size limit property', () => {
111
+ // Given I have visited the import page
112
+ ImportUserDataSteps.visit();
113
+ // When the page is loaded
114
+ // And I click the copy button next to the max file size limit property
115
+ ImportUserDataSteps.copyMaxFileSizeLimitProperty();
116
+ // Then I should be able to copy the max file size limit property
117
+ ImportUserDataSteps.getClipboardTextContent().should('equal', 'graphdb.workbench.maxUploadSize');
118
+ });
119
+ });
@@ -0,0 +1,108 @@
1
+ import {ImportSettingsDialogSteps} from "../../steps/import/import-settings-dialog-steps";
2
+ import {ImportUserDataSteps} from "../../steps/import/import-user-data-steps";
3
+ import {ImportServerFilesSteps} from "../../steps/import/import-server-files-steps";
4
+ import ImportSteps from "../../steps/import/import-steps";
5
+ import HomeSteps from "../../steps/home-steps";
6
+
7
+ const bnodes = `_:node0 <http://purl.org/dc/elements/1.1/title> "A new book" ;
8
+ \t<http://purl.org/dc/elements/1.1/creator> "A.N.Other" .`;
9
+
10
+ describe('Import view', () => {
11
+
12
+ let repositoryId;
13
+ const testFiles = [
14
+ 'bnodes.ttl',
15
+ 'jsonld.json'
16
+ ];
17
+
18
+ beforeEach(() => {
19
+ repositoryId = 'user-import-' + Date.now();
20
+ cy.createRepository({id: repositoryId});
21
+ cy.presetRepository(repositoryId);
22
+ ImportUserDataSteps.visitImport('user', repositoryId);
23
+ });
24
+
25
+ afterEach(() => {
26
+ cy.deleteUploadedFile(repositoryId, testFiles);
27
+ cy.deleteRepository(repositoryId);
28
+ });
29
+
30
+ it('Should be able to toggle between user data and server files tabs', () => {
31
+ // Given I have opened the user data tab and uploaded a single file
32
+ ImportUserDataSteps.getResourcesTable().should('be.hidden');
33
+ ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes));
34
+ ImportSettingsDialogSteps.import();
35
+ ImportUserDataSteps.getResources().should('have.length', 1);
36
+ ImportUserDataSteps.getResourceByName('bnodes.ttl').should('be.visible');
37
+ // When I switch to the server files tab
38
+ ImportUserDataSteps.openServerFilesTab();
39
+ // Then I should see the server files only
40
+ ImportServerFilesSteps.getResources().should('have.length', 18);
41
+ // When I switch back to the user data tab
42
+ ImportServerFilesSteps.openUserDataTab();
43
+ // Then I should see the uploaded file
44
+ ImportUserDataSteps.getResources().should('have.length', 1);
45
+ ImportUserDataSteps.getResourceByName('bnodes.ttl').should('be.visible');
46
+ });
47
+
48
+ it('Should display/hide help message depends on resource result', () => {
49
+ // Given I am on import page
50
+
51
+ // Then help message has to be displayed, because the result of imported files are empty.
52
+ ImportUserDataSteps.getHelpMessage().should('exist');
53
+
54
+ // When I toggle the help
55
+ ImportUserDataSteps.toggleHelpMessage();
56
+
57
+ // Then help message mustn't be displayed because the user has hidden it, regardless resources are empty.
58
+ ImportUserDataSteps.getHelpMessage().should('not.exist');
59
+
60
+ // When I go to server tab
61
+ ImportSteps.openServerFilesTab();
62
+
63
+ // Then help message mustn't be displayed because the resources are not empty.
64
+ ImportServerFilesSteps.getHelpMessage().should('not.exist');
65
+
66
+ // When I toggle the server help
67
+ ImportServerFilesSteps.toggleHelpMessage();
68
+
69
+ // Then I expect the help message be displayed.
70
+ ImportServerFilesSteps.getHelpMessage().should('exist');
71
+
72
+ // When I return to the user tab
73
+ ImportSteps.openUserDataTab();
74
+
75
+ // Then help message mustn't be displayed because the user has hidden it, regardless resources are empty.
76
+ ImportUserDataSteps.getHelpMessage().should('not.exist');
77
+
78
+ // When I go to server tab
79
+ ImportSteps.openServerFilesTab();
80
+
81
+ // Then I expect the help message be displayed.
82
+ ImportServerFilesSteps.getHelpMessage().should('exist');
83
+
84
+
85
+ // When I go to other view
86
+ HomeSteps.visit();
87
+ // And return to import user data
88
+ ImportUserDataSteps.visit();
89
+
90
+ // Then I expect the help message to be displayed, because there are no results, regardless of whether the user had previously hidden the help message.
91
+ ImportUserDataSteps.getHelpMessage().should('exist');
92
+
93
+ // When I go to server tab
94
+ ImportSteps.openServerFilesTab();
95
+
96
+ // Then help message mustn't be displayed because the resources are not empty.
97
+ ImportServerFilesSteps.getHelpMessage().should('not.exist');
98
+
99
+ // When I go to user tab and upload a file
100
+ ImportSteps.openUserDataTab();
101
+ ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes));
102
+ ImportSettingsDialogSteps.import();
103
+ ImportUserDataSteps.getResources().should('have.length', 1);
104
+
105
+ // Then I expect the help message not exist, because user because there are resource displayed
106
+ ImportUserDataSteps.getHelpMessage().should('not.exist');
107
+ });
108
+ });
@@ -1,7 +1,7 @@
1
1
  import HomeSteps from "../../steps/home-steps";
2
2
  import {OperationsStatusesComponentSteps} from "../../steps/operations-statuses-component-steps";
3
- import ImportSteps from "../../steps/import-steps";
4
3
  import {GlobalOperationsStatusesStub} from "../../stubs/global-operations-statuses-stub";
4
+ import {ImportUserDataSteps} from "../../steps/import/import-user-data-steps";
5
5
 
6
6
  describe('Operations Status Component', () => {
7
7
 
@@ -22,7 +22,7 @@ describe('Operations Status Component', () => {
22
22
  OperationsStatusesComponentSteps.getOperationsStatusesComponent().should('not.exist');
23
23
 
24
24
  // When I visit some page and there are not running operations.
25
- ImportSteps.visitUserImport(repositoryId);
25
+ ImportUserDataSteps.visitUserImport(repositoryId);
26
26
  // Then I expect "Global Operations Component" to not be visible.
27
27
  OperationsStatusesComponentSteps.getOperationsStatusesComponent().should('not.exist');
28
28
  });
@@ -1,9 +1,10 @@
1
1
  import HomeSteps from "../../steps/home-steps";
2
- import ImportSteps from "../../steps/import-steps";
3
2
  import {RepositorySteps} from "../../steps/repository-steps";
4
3
  import {ToasterSteps} from "../../steps/toaster-steps";
5
4
  import {GlobalOperationsStatusesStub} from "../../stubs/global-operations-statuses-stub";
6
5
  import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
6
+ import {ImportUserDataSteps} from "../../steps/import/import-user-data-steps";
7
+ import {ImportSettingsDialogSteps} from "../../steps/import/import-settings-dialog-steps";
7
8
 
8
9
  describe('Repositories', () => {
9
10
 
@@ -424,31 +425,33 @@ describe('Repositories', () => {
424
425
  RepositorySteps.saveRepository();
425
426
  RepositorySteps.selectRepoFromDropdown(repositoryId);
426
427
 
427
- //Import a shape in the SHACL graph
428
- ImportSteps.visitUserImport(repositoryId);
429
- ImportSteps
428
+ // Import a shape in the SHACL graph
429
+ ImportUserDataSteps.visitUserImport(repositoryId);
430
+ ImportUserDataSteps
430
431
  .openImportTextSnippetDialog()
431
432
  .fillRDFTextSnippet(SHACL_SHAPE_DATA)
432
433
  .selectRDFFormat("TriG")
433
- .clickImportTextSnippetButton()
434
- .importFromSettingsDialog()
435
- .verifyImportStatus('Text snippet', 'Imported successfully');
436
- //Import data that conforms with the shape - import is successfull
437
- ImportSteps
434
+ .clickImportTextSnippetButton();
435
+ ImportSettingsDialogSteps.import();
436
+ ImportUserDataSteps.checkImportedResource(0, 'Text snippet');
437
+ // Import data that conforms with the shape - import is successfully
438
+ // The newly imported file is first in the list
439
+ ImportUserDataSteps
438
440
  .openImportTextSnippetDialog()
439
441
  .fillRDFTextSnippet(SHACL_CORRECT_DATA)
440
442
  .selectRDFFormat("Turtle")
441
- .clickImportTextSnippetButton()
442
- .importFromSettingsDialog()
443
- .verifyImportStatus('Text snippet', 'Imported successfully');
444
- //Import data that does not conform with the shape - GraphDBShaclSailValidationException
445
- ImportSteps
443
+ .clickImportTextSnippetButton();
444
+ ImportSettingsDialogSteps.import();
445
+ ImportUserDataSteps.checkImportedResource(0, 'Text snippet');
446
+ // Import data that does not conform with the shape - GraphDBShaclSailValidationException
447
+ // The newly imported file is first in the list
448
+ ImportUserDataSteps
446
449
  .openImportTextSnippetDialog()
447
450
  .fillRDFTextSnippet(SHACL_INCORRECT_DATA)
448
451
  .selectRDFFormat("Turtle")
449
- .clickImportTextSnippetButton()
450
- .importFromSettingsDialog()
451
- .verifyImportStatus('Text snippet', 'org.eclipse.rdf4j.sail.shacl.GraphDBShaclSailValidationException: Failed SHACL validation');
452
+ .clickImportTextSnippetButton();
453
+ ImportSettingsDialogSteps.import();
454
+ ImportUserDataSteps.checkImportedResource(0, 'Text snippet', 'org.eclipse.rdf4j.sail.shacl.GraphDBShaclSailValidationException: Failed SHACL validation');
452
455
  });
453
456
 
454
457
  it('should not allow editing of repository name if repository is in cluster', () => {
@@ -6,6 +6,7 @@ import {SparqlEditorSteps} from "../../steps/sparql-editor-steps";
6
6
  import {YasqeSteps} from "../../steps/yasgui/yasqe-steps";
7
7
  import {YasrSteps} from "../../steps/yasgui/yasr-steps";
8
8
  import {YasguiSteps} from "../../steps/yasgui/yasgui-steps";
9
+ import {JsonLdModalSteps} from "../../steps/json-ld-modal-steps";
9
10
 
10
11
  const FILE_TO_IMPORT = 'resource-test-data.ttl';
11
12
  const SUBJECT_RESOURCE = 'http:%2F%2Fexample.com%2Fontology%23CustomerLoyalty';
@@ -46,6 +47,8 @@ describe('Resource view', () => {
46
47
  // When I load a resource that takes part in a triple with a blank node.
47
48
  ResourceSteps.visit(`uri=${PREDICATE_SOURCE}&role=subject`);
48
49
 
50
+ cy.get('.ontotext-yasgui-loader').should('be.hidden');
51
+
49
52
  // When I click on "predicate" tab.
50
53
  ResourceSteps.selectPredicateRole();
51
54
 
@@ -359,4 +362,41 @@ describe('Resource view', () => {
359
362
  YasguiSteps.getCurrentTab().should('contain', 'Unnamed 1');
360
363
  });
361
364
  });
365
+
366
+ context('Download as', () => {
367
+ it('should download as JSON-LD and then restore defaults', () => {
368
+ // Given I am in the Resource view
369
+ ResourceSteps.visit(`uri=${SUBJECT_RESOURCE}&role=subject`);
370
+ ResourceSteps.verifyActiveRoleTab('subject');
371
+
372
+ // When I download as JSON-LD
373
+ ResourceSteps.clickDownloadAsOption(1);
374
+
375
+ // Then I should see a dialog appear
376
+ JsonLdModalSteps.getJSONLDModal().should('be.visible');
377
+
378
+ // And I type some example data into the form
379
+ JsonLdModalSteps.selectJSONLDMode(0);
380
+ JsonLdModalSteps.typeJSONLDFrame('https://w3c.github.io/json-ld-api/tests/compact/0007-context.jsonld');
381
+
382
+ // And export a file
383
+ JsonLdModalSteps.clickExportJSONLD();
384
+
385
+ // Then the dialog should disappear
386
+ JsonLdModalSteps.getJSONLDModal().should('not.exist');
387
+
388
+ // And the file should have downloaded
389
+ JsonLdModalSteps.verifyFileExists('statements.jsonld');
390
+
391
+ // When I select the same download as option again and the dialog appears with the prior data
392
+ ResourceSteps.clickDownloadAsOption(1);
393
+ JsonLdModalSteps.getJSONLDModal().should('be.visible');
394
+ JsonLdModalSteps.getSelectedJSONLDModeField().should('have.value', 'http://www.w3.org/ns/json-ld#framed');
395
+ JsonLdModalSteps.getJSONLDFrame().should('have.value', 'https://w3c.github.io/json-ld-api/tests/compact/0007-context.jsonld');
396
+
397
+ // Then clicking the 'Restore defaults' button should reset the data in the form
398
+ JsonLdModalSteps.clickRestoreDefaultsJSONLD();
399
+ JsonLdModalSteps.getSelectedJSONLDModeField().should('have.value', 'http://www.w3.org/ns/json-ld#expanded');
400
+ });
401
+ });
362
402
  });
@@ -199,5 +199,20 @@ describe('ACL Management: create rule', () => {
199
199
  // Then I expect an error notification to be displayed that describe me that ACL have to be unique.
200
200
  ApplicationSteps.getErrorNotifications().contains('Every ACL rule should be unique.');
201
201
  });
202
+
203
+ it('should not allow creating a new rule if CUSTOM ROLE is less than 2 symbols', () => {
204
+ // When I am on "ACL Management" page and create a new rule with a CUSTOM ROLE of 1 symbol
205
+ AclManagementSteps.addRuleInBeginning();
206
+ AclManagementSteps.selectPolicy(0, 'allow');
207
+ AclManagementSteps.fillRole(0, 'A');
208
+ AclManagementSteps.selectOperation(0, 'write');
209
+ AclManagementSteps.fillSubject(0, '<urn:Mary>');
210
+ AclManagementSteps.fillPredicate(0, '*');
211
+ AclManagementSteps.fillObject(0, '*');
212
+ AclManagementSteps.fillContext(0, '*');
213
+
214
+ // Then I expect an error notification to be displayed that tells me this ROLE length is not allowed
215
+ AclManagementSteps.getFieldError().contains('Too short');
216
+ });
202
217
  });
203
218
 
@@ -1,10 +1,10 @@
1
1
  import {SparqlCreateUpdateSteps} from "../../steps/setup/sparql-create-update-steps";
2
2
  import {YasqeSteps} from "../../steps/yasgui/yasqe-steps";
3
- import ImportSteps from "../../steps/import-steps";
4
3
  import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
5
4
  import {MainMenuSteps} from "../../steps/main-menu-steps";
6
5
  import {RepositorySelectorSteps} from "../../steps/repository-selector-steps";
7
6
  import {SparqlTemplatesSteps} from "../../steps/setup/sparql-templates-steps";
7
+ import {ImportUserDataSteps} from "../../steps/import/import-user-data-steps";
8
8
 
9
9
  describe('SPARQL create template', () => {
10
10
 
@@ -64,10 +64,10 @@ describe('SPARQL create template', () => {
64
64
  it('should navigate to other view if there are no changes', () => {
65
65
  // When I visit 'Sparql create template' view,
66
66
  // and navigate to other view.
67
- ImportSteps.visitUserImport(repositoryId);
67
+ ImportUserDataSteps.visitUserImport(repositoryId);
68
68
 
69
69
  // Then I expect to be navigated without confirmation.
70
- ImportSteps.verifyUserImportUrl();
70
+ ImportUserDataSteps.verifyUserImportUrl();
71
71
  });
72
72
 
73
73
  it('should confirm me before navigate when template id is changed', () => {
@@ -100,7 +100,7 @@ describe('SPARQL create template', () => {
100
100
  ModalDialogSteps.clickOnConfirmButton();
101
101
 
102
102
  // Then I expect to be navigated to other view.
103
- ImportSteps.verifyUserImportUrl();
103
+ ImportUserDataSteps.verifyUserImportUrl();
104
104
  });
105
105
 
106
106
  it('should not change the view if I am creating a new sparql template and change the repository', () => {