graphdb-workbench-tests 2.5.1 → 2.6.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 (114) hide show
  1. package/fixtures/graphdb-import/resource-test-data.ttl +99 -0
  2. package/fixtures/graphql-editor/default-query-response.json +517 -0
  3. package/fixtures/guides/guides.json +764 -0
  4. package/fixtures/guides/movies.ttl +629 -0
  5. package/fixtures/guides/starwars.ttl +4384 -0
  6. package/fixtures/locale-en.json +44 -10
  7. package/fixtures/namespaces/ontotext-generated-namespace.json +22 -0
  8. package/fixtures/queries/empty-query-response.json +11 -0
  9. package/integration/cluster/cluster-management.spec.js +1 -2
  10. package/integration/explore/graphs.overview.spec.js +4 -2
  11. package/integration/explore/similariti-index-create.spec.js +333 -0
  12. package/integration/explore/similarity-index.spec.js +88 -0
  13. package/integration/explore/similarity.spec.js +180 -56
  14. package/integration/explore/visual-graph/graphs-config.spec.js +453 -0
  15. package/integration/explore/{visual.graph.spec.js → visual-graph/visual.graph.spec.js} +146 -347
  16. package/integration/guides/movies-interactive-guide.spec.js +73 -0
  17. package/integration/guides/star-wars-interactive-guide.js +60 -0
  18. package/integration/home/language-change.spec.js +3 -3
  19. package/integration/import/import.user.data.spec.js +2 -0
  20. package/integration/resource/resource.spec.js +357 -0
  21. package/integration/setup/aclmanagement/create-rule.spec.js +88 -11
  22. package/integration/setup/aclmanagement/delete-rule.spec.js +6 -4
  23. package/integration/setup/aclmanagement/edit-rule.spec.js +13 -8
  24. package/integration/setup/aclmanagement/render-rules.spec.js +4 -2
  25. package/integration/setup/aclmanagement/reorder-rules.spec.js +5 -3
  26. package/integration/setup/aclmanagement/revert-rules.spec.js +4 -3
  27. package/integration/setup/aclmanagement/scopes.spec.js +220 -0
  28. package/integration/setup/aclmanagement/update-rules.spec.js +17 -9
  29. package/integration/setup/jdbc-create.spec.js +330 -0
  30. package/integration/setup/jdbc.spec.js +78 -154
  31. package/integration/setup/my-settings.spec.js +9 -41
  32. package/integration/setup/sparql-template-create.js +150 -0
  33. package/integration/setup/sparql-templates.spec.js +82 -146
  34. package/integration/sparql-editor/actions/execute-query.spec.js +44 -0
  35. package/integration/sparql-editor/actions/expand-results-over-sameas.spec.js +136 -0
  36. package/integration/sparql-editor/actions/include-inferred-statements.spec.js +100 -0
  37. package/integration/sparql-editor/actions/inferred-sameas.spec.js +47 -0
  38. package/integration/sparql-editor/actions/save-query.spec.js +70 -0
  39. package/integration/sparql-editor/actions/show-saved-queries.spec.js +61 -0
  40. package/integration/sparql-editor/internationalization.spec.js +41 -0
  41. package/integration/sparql-editor/saved-query/abort-query.spec.js +51 -0
  42. package/integration/sparql-editor/saved-query/delete-query.spec.js +56 -0
  43. package/integration/sparql-editor/saved-query/edit-query.spec.js +68 -0
  44. package/integration/sparql-editor/saved-query/share-query.spec.js +78 -0
  45. package/integration/sparql-editor/sparql-editor.spec.js +55 -0
  46. package/integration/sparql-editor/yasgui-tabs.spec.js +107 -0
  47. package/integration/sparql-editor/yasr/download-as.spec.js +54 -0
  48. package/integration/sparql-editor/yasr/pagination.spec.js +234 -0
  49. package/integration/sparql-editor/yasr/table-plugin.spec.js +39 -0
  50. package/integration/sparql-editor/yasr/toolbar/visual-graph-button.spec.js +57 -0
  51. package/integration-flaky/explore/visual.graph.spec.js +3 -2
  52. package/integration-flaky/setup/sparql-template-create.js +139 -0
  53. package/integration-flaky/sparql-editor/actions/execute-update-query.spec.js +89 -0
  54. package/integration-flaky/sparql-editor/actions/share-query.spec.js +84 -0
  55. package/integration-flaky/sparql-editor/lucene-connector.spec.js +62 -0
  56. package/integration-flaky/sparql-editor/plugins/error-plugin.spec.js +83 -0
  57. package/integration-flaky/sparql-editor/yasr/table-plugin.spec.js +81 -0
  58. package/package.json +3 -1
  59. package/steps/application-steps.js +5 -0
  60. package/steps/autocomplete-steps.js +10 -0
  61. package/steps/error-steps.js +9 -0
  62. package/steps/explore/graphs-overview-steps.js +24 -0
  63. package/steps/explore/similarity-index-create-steps.js +113 -0
  64. package/steps/explore/similarity-indexes-steps.js +18 -0
  65. package/steps/guides/guide-dialog-steps.js +38 -0
  66. package/steps/guides/guide-steps.js +278 -0
  67. package/steps/guides/movies-guide-steps.js +241 -0
  68. package/steps/guides/star-wars-guide-steps.js +188 -0
  69. package/steps/import-steps.js +16 -0
  70. package/steps/language-selector-steps.js +22 -0
  71. package/steps/loader-steps.js +10 -0
  72. package/steps/lucene-connector-steps.js +43 -0
  73. package/steps/main-menu-steps.js +67 -0
  74. package/steps/repository-selector-steps.js +26 -0
  75. package/steps/repository-steps.js +4 -0
  76. package/steps/resource/resource-edit-steps.js +111 -0
  77. package/steps/resource/resource-steps.js +149 -0
  78. package/steps/setup/acl-management-steps.js +193 -35
  79. package/steps/setup/jdbc-create-steps.js +97 -0
  80. package/steps/setup/jdbc-steps.js +42 -0
  81. package/steps/setup/sparql-create-update-steps.js +55 -0
  82. package/steps/setup/sparql-templates-steps.js +38 -0
  83. package/steps/sparql-editor-steps.js +20 -0
  84. package/steps/sparql-steps.js +0 -6
  85. package/steps/visual-graph-steps.js +365 -6
  86. package/steps/yasgui/confirmation-dialog-steps.js +13 -0
  87. package/steps/yasgui/pagination-steps.js +47 -0
  88. package/steps/yasgui/plugin/error-plugin-steps.js +30 -0
  89. package/steps/yasgui/save-query-dialog.js +61 -0
  90. package/steps/yasgui/saved-queries-dialog.js +29 -0
  91. package/steps/yasgui/saved-query.js +25 -0
  92. package/steps/yasgui/share-saved-query-dialog.js +25 -0
  93. package/steps/yasgui/table-plugin-steps.js +29 -0
  94. package/steps/yasgui/yasgui-loader.js +10 -0
  95. package/steps/yasgui/yasgui-steps.js +191 -0
  96. package/steps/yasgui/yasqe-steps.js +187 -0
  97. package/steps/yasgui/yasr-steps.js +108 -0
  98. package/stubs/namespace-stubs.js +10 -0
  99. package/stubs/repositories-stub.js +58 -0
  100. package/stubs/security-stubs.js +69 -0
  101. package/stubs/yasgui/connectors-stubs.js +12 -0
  102. package/stubs/yasgui/query-stubs.js +253 -0
  103. package/support/index.js +3 -0
  104. package/support/repository-commands.js +5 -5
  105. package/support/sparql-commands.js +1 -1
  106. package/support/visual-graph-commands.js +25 -0
  107. package/integration/sparql/main.menu.spec.js +0 -232
  108. package/integration/sparql/sparql-error-handling.spec.js +0 -74
  109. package/integration/sparql/sparql-language-change.spec.js +0 -58
  110. package/integration/sparql/sparql-result-formating.spec.js +0 -84
  111. package/integration/sparql/sparql.menu.spec.js +0 -1253
  112. package/integration-flaky/setup/sparql-templates.spec.js +0 -125
  113. package/integration-flaky/sparql/sparql-language-change.spec.js +0 -45
  114. package/integration-flaky/sparql/sparql.menu.spec.js +0 -75
