graphdb-workbench-tests 2.6.4 → 2.7.0-RC10

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 +147 -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
package/package.json CHANGED
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "2.6.4",
3
+ "version": "2.7.0-RC10",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "scripts": {
6
+ "prepack": "npm shrinkwrap",
7
+ "postpack": "mv npm-shrinkwrap.json package-lock.json",
6
8
  "start": "cypress open",
7
9
  "start:flaky": "cypress open --config-file cypress-flaky.config.js",
8
10
  "test": "cypress run",
9
11
  "test:flaky": "cypress run --config-file cypress-flaky.config.js",
10
- "test:partial": "cypress run --spec \"integration/repository/**\""
12
+ "test:partial": "cypress run --spec \"integration/repository/**\"",
13
+ "test:core": "cypress run --spec integration/repository/**,integration/import/**,integration/sparql-editor/**,integration/monitor/**,integration/cluster/**"
11
14
  },
12
15
  "author": {
13
16
  "name": "\"Sirma AI\" JSC, trading as Ontotext",
@@ -22,20 +25,16 @@
22
25
  "type": "git",
23
26
  "url": "git+https://github.com/Ontotext-AD/graphdb-workbench.git"
24
27
  },
25
- "dependencies": {
28
+ "dependencies": {},
29
+ "devDependencies": {
26
30
  "cypress": "^13.3.1",
27
31
  "cypress-failed-log": "^2.10.0",
28
- "cypress-localstorage-commands": "^1.4.4",
29
- "cypress-terminal-report": "^5.2.0",
30
- "cypress-wait-until": "^1.7.1"
31
- },
32
- "bin": {
33
- "graphdb-workbench-cypress": "bin/graphdb-workbench-cypress"
34
- },
35
- "devDependencies": {
36
32
  "cypress-file-upload": "^5.0.8",
33
+ "cypress-localstorage-commands": "^1.4.4",
37
34
  "cypress-multi-reporters": "^1.6.3",
38
35
  "cypress-real-events": "^1.8.1",
36
+ "cypress-terminal-report": "^5.2.0",
37
+ "cypress-wait-until": "^1.7.1",
39
38
  "del": "^6.1.1",
40
39
  "minimist": "^1.2.5",
41
40
  "mocha-junit-reporter": "^2.2.0"
@@ -0,0 +1,17 @@
1
+ export class ClusterConfigurationSteps {
2
+ static getClusterConfig() {
3
+ return cy.get('.cluster-configuration-panel');
4
+ }
5
+
6
+ static closeConfigurationPanel() {
7
+ this.getClusterConfig().find('.close').click();
8
+ }
9
+
10
+ static getDeleteClusterButton() {
11
+ return this.getClusterConfig().find('.delete-cluster-btn');
12
+ }
13
+
14
+ static deleteCluster() {
15
+ this.getDeleteClusterButton().click();
16
+ }
17
+ }
@@ -15,14 +15,6 @@ export class ClusterPageSteps {
15
15
  this.getCreateClusterButton().click();
16
16
  }
17
17
 
18
- static getClusterDeleteButton() {
19
- return cy.get('.delete-cluster-btn');
20
- }
21
-
22
- static deleteCluster() {
23
- this.getClusterDeleteButton().click();
24
- }
25
-
26
18
  static getRemoveNodesButton() {
27
19
  return cy.get('.remove-node-btn');
28
20
  }
@@ -54,4 +46,24 @@ export class ClusterPageSteps {
54
46
  static previewClusterConfig() {
55
47
  this.getPreviewClusterConfigButton().click();
56
48
  }
49
+
50
+ static openLegend() {
51
+ return cy.get('.toggle-legend-btn button');
52
+ }
53
+
54
+ static getLegend() {
55
+ return cy.get('.cluster-legend-group');
56
+ }
57
+
58
+ static getLegendNodes() {
59
+ return this.getLegend().find('#node-group');
60
+ }
61
+
62
+ static getLegendNodeStates() {
63
+ return this.getLegend().find('.sync-statuses-group');
64
+ }
65
+
66
+ static getLegendLinkStates() {
67
+ return this.getLegend().find('.link-state');
68
+ }
57
69
  }
@@ -1,14 +1,18 @@
1
1
  export class ClusterViewSteps {
2
2
 
3
- static getNodes() {
3
+ static getNodes() {
4
4
  return cy.get('.id-host-background').parent().parent();
5
5
  }
6
6
 
7
7
  static getNode(host) {
8
- return ClusterViewSteps.getNodes().contains(host).parent().parent();
8
+ return ClusterViewSteps.getNodes().contains(host).parent().parent();
9
9
  }
10
10
 
11
11
  static getNodeInfoText(host) {
12
12
  return ClusterViewSteps.getNode(host).find('.node-info-fo');
13
13
  }
14
+
15
+ static getLink(id) {
16
+ return cy.get(`path.link.${id}`);
17
+ }
14
18
  }
@@ -21,4 +21,36 @@ export class GraphsOverviewSteps {
21
21
  static openGraph(row = 0) {
22
22
  GraphsOverviewSteps.getResult(row).find('td ').eq(1).find('a').click();
23
23
  }
24
+
25
+ static selectRow(row) {
26
+ cy.get('.form-check-input').eq(row).click();
27
+ }
28
+
29
+ static getExportRepositoryButtonOnRow(index) {
30
+ return cy.get('.export-graph').eq(index);
31
+ }
32
+
33
+ static downloadAsFromRowButton(index) {
34
+ this.getExportRepositoryButtonOnRow(index).click();
35
+ }
36
+
37
+ static selectJSONLDFromRowDropdown() {
38
+ cy.get('.export-repo-format-JSON-LD-row').contains('JSON-LD').click();
39
+ }
40
+
41
+ static getExportRepositoryButton() {
42
+ return cy.get('.export-repository-btn');
43
+ }
44
+
45
+ static exportRepository() {
46
+ this.getExportRepositoryButton().click();
47
+ }
48
+
49
+ static selectJSONLDOption() {
50
+ cy.get('.export-repo-format-JSON-LD').eq(0).click();
51
+ }
52
+
53
+ static selectJSONLDMode(option) {
54
+ cy.get('[id=wb-JSONLD-mode]').select(option);
55
+ }
24
56
  }
@@ -15,4 +15,30 @@ export class SimilarityIndexesSteps {
15
15
  static getEditButton(similarityIndexName) {
16
16
  return SimilarityIndexesSteps.getSimilarityIndexRow(similarityIndexName).find('.edit-query-btn');
17
17
  }
18
+
19
+ static getSearchTypeButton() {
20
+ return cy.get('.search-type-btn');
21
+ }
22
+
23
+ static getResultTypeButton() {
24
+ return cy.get('.result-type-btn');
25
+ }
26
+
27
+ static clickSearchTypeDropdown() {
28
+ this.getSearchTypeButton().click();
29
+ }
30
+
31
+ static clickResultTypeDropdown() {
32
+ this.getResultTypeButton().click();
33
+ }
34
+
35
+ static selectSearchTypeOption(type) {
36
+ this.clickSearchTypeDropdown();
37
+ cy.get('.dropdown-search-type .dropdown-item').contains(type).click();
38
+ }
39
+
40
+ static selectResultTypeOption(type) {
41
+ this.clickResultTypeDropdown();
42
+ cy.get('.dropdown-result-type .dropdown-item').contains(type).click();
43
+ }
18
44
  }
@@ -3,7 +3,7 @@ import {MainMenuSteps} from "../main-menu-steps";
3
3
  import {RepositorySteps} from "../repository-steps";
4
4
  import {RepositorySelectorSteps} from "../repository-selector-steps";
5
5
  import {AutocompleteSteps} from "../autocomplete-steps";
6
- import ImportSteps from "../import-steps";
6
+ import ImportSteps from "../import/import-steps";
7
7
 
8
8
  export class GuideSteps {
9
9
  static visit() {
@@ -26,13 +26,6 @@ export class GuideSteps {
26
26
  cy.get(selector).should('be.visible');
27
27
  }
28
28
 
29
- static uploadFile(fileName) {
30
- cy.get('#ngf-wb-import-uploadFile')
31
- .attachFile(`guides/${fileName}`);
32
- // Wait until import button appeared.
33
- cy.get(`[guide-selector="import-file-${fileName}"]`);
34
- }
35
-
36
29
  static assertPageNotInteractive() {
37
30
  cy.get('.shepherd-modal-is-visible');
38
31
  }
@@ -199,20 +192,15 @@ export class GuideSteps {
199
192
  ImportSteps.getImportRdfFileElement().should('be.visible');
200
193
  }
201
194
 
202
- static assertImportFileStep5(fileToImport) {
203
- GuideDialogSteps.assertDialogWithTitleIsVisible('Import file — 5/7');
204
- GuideSteps.assertIsElementInteractable('[guide-selector="import-file-' + fileToImport + '"]');
205
- }
206
-
207
195
  static assertImportFileStep6() {
208
196
  GuideSteps.assertPageNotInteractive();
209
197
  GuideDialogSteps.assertDialogWithTitleIsVisible('Import file — 6/7');
210
198
  }
211
199
 
212
- static assertImportFileStep7(fileToImport) {
200
+ static assertImportFileStep7() {
213
201
  GuideDialogSteps.assertDialogWithTitleIsVisible('Import file — 7/7');
214
202
  GuideSteps.assertPageNotInteractive();
215
- ImportSteps.getImportFileRow(fileToImport).contains('Imported successfully');
203
+ ImportSteps.getImportStatusRow(0).contains('Imported successfully');
216
204
  }
217
205
 
218
206
  static importFileByNextButton(fileToImport) {
@@ -230,15 +218,13 @@ export class GuideSteps {
230
218
  GuideDialogSteps.clickOnNextButton();
231
219
  GuideSteps.assertImportFileStep4();
232
220
 
233
- GuideSteps.uploadFile(fileToImport);
234
- GuideSteps.assertImportFileStep5(fileToImport);
221
+ ImportSteps.selectFile(`fixtures/guides/${fileToImport}`);
235
222
 
236
- GuideDialogSteps.clickOnNextButton();
237
223
  GuideSteps.assertImportFileStep6();
238
224
 
239
225
  // Step click on Import button.
240
226
  GuideDialogSteps.clickOnNextButton();
241
- GuideSteps.assertImportFileStep7(fileToImport);
227
+ GuideSteps.assertImportFileStep7();
242
228
  }
243
229
 
244
230
  static runGuideTest(guideName, repositoryId, fileToImport, stepAssertions = []) {
@@ -1,5 +1,9 @@
1
1
  class HomeSteps {
2
2
 
3
+ static visit() {
4
+ cy.visit('/');
5
+ }
6
+
3
7
  static visitAndWaitLoader(stubNewWindow) {
4
8
  if (stubNewWindow) {
5
9
  cy.visit('/', {
@@ -0,0 +1,16 @@
1
+ import {ModalDialogSteps} from "../modal-dialog-steps";
2
+
3
+ export class FileOverwriteDialogSteps extends ModalDialogSteps {
4
+
5
+ static overwrite() {
6
+ this.getDialog().find('.confirm-overwrite-btn').click();
7
+ }
8
+
9
+ static cancel() {
10
+ this.getDialog().find('.cancel-btn').click();
11
+ }
12
+
13
+ static keepBoth() {
14
+ this.getDialog().find('.keep-both-btn').click();
15
+ }
16
+ }
@@ -0,0 +1,46 @@
1
+ export class ImportResourceMessageDialog {
2
+
3
+ static getDialog() {
4
+ return cy.get('.import-resource-message-dialog');
5
+ }
6
+
7
+ static getDialogHeader() {
8
+ return ImportResourceMessageDialog.getDialog().find('.modal-header');
9
+ }
10
+
11
+ static getCornerCloseButton() {
12
+ return ImportResourceMessageDialog.getDialogHeader().find('.close');
13
+ }
14
+
15
+ static clickOnCornerCloseButton() {
16
+ ImportResourceMessageDialog.getCornerCloseButton().click();
17
+ }
18
+
19
+ static getDialogBody() {
20
+ return ImportResourceMessageDialog.getDialog().find('.modal-body');
21
+ }
22
+
23
+ static getDialogFooter() {
24
+ return ImportResourceMessageDialog.getDialog().find('.modal-footer');
25
+ }
26
+
27
+ static getCloseButton() {
28
+ return ImportResourceMessageDialog.getDialogFooter().find('.close-btn');
29
+ }
30
+
31
+ static clickOnCloseButton() {
32
+ ImportResourceMessageDialog.getCloseButton().click();
33
+ }
34
+
35
+ static getMessage() {
36
+ return this.getDialogBody().find('.message');
37
+ }
38
+
39
+ static getCopyToClipboard() {
40
+ return ImportResourceMessageDialog.getDialogFooter().find('.copy-to-clipboard-btn')
41
+ }
42
+
43
+ static copyToClipboard() {
44
+ ImportResourceMessageDialog.getCopyToClipboard().click();
45
+ }
46
+ }
@@ -0,0 +1,36 @@
1
+ import ImportSteps from "./import-steps";
2
+
3
+ export class ImportServerFilesSteps extends ImportSteps {
4
+
5
+ static getResourcesTable() {
6
+ return ImportSteps.getView().find('#import-server import-resource-tree');
7
+ }
8
+
9
+ static getHelpMessage() {
10
+ return this.getView().find('.server-files-import-help');
11
+ }
12
+
13
+ static getSelectedTypeFilterButton() {
14
+ return this.getResourcesTable().find('.import-resource-type-filter .active');
15
+ }
16
+
17
+ static getShowAllResourceTypesButton() {
18
+ return this.getResourcesTable().find('.show-all-resources-btn');
19
+ }
20
+
21
+ static getShowOnlyFoldersButton() {
22
+ return this.getResourcesTable().find('.show-only-folders-btn');
23
+ }
24
+
25
+ static selectFoldersOnlyFilter() {
26
+ this.getShowOnlyFoldersButton().click();
27
+ }
28
+
29
+ static getShowOnlyFilesButton() {
30
+ return this.getResourcesTable().find('.show-only-files-btn');
31
+ }
32
+
33
+ static selectFilesOnlyFilter() {
34
+ this.getShowOnlyFilesButton().click();
35
+ }
36
+ }
@@ -0,0 +1,60 @@
1
+ import {ModalDialogSteps} from "../modal-dialog-steps";
2
+
3
+ export class ImportSettingsDialogSteps extends ModalDialogSteps {
4
+ static getImportButton() {
5
+ return this.getDialog().find('.import-settings-import-button');
6
+ }
7
+
8
+ static import() {
9
+ this.getImportButton().click();
10
+ }
11
+
12
+ static getCancelImportButton() {
13
+ return this.getDialog().find('.cancel-import-button');
14
+ }
15
+
16
+ static cancelImport() {
17
+ this.getCancelImportButton().click();
18
+ }
19
+
20
+ static getSettingsForm() {
21
+ return this.getDialog().find('.settings-form');
22
+ }
23
+
24
+ static expandAdvancedSettings() {
25
+ this.getSettingsForm().within(() => {
26
+ cy.get('.toggle-advanced-settings').click();
27
+ cy.get('.advanced-settings').should('be.visible');
28
+ });
29
+ }
30
+
31
+ static fillBaseURI(baseURI) {
32
+ this.getSettingsForm().find('input[name="baseURI"]').type(baseURI).should('have.value', baseURI);
33
+ }
34
+
35
+ static selectNamedGraph() {
36
+ this.getSettingsForm().find('.named-graph-btn').check();
37
+ }
38
+
39
+ static fillNamedGraph(namedGraph) {
40
+ this.getSettingsForm().find('.named-graph-input').type(namedGraph).should('have.value', namedGraph);
41
+ }
42
+
43
+ static enablePreserveBNodes() {
44
+ this.getSettingsForm().find('input[name="preserveBNodeIDs"]').check();
45
+ }
46
+
47
+ static fillContextLink(contextLink) {
48
+ this.getSettingsForm().find('input[name="contextLink"]').type(contextLink).should('have.value', contextLink);
49
+ }
50
+
51
+ static setContextLinkToBeVisible() {
52
+ this.getSettingsForm().within(() => {
53
+ cy.get('.contextLinkRow').invoke('attr', 'style', 'display: block !important');
54
+ });
55
+ }
56
+
57
+ static getReplaceExistingDataCheckbox() {
58
+ return this.getSettingsForm().find('input.existing-data-replacement');
59
+ }
60
+ }