@@ -5,6 +5,8 @@
5
5
  "delete_cluster_tooltip": "Delete existing cluster",
6
6
  "add_nodes_btn": "Add nodes",
7
7
  "add_nodes_btn_tooltip": "Add nodes to existing cluster",
8
+ "replace_nodes_btn": "Replace nodes",
9
+ "replace_nodes_btn_tooltip": "Replace nodes in cluster",
8
10
  "remove_nodes_btn": "Remove nodes",
9
11
  "remove_nodes_btn_tooltip": "Remove nodes from existing cluster",
10
12
  "edit_cluster": "Edit configuration",
@@ -72,6 +74,7 @@
72
74
  "edit_page_title": "Edit cluster configuration",
73
75
  "creating_cluster_loader": "Creating cluster...",
74
76
  "add_nodes_loader": "Adding nodes to cluster...",
77
+ "replace_nodes_loader": "Replacing nodes in cluster...",
75
78
  "remove_nodes_loader": "Removing nodes from cluster...",
76
79
  "updating_cluster_loader": "Updating cluster...",
77
80
  "cluster_nodes_list": "Cluster nodes list",
@@ -86,6 +89,7 @@
86
89
  "only_positive_integers": "Enter only positive integers",
87
90
  "small_transaction_log_max_size": "Transaction log maximum size must be at least 1 GB or a negative number",
88
91
  "at_least_two_nodes": "Must have at least two nodes",
92
+ "cant_replace_majority_of_nodes": "Can't replace majority of cluster nodes",
89
93
  "no_rpc_address": "Error retrieving RPC address: {{error}}",
90
94
  "nodes_status_label": "Nodes status",
91
95
  "preconditions_failed": {
@@ -106,6 +110,8 @@
106
110
  "form_invalid": "The form data is invalid",
107
111
  "add_nodes_success": "Nodes added successfully",
108
112
  "add_nodes_fail": "Adding nodes failed",
113
+ "replace_nodes_success": "Nodes replaced successfully",
114
+ "replace_nodes_fail": "Replacing nodes failed",
109
115
  "remove_nodes_success": "Nodes removed successfully",
110
116
  "remove_nodes_fail": "Removing nodes failed"
111
117
  }
@@ -122,6 +128,11 @@
122
128
  "fail_delete": "Can not delete cluster"
123
129
  }
124
130
  },
131
+ "replace_nodes_dialog": {
132
+ "title": "Replace nodes in cluster",
133
+ "nodes_to_replace_label": "Nodes to add to cluster",
134
+ "cluster_nodes_list": "Select nodes to be removed from existing cluster"
135
+ },
125
136
  "add_nodes_dialog": {
126
137
  "title": "Add nodes to cluster",
127
138
  "nodes_to_add_label": "Nodes to add to cluster"
@@ -133,29 +144,39 @@
133
144
  },
134
145
  "acl_management": {
135
146
  "rulestable": {
147
+ "tab": {
148
+ "statement": "Statement",
149
+ "clear_graph": "Clear graph",
150
+ "plugin": "Plugin",
151
+ "system": "System"
152
+ },
136
153
  "column": {
137
154
  "index": "#",
155
+ "policy": "Policy",
156
+ "role": "Custom role",
157
+ "operation": "Operation",
138
158
  "subject": "Subject",
139
159
  "predicate": "Predicate",
140
160
  "object": "Object",
141
161
  "context": "Context",
142
- "role": "Role",
143
- "policy": "Policy"
162
+ "plugin": "Plugin"
144
163
  },
145
164
  "field_placeholders": {
146
165
  "subject": "Subject",
147
166
  "predicate": "Predicate",
148
167
  "object": "Object",
149
168
  "context": "Context",
150
- "role": "Role"
169
+ "role": "ROLE1",
170
+ "plugin": "Plugin"
151
171
  },
152
172
  "actions": {
153
173
  "move_up": "Move the rule up",
154
174
  "move_down": "Move the rule down",
155
175
  "delete_rule": "Delete rule",
156
- "add_rule": "Add new rule",
176
+ "add_rule_first": "Add new rule in the beginning of the list",
177
+ "add_rule_next": "Add new rule after current rule",
157
178
  "edit_rule": "Edit rule",
158
- "save_rule": "Save rule",
179
+ "apply_rule": "Confirm rule editing",
159
180
  "cancel_rule_editing": "Cancel rule editing",
160
181
  "save_acl": "Save ACL",
161
182
  "cancel_acl_saving": "Cancel"
@@ -319,6 +340,7 @@
319
340
  "new.sentence.start": "New",
320
341
  "no.connectors.available": "No connectors available",
321
342
  "current.repo.no.connector.support": "The current repository does not support any connectors. Please check the type of the repository or select another one.",
343
+ "edit.select.query": "Edit select query",
322
344
  "edit.search.query": "Edit search query",
323
345
  "edit.analogical.query": "Edit analogical query",
324
346
  "current.repo.error": "The currently selected repository cannot be used for queries due to an error:",
@@ -603,6 +625,7 @@
603
625
  "view.jdbc.helpInfo": "The JDBC configuration view allows you to configure, store, update, preview, and delete virtual SQL tables. These tables can then be used with the Avatica JDBC driver. Each virtual SQL table is based on a SPARQL SELECT query and requires additional metadata for the definition of the SQL columns.",
604
626
  "view.jdbc.create.title": "SQL table configuration",
605
627
  "view.jdbc.create.helpInfo": "The SQL table configuration view is used to define a virtual SQL table. Each table must have a name, a SPARQL SELECT query, and a set of SQL column definitions.",
628
+ "view.jdbc.create.get_suggestion_sql_type": "Get suggestion...",
606
629
  "jdbc.column.names.constraint": "Column names must be placed in array.",
607
630
  "view.namespaces.helpInfo": "The Namespaces view provides an overview of all namespaces defined in a GraphDB repository. Namespaces are essentially shorthand notations for IRIs. Here you can add, remove and modify them.",
608
631
  "view.query.and.update.monitoring.title": "Query and Update monitoring",
@@ -1002,7 +1025,7 @@
1002
1025
  "jdbc.not.delete.sql.msg": "Could not delete SQL table",
1003
1026
  "jdbc.warning.unsaved.changes": "You have unsaved changes. Are you sure that you want to exit?",
1004
1027
  "jdbc.not.get.sql.msg2": "Could not get SQL table configuration",
1005
- "jdbc.required.configuration.name": "SQL configuration name is required",
1028
+ "jdbc.required.configuration.name": "SQL table name is required",
1006
1029
  "jdbc.saved.configuration": "SQL table configuration saved",
1007
1030
  "jdbc.not.saved.configuration": "Could not save SQL table configuration",
1008
1031
  "jdbc.configuration.updated": "SQL table configuration updated",
@@ -1323,13 +1346,17 @@
1323
1346
  "similarity.could.not.get.indexes.error": "Could not get indexes",
1324
1347
  "similarity.empty.index.name.error": "Index name cannot be empty",
1325
1348
  "similarity.index.name.constraint": "Index name can contain only letters (a-z, A-Z), numbers (0-9), \"-\" and \"_\"",
1326
- "similarity.empty.select.query.error": "Select query cannot be empty.",
1327
- "similarity.empty.search.query.error": "Search query cannot be empty.",
1328
- "similarity.empty.analogical.query.error": "Analogical query cannot be empty.",
1349
+ "similarity.query.type.DATA.name": "Data",
1350
+ "similarity.query.type.SEARCH.name": "Search",
1351
+ "similarity.query.type.ANALOGICAL.name": "Analogical",
1352
+ "similarity.error.query.empty": "The '{{queryType}}' query cannot be empty.",
1353
+ "similarity.error.query.invalid": "Invalid '{{queryType}}' query",
1354
+ "similarity.error.query.invalid_type": "The '{{queryType}}' query must be a SELECT query",
1329
1355
  "similarity.index.select.queries.constraint": "Similarity index requires SELECT queries.",
1330
1356
  "similarity.could.not.get.search.queries.error": "Could not get search queries",
1331
1357
  "similarity.existing.index.name.error": "Index with this name already exists.",
1332
1358
  "similarity.create.index.error": "Could not create index",
1359
+ "similarity.create.index.successfully": "Similarity index created successfully.",
1333
1360
  "similarity.indexes.select.queries.constraint": "Similarity indexes work only with SELECT queries.",
1334
1361
  "similarity.explain.select.queries.constraint": "Explain only works with SELECT queries.",
1335
1362
  "cannot.execute.update.error": "Cannot execute updates from this editor.",
@@ -1343,6 +1370,8 @@
1343
1370
  "similarity.get.resource.error": "Could not get resource!",
1344
1371
  "similarity.delete.index.warning": "Are you sure you want to delete the index '{{name}}'?",
1345
1372
  "similarity.rebuild.index.warning": "Are you sure you want to rebuild the whole index '{{name}}'?<br>You will still be able to use the latest successful build!",
1373
+ "similarity.copy_of.prefix": "Copy_of",
1374
+ "similarity.warning.unsaved.changes": "You have unsaved changes. Are you sure that you want to exit?",
1346
1375
  "sparql.template.get.templates.error": "Could not get SPARQL templates",
1347
1376
  "sparql.template.delete.template.warning": "Are you sure you want to delete the SPARQL template '{{templateID}}'?",
1348
1377
  "sparql.template.delete.template.success": "Deleted successfully SPARQL template",
@@ -1353,6 +1382,7 @@
1353
1382
  "update.sparql.template.success.msg": "Updated SPARQL template",
1354
1383
  "save.sparql.template.failure.msg": "Could not save {{templateID}} template",
1355
1384
  "sparql.template.query.constraint": "The template query must be an UPDATE query",
1385
+ "sparql.template.query.invalid": "Invalid query",
1356
1386
  "save.sparql.template.success.msg": "Saved SPARQL template",
1357
1387
  "attach.remote.gdb.instance": "Attach a remote GraphDB instance",
1358
1388
  "remote.location.url": "Location URL*",
@@ -1643,6 +1673,7 @@
1643
1673
  "visual.config.search.box.starting.point": "Starting point - Search box",
1644
1674
  "visual.config.query.results.starting.point": "Starting point - Query results",
1645
1675
  "visual.config.fixed.resource.starting.point": "Starting point - Fixed resource",
1676
+ "visual.config.warning.unsaved.changes": "You have unsaved changes. Are you sure that you want to exit?",
1646
1677
  "visual.edit.config": "Edit configuration",
1647
1678
  "visual.delete.config": "Delete configuration",
1648
1679
  "visual.saved.graphs": "Saved graphs",
@@ -1805,6 +1836,7 @@
1805
1836
  "clear.tooltip": "Clear",
1806
1837
  "repo.page.location.label": "Location",
1807
1838
  "repo.page.location.input.field.tooltip": "The location where to create repository. The default is the local one.",
1839
+ "repo.page.repository.info.loading.error": "Currently selected repository cannot be edited due to an error during repository metadata loading.",
1808
1840
  "guide.button.guide-paused": "Guide paused",
1809
1841
  "guide.button.guide-resume": "Continue the guide",
1810
1842
  "guide.validate.no-next": "Cannot continue to next",
@@ -1931,5 +1963,7 @@
1931
1963
  "global.operations_statuses.IN_SYNC.title": "In sync",
1932
1964
  "global.operations_statuses.RECOVERING.title": "Recovering",
1933
1965
  "global.operations_statuses.OUT_OF_SYNC.title": "Out of sync",
1934
- "global.operations_statuses.UNAVAILABLE_NODES.title": "Unavailable nodes"
1966
+ "global.operations_statuses.UNAVAILABLE_NODES.title": "Unavailable nodes",
1967
+ "view.sparql-editor.title": "Ontotext Yasgui SPARQL Query & Update",
1968
+ "view.sparql-editor.helpInfo": "The SPARQL Query & Update view is a unified editor for queries and updates. Enter any SPARQL query or update and click Run to execute it. The view also allows you to save queries for future retrieval and execution in the SPARQL editor."
1935
1969
  }
@@ -0,0 +1,22 @@
1
+ {
2
+ "head" : {
3
+ "vars" : [
4
+ "prefix",
5
+ "namespace"
6
+ ]
7
+ },
8
+ "results" : {
9
+ "bindings" : [
10
+ {
11
+ "prefix" : {
12
+ "type" : "literal",
13
+ "value" : "ontogen"
14
+ },
15
+ "namespace" : {
16
+ "type" : "literal",
17
+ "value" : "http://ontotext-yasgui/generated-yri#"
18
+ }
19
+ }
20
+ ]
21
+ }
22
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "head" : {
3
+ "vars" : [
4
+ "s",
5
+ "p"
6
+ ]
7
+ },
8
+ "results" : {
9
+ "bindings" : [ ]
10
+ }
11
+ }
@@ -9,8 +9,7 @@ import {ReplaceNodesDialogSteps} from "../../steps/cluster/replace-nodes-dialog-
9
9
  import {ApplicationSteps} from "../../steps/application-steps";
10
10
  import {ClusterViewSteps} from "../../steps/cluster/cluster-view-steps";
11
11
 
12
- // TODO: removed for GDB10.5 version due to instability of the cluster in the backend
13
- describe.skip('Cluster management', () => {
12
+ describe('Cluster management', () => {
14
13
 
15
14
  let repositoryId;
16
15
 
@@ -1,3 +1,5 @@
1
+ import {YasrSteps} from "../../steps/yasgui/yasr-steps";
2
+
1
3
  const EXPORT_GRAPHS_TABLE_ID = '#export-graphs';
2
4
  const ROWS_PER_PAGE_20 = '1';
3
5
  const ROWS_PER_PAGE_ALL = '2';
@@ -118,7 +120,7 @@ describe('Graphs overview screen validation', () => {
118
120
  // open default graph through the link and verify that the table view is rendered
119
121
  cy.contains('The default graph').click();
120
122
  cy.url().should('contain', Cypress.config('baseUrl') + '/resource');
121
- cy.get('.resultsTable').should('be.visible')
122
- .find('thead th').should('have.length', 5);
123
+ YasrSteps.getResultTableHeader().should('be.visible');
124
+ YasrSteps.getResultTableHeaderColumns().should('have.length', 5);
123
125
  });
124
126
  });
@@ -0,0 +1,333 @@
1
+ import {SimilarityIndexCreateSteps} from "../../steps/explore/similarity-index-create-steps";
2
+ import {ErrorSteps} from "../../steps/error-steps";
3
+ import {YasqeSteps} from "../../steps/yasgui/yasqe-steps";
4
+
5
+ const FILE_TO_IMPORT = 'people.zip';
6
+ const INSERT_QUERY = 'PREFIX dc: <http://purl.org/dc/elements/1.1/>\n INSERT DATA\n{\nGRAPH <http://example> {\n<http://example/book1> dc:title "A new book" ;\ndc:creator "A.N.Other" .\n}\n}';
7
+ const INVALID_QUERY = 'SELECT ?documentID ?documentText { invalid query \n\t?documentID ?p ?documentText .\n\tfilter(isLiteral(?documentText))\n}';
8
+ const DEFAULT_SELECT_QUERY = 'SELECT ?documentID ?documentText {\n\t?documentID ?p ?documentText .\n\tfilter(isLiteral(?documentText))\n}';
9
+ const DEFAULT_SEARCH_QUERY = 'SELECT ?documentID ?score {\n ?search a ?index ;\n ?searchType ?query;\n :searchParameters ?parameters;\n ?resultType ?result .\n ?result :value ?documentID ;\n :score ?score.\n}';
10
+ const DEFAULT_ANALOGICAL_QUERY = 'SELECT?resultValue?score{?searcha?index;psi:givenSubject?givenSubject;psi:givenObject?givenObject;psi:searchSubject?searchSubject;:searchParameters?parameters;psi:resultObject?result.?result:value?resultValue;:score?score.}';
11
+ const DEFAULT_PREDICATION_SELECT_QUERY = 'SELECT ?subject ?predicate ?object\nWHERE {\n ?subject ?predicate ?object .\n}';
12
+ const DEFAULT_PREDICATION_SEARCH_QUERY = 'SELECT ?entity ?score {\n ?search a ?index ;\n ?searchType ?query;\n psi:searchPredicate ?psiPredicate;\n :searchParameters ?parameters;\n ?resultType ?result .\n ?result :value ?entity ;\n :score ?score .\n}';
13
+
14
+ describe('Create similarity index', () => {
15
+ let secondRepositoryId;
16
+ let repositoryId;
17
+
18
+ beforeEach(() => {
19
+ const repositoryId = 'similarity-index-create' + Date.now();
20
+ cy.createRepository({id: repositoryId});
21
+ cy.presetRepository(repositoryId);
22
+ cy.importServerFile(repositoryId, FILE_TO_IMPORT);
23
+ SimilarityIndexCreateSteps.visit();
24
+ });
25
+
26
+ afterEach(() => {
27
+ cy.deleteRepository(repositoryId);
28
+ cy.deleteRepository(secondRepositoryId);
29
+ });
30
+
31
+ context('Validations for textual similarity index', () => {
32
+
33
+ it('should not allow to create a similarity index without name', () => {
34
+ // Given I am on "Create similarity index" page.
35
+ // When I try to create a text index.
36
+ SimilarityIndexCreateSteps.create();
37
+
38
+ // Then I expect see error message describes me, that name is mandatory.
39
+ ErrorSteps.verifyError('Index name cannot be empty');
40
+ });
41
+
42
+ it('should not allow to create a similarity index without select query', () => {
43
+ // Given I am on "Create similarity index" page.
44
+ // When I fill similarity index name,
45
+ SimilarityIndexCreateSteps.typeSimilarityIndexName('indexName');
46
+ // and try to create index without select query.
47
+ YasqeSteps.clearEditor();
48
+ SimilarityIndexCreateSteps.create();
49
+
50
+ // Then I expect see error message describes me, that select query is mandatory.
51
+ ErrorSteps.verifyError("The 'Data' query cannot be empty.");
52
+ });
53
+
54
+ it('should not allow to create a similarity index with select query', () => {
55
+ // Given I am on "Create similarity index" page.
56
+ // When I fill similarity index name,
57
+ SimilarityIndexCreateSteps.typeSimilarityIndexName('indexName');
58
+ // and try to create index with update select query.
59
+ YasqeSteps.pasteQuery(INSERT_QUERY);
60
+
61
+ SimilarityIndexCreateSteps.create();
62
+
63
+ // Then I expect see error message describes me, that select query must be a SELECT.
64
+ ErrorSteps.verifyError("The 'Data' query must be a SELECT query");
65
+ });
66
+
67
+ it('should not allow to create a similarity index with invalid select query', () => {
68
+ // Given I am on "Create similarity index" page.
69
+ // When I fill similarity index name,
70
+ SimilarityIndexCreateSteps.typeSimilarityIndexName('indexName');
71
+ // and try to create index with update select query.
72
+ YasqeSteps.pasteQuery(INVALID_QUERY);
73
+
74
+ SimilarityIndexCreateSteps.create();
75
+
76
+ // Then I expect see error message describes me, that select query must be a SELECT.
77
+ ErrorSteps.verifyError("Invalid 'Data' query");
78
+ });
79
+
80
+ it('should not allow to create a similarity index without search query', () => {
81
+ // Given I am on "Create similarity index" page.
82
+ // When I fill similarity index name,
83
+ SimilarityIndexCreateSteps.typeSimilarityIndexName('indexName');
84
+ // and try to create index without search query.
85
+ SimilarityIndexCreateSteps.switchToSearchQueryTab();
86
+ YasqeSteps.clearEditor();
87
+ SimilarityIndexCreateSteps.create();
88
+
89
+ // Then I expect see error message describes me, that search query is mandatory.
90
+ ErrorSteps.verifyError("The 'Search' query cannot be empty.");
91
+ });
92
+
93
+ it('should not allow to create a similarity index with search query', () => {
94
+ // Given I am on "Create similarity index" page.
95
+ // When I fill similarity index name,
96
+ SimilarityIndexCreateSteps.typeSimilarityIndexName('indexName');
97
+ // and try to create index with update search query.
98
+ SimilarityIndexCreateSteps.switchToSearchQueryTab();
99
+ YasqeSteps.pasteQuery(INSERT_QUERY);
100
+
101
+ SimilarityIndexCreateSteps.create();
102
+
103
+ // Then I expect see error message describes me, that search query must be a SELECT.
104
+ ErrorSteps.verifyError("The 'Search' query must be a SELECT query");
105
+ });
106
+
107
+ it('should not allow to create a similarity index with invalid search query', () => {
108
+ // Given I am on "Create similarity index" page.
109
+ // When I fill similarity index name,
110
+ SimilarityIndexCreateSteps.typeSimilarityIndexName('indexName');
111
+ // and try to create index with update search query.
112
+ SimilarityIndexCreateSteps.switchToSearchQueryTab();
113
+ YasqeSteps.pasteQuery(INVALID_QUERY);
114
+
115
+ SimilarityIndexCreateSteps.create();
116
+
117
+ // Then I expect see error message describes me, that search query must be a SELECT.
118
+ ErrorSteps.verifyError("Invalid 'Search' query");
119
+ });
120
+
121
+ it('should show error icon on top-right corner of tabs with invalid query', () => {
122
+ // Given I am on "Create similarity index" page.
123
+ // When I fill similarity index name,
124
+ SimilarityIndexCreateSteps.typeSimilarityIndexName('indexName');
125
+ // and try to create index with invalid select query.
126
+ SimilarityIndexCreateSteps.switchToSearchQueryTab();
127
+ YasqeSteps.pasteQuery(INVALID_QUERY);
128
+
129
+ SimilarityIndexCreateSteps.create();
130
+
131
+ // Then I expect to see an icon in the top-right corner of the 'Data query' tab.
132
+ SimilarityIndexCreateSteps.getSearchQueryTab().find('.tab-error').should('exist');
133
+ });
134
+ });
135
+
136
+ context('Validations for predication similarity index', () => {
137
+
138
+ it('should not allow to create a similarity index without name', () => {
139
+ // Given I am on "Create similarity index" page.
140
+ // When I try to create a predication index.
141
+ SimilarityIndexCreateSteps.switchToCreatePredictionIndexTab();
142
+ SimilarityIndexCreateSteps.create();
143
+
144
+ // Then I expect see error message describes me, that name is mandatory.
145
+ ErrorSteps.verifyError('Index name cannot be empty');
146
+ });
147
+
148
+ it('should not allow to create a similarity index without select query', () => {
149
+ // Given I am on "Create similarity index" page.
150
+ // When I fill similarity index name,
151
+ SimilarityIndexCreateSteps.switchToCreatePredictionIndexTab();
152
+ SimilarityIndexCreateSteps.typeSimilarityIndexName('indexName');
153
+ // and try to create index without select query.
154
+ YasqeSteps.clearEditor();
155
+ SimilarityIndexCreateSteps.create();
156
+
157
+ // Then I expect see error message describes me, that select query is mandatory.
158
+ ErrorSteps.verifyError("The 'Data' query cannot be empty.");
159
+ });
160
+
161
+ it('should not allow to create a similarity index with select query', () => {
162
+ // Given I am on "Create similarity index" page.
163
+ // When I fill similarity index name,
164
+ SimilarityIndexCreateSteps.switchToCreatePredictionIndexTab();
165
+ SimilarityIndexCreateSteps.typeSimilarityIndexName('indexName');
166
+ // and try to create index with update select query.
167
+ YasqeSteps.pasteQuery(INSERT_QUERY);
168
+
169
+ SimilarityIndexCreateSteps.create();
170
+
171
+ // Then I expect see error message describes me, that select query must be a SELECT.
172
+ ErrorSteps.verifyError("The 'Data' query must be a SELECT query");
173
+ });
174
+
175
+ it('should not allow to create a similarity index with invalid select query', () => {
176
+ // Given I am on "Create similarity index" page.
177
+ // When I fill similarity index name,
178
+ SimilarityIndexCreateSteps.switchToCreatePredictionIndexTab();
179
+ SimilarityIndexCreateSteps.typeSimilarityIndexName('indexName');
180
+ // and try to create index with update select query.
181
+ YasqeSteps.pasteQuery(INVALID_QUERY);
182
+
183
+ SimilarityIndexCreateSteps.create();
184
+
185
+ // Then I expect see error message describes me, that select query must be a SELECT.
186
+ ErrorSteps.verifyError("Invalid 'Data' query");
187
+ });
188
+
189
+ it('should not allow to create a similarity index without search query', () => {
190
+ // Given I am on "Create similarity index" page.
191
+ // When I fill similarity index name,
192
+ SimilarityIndexCreateSteps.switchToCreatePredictionIndexTab();
193
+ SimilarityIndexCreateSteps.typeSimilarityIndexName('indexName');
194
+ // and try to create index without search query.
195
+ SimilarityIndexCreateSteps.switchToSearchQueryTab();
196
+ YasqeSteps.clearEditor();
197
+ SimilarityIndexCreateSteps.create();
198
+
199
+ // Then I expect see error message describes me, that select query is mandatory.
200
+ ErrorSteps.verifyError("The 'Search' query cannot be empty.");
201
+ });
202
+
203
+ it('should not allow to create a similarity index with search query', () => {
204
+ // Given I am on "Create similarity index" page.
205
+ // When I fill similarity index name,
206
+ SimilarityIndexCreateSteps.switchToCreatePredictionIndexTab();
207
+ SimilarityIndexCreateSteps.typeSimilarityIndexName('indexName');
208
+ // and try to create index with update search query.
209
+ SimilarityIndexCreateSteps.switchToSearchQueryTab();
210
+ YasqeSteps.pasteQuery(INSERT_QUERY);
211
+
212
+ SimilarityIndexCreateSteps.create();
213
+
214
+ // Then I expect see error message describes me, that select query must be a SELECT.
215
+ ErrorSteps.verifyError("The 'Search' query must be a SELECT query");
216
+ });
217
+
218
+ it('should not allow to create a similarity index with invalid search query', () => {
219
+ // Given I am on "Create similarity index" page.
220
+ // When I fill similarity index name,
221
+ SimilarityIndexCreateSteps.switchToCreatePredictionIndexTab();
222
+ SimilarityIndexCreateSteps.typeSimilarityIndexName('indexName');
223
+ // and try to create index with update search query.
224
+ SimilarityIndexCreateSteps.switchToSearchQueryTab();
225
+ YasqeSteps.pasteQuery(INVALID_QUERY);
226
+
227
+ SimilarityIndexCreateSteps.create();
228
+
229
+ // Then I expect see error message describes me, that select query must be a SELECT.
230
+ ErrorSteps.verifyError("Invalid 'Search' query");
231
+ });
232
+
233
+ it('should not allow to create a similarity index without analogical query', () => {
234
+ // Given I am on "Create similarity index" page.
235
+ // When I fill similarity index name,
236
+ SimilarityIndexCreateSteps.switchToCreatePredictionIndexTab();
237
+ SimilarityIndexCreateSteps.typeSimilarityIndexName('indexName');
238
+ // and try to create index without analogical query.
239
+ SimilarityIndexCreateSteps.switchToAnalogicalQueryTab();
240
+ YasqeSteps.clearEditor();
241
+ SimilarityIndexCreateSteps.create();
242
+
243
+ // Then I expect see error message describes me, that analogical query is mandatory.
244
+ ErrorSteps.verifyError("The 'Analogical' query cannot be empty.");
245
+ });
246
+
247
+ it('should not allow to create a similarity index with analogical query', () => {
248
+ // Given I am on "Create similarity index" page.
249
+ // When I fill similarity index name,
250
+ SimilarityIndexCreateSteps.switchToCreatePredictionIndexTab();
251
+ // cy.pause()
252
+ SimilarityIndexCreateSteps.typeSimilarityIndexName('indexName');
253
+ // and try to create index with update analogical query.
254
+ SimilarityIndexCreateSteps.switchToAnalogicalQueryTab();
255
+ YasqeSteps.pasteQuery(INSERT_QUERY);
256
+
257
+ SimilarityIndexCreateSteps.create();
258
+
259
+ // Then I expect see error message describes me, that analogical query must be a SELECT.
260
+ ErrorSteps.verifyError("The 'Analogical' query must be a SELECT query");
261
+ });
262
+
263
+ it('should not allow to create a similarity index with invalid analogical query', () => {
264
+ // Given I am on "Create similarity index" page.
265
+ // When I fill similarity index name,
266
+ SimilarityIndexCreateSteps.switchToCreatePredictionIndexTab();
267
+ SimilarityIndexCreateSteps.typeSimilarityIndexName('indexName');
268
+ // and try to create index with update analogical query.
269
+ SimilarityIndexCreateSteps.switchToAnalogicalQueryTab();
270
+ YasqeSteps.pasteQuery(INVALID_QUERY);
271
+
272
+ SimilarityIndexCreateSteps.create();
273
+
274
+ // Then I expect see error message describes me, that analogical query must be a SELECT.
275
+ ErrorSteps.verifyError("Invalid 'Analogical' query");
276
+ });
277
+
278
+ it('should show error icon on top-right corner of tabs with invalid query', () => {
279
+ // Given I am on "Create similarity index" page.
280
+ // When I fill similarity index name,
281
+ SimilarityIndexCreateSteps.switchToCreatePredictionIndexTab();
282
+ SimilarityIndexCreateSteps.typeSimilarityIndexName('indexName');
283
+ // and try to create index with invalid analogical query.
284
+ SimilarityIndexCreateSteps.switchToSearchQueryTab();
285
+ YasqeSteps.pasteQuery(INVALID_QUERY);
286
+ SimilarityIndexCreateSteps.switchToAnalogicalQueryTab();
287
+ YasqeSteps.pasteQuery(INSERT_QUERY);
288
+
289
+ SimilarityIndexCreateSteps.create();
290
+
291
+ // Then I expect to see an icon in the top-right corner of the 'Data query' tab.
292
+ SimilarityIndexCreateSteps.getSearchQueryTab().find('.tab-error').should('exist');
293
+ SimilarityIndexCreateSteps.getAnalogicalQueryTab().find('.tab-error').should('exist');
294
+ });
295
+ });
296
+
297
+ context('Validate value queries', () => {
298
+
299
+ it('should fill correct queries when query tabs are changed', () => {
300
+ // When I open the "Create similarity index" page.
301
+ // Then I expect select query to be active.
302
+ SimilarityIndexCreateSteps.checkSelectQueryTabActive();
303
+ YasqeSteps.verifyQueryContains(DEFAULT_SELECT_QUERY);
304
+ SimilarityIndexCreateSteps.switchToSearchQueryTab();
305
+ YasqeSteps.verifyQueryContains(DEFAULT_SEARCH_QUERY);
306
+ SimilarityIndexCreateSteps.switchToCreatePredictionIndexTab();
307
+ SimilarityIndexCreateSteps.checkSelectQueryTabActive();
308
+ YasqeSteps.verifyQueryContains(DEFAULT_PREDICATION_SELECT_QUERY);
309
+ SimilarityIndexCreateSteps.switchToSearchQueryTab();
310
+ YasqeSteps.verifyQueryContains(DEFAULT_PREDICATION_SEARCH_QUERY);
311
+ SimilarityIndexCreateSteps.switchToAnalogicalQueryTab();
312
+ YasqeSteps.verifyQueryContains(DEFAULT_ANALOGICAL_QUERY);
313
+ });
314
+
315
+ it('should not display query error if current displayed query is valid', () => {
316
+ // When I open the "Create similarity index" page.
317
+ // and type wrong select query.
318
+ SimilarityIndexCreateSteps.typeSimilarityIndexName('indexName');
319
+ YasqeSteps.pasteQuery('Wrong query');
320
+ SimilarityIndexCreateSteps.create();
321
+
322
+ // Then I expect see error message describes me, that select query is mandatory.
323
+ ErrorSteps.verifyError("Invalid 'Data' query");
324
+
325
+ // When I switch to search query tab.
326
+ SimilarityIndexCreateSteps.switchToSearchQueryTab();
327
+
328
+ // Then I expect to not see the error message.
329
+ ErrorSteps.getErrorElement().should('not.exist');
330
+
331
+ });
332
+ });
333
+ });