graphdb-workbench-tests 2.3.1 → 2.4.0-TR1
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.
- package/fixtures/graphdb-import/resource-test-data.ttl +99 -0
- package/fixtures/graphql-editor/default-query-response.json +517 -0
- package/fixtures/locale-en.json +18 -5
- package/fixtures/namespaces/ontotext-generated-namespace.json +22 -0
- package/fixtures/queries/empty-query-response.json +11 -0
- package/integration/explore/graphs.overview.spec.js +4 -2
- package/integration/explore/similariti-index-create.spec.js +315 -0
- package/integration/explore/similarity-index.spec.js +88 -0
- package/integration/explore/similarity.spec.js +156 -47
- package/integration/explore/visual-graph/graphs-config.spec.js +452 -0
- package/integration/explore/{visual.graph.spec.js → visual-graph/visual.graph.spec.js} +145 -348
- package/integration/home/language-change.spec.js +3 -3
- package/integration/import/import.user.data.spec.js +4 -4
- package/integration/resource/resource.spec.js +354 -0
- package/integration/setup/jdbc-create.spec.js +316 -0
- package/integration/setup/jdbc.spec.js +99 -178
- package/integration/setup/my-settings.spec.js +9 -41
- package/integration/setup/sparql-template-create.js +141 -0
- package/integration/setup/sparql-templates.spec.js +82 -146
- package/integration/sparql-editor/actions/execute-query.spec.js +44 -0
- package/integration/sparql-editor/actions/expand-results-over-sameas.spec.js +136 -0
- package/integration/sparql-editor/actions/include-inferred-statements.spec.js +100 -0
- package/integration/sparql-editor/actions/save-query.spec.js +70 -0
- package/integration/sparql-editor/actions/show-saved-queries.spec.js +61 -0
- package/integration/sparql-editor/internationalization.spec.js +41 -0
- package/integration/sparql-editor/saved-query/abort-query.spec.js +60 -0
- package/integration/sparql-editor/saved-query/delete-query.spec.js +56 -0
- package/integration/sparql-editor/saved-query/edit-query.spec.js +68 -0
- package/integration/sparql-editor/saved-query/share-query.spec.js +78 -0
- package/integration/sparql-editor/sparql-editor.spec.js +20 -0
- package/integration/sparql-editor/yasgui-tabs.spec.js +107 -0
- package/integration/sparql-editor/yasr/download-as.spec.js +62 -0
- package/integration/sparql-editor/yasr/pagination.spec.js +234 -0
- package/integration/sparql-editor/yasr/table-plugin.spec.js +191 -0
- package/integration/sparql-editor/yasr/toolbar/visual-button.spec.js +56 -0
- package/integration-flaky/setup/sparql-template-create.js +139 -0
- package/integration-flaky/sparql-editor/actions/execute-update-query.spec.js +89 -0
- package/integration-flaky/sparql-editor/actions/share-query.spec.js +84 -0
- package/integration-flaky/sparql-editor/lucene-connector.spec.js +62 -0
- package/package.json +3 -2
- package/steps/application-steps.js +23 -0
- package/steps/error-steps.js +9 -0
- package/steps/explore/graphs-overview-steps.js +24 -0
- package/steps/explore/similarity-index-create-steps.js +113 -0
- package/steps/explore/similarity-indexes-steps.js +18 -0
- package/steps/import-steps.js +8 -1
- package/steps/language-selector-steps.js +22 -0
- package/steps/loader-steps.js +10 -0
- package/steps/lucene-connector-steps.js +43 -0
- package/steps/main-menu-steps.js +39 -0
- package/steps/modal-dialog-steps.js +113 -0
- package/steps/repository-selector-steps.js +26 -0
- package/steps/resource/resource-edit-steps.js +111 -0
- package/steps/resource/resource-steps.js +145 -0
- package/steps/setup/jdbc-create-steps.js +97 -0
- package/steps/setup/jdbc-steps.js +42 -0
- package/steps/setup/sparql-create-update-steps.js +55 -0
- package/steps/setup/sparql-templates-steps.js +34 -0
- package/steps/sparql-editor-steps.js +20 -0
- package/steps/visual-graph-steps.js +340 -3
- package/steps/yasgui/confirmation-dialog-steps.js +13 -0
- package/steps/yasgui/pagination-steps.js +47 -0
- package/steps/yasgui/plugin/error-plugin-steps.js +10 -0
- package/steps/yasgui/save-query-dialog.js +61 -0
- package/steps/yasgui/saved-queries-dialog.js +29 -0
- package/steps/yasgui/saved-query.js +25 -0
- package/steps/yasgui/share-saved-query-dialog.js +25 -0
- package/steps/yasgui/table-plugin-steps.js +29 -0
- package/steps/yasgui/yasgui-steps.js +191 -0
- package/steps/yasgui/yasqe-steps.js +187 -0
- package/steps/yasgui/yasr-steps.js +105 -0
- package/stubs/namespace-stubs.js +10 -0
- package/stubs/security-stubs.js +69 -0
- package/stubs/yasgui/connectors-stubs.js +12 -0
- package/stubs/yasgui/query-stubs.js +258 -0
- package/support/index.js +2 -0
- package/support/repository-commands.js +6 -1
- package/support/sparql-commands.js +1 -1
- package/support/visual-graph-commands.js +25 -0
- package/integration/sparql/main.menu.spec.js +0 -196
- package/integration/sparql/sparql-error-handling.spec.js +0 -74
- package/integration/sparql/sparql-language-change.spec.js +0 -58
- package/integration/sparql/sparql-result-formating.spec.js +0 -84
- package/integration/sparql/sparql.menu.spec.js +0 -1244
- package/integration-flaky/setup/sparql-templates.spec.js +0 -125
- package/integration-flaky/sparql/sparql-language-change.spec.js +0 -45
- package/integration-flaky/sparql/sparql.menu.spec.js +0 -75
- package/steps/sparql-steps.js +0 -227
package/fixtures/locale-en.json
CHANGED
|
@@ -258,6 +258,7 @@
|
|
|
258
258
|
"new.sentence.start": "New",
|
|
259
259
|
"no.connectors.available": "No connectors available",
|
|
260
260
|
"current.repo.no.connector.support": "The current repository does not support any connectors. Please check the type of the repository or select another one.",
|
|
261
|
+
"edit.select.query": "Edit select query",
|
|
261
262
|
"edit.search.query": "Edit search query",
|
|
262
263
|
"edit.analogical.query": "Edit analogical query",
|
|
263
264
|
"current.repo.error": "The currently selected repository cannot be used for queries due to an error:",
|
|
@@ -536,6 +537,7 @@
|
|
|
536
537
|
"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.",
|
|
537
538
|
"view.jdbc.create.title": "SQL table configuration",
|
|
538
539
|
"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.",
|
|
540
|
+
"view.jdbc.create.get_suggestion_sql_type": "Get suggestion...",
|
|
539
541
|
"jdbc.column.names.constraint": "Column names must be placed in array.",
|
|
540
542
|
"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.",
|
|
541
543
|
"view.query.and.update.monitoring.title": "Query and Update monitoring",
|
|
@@ -828,6 +830,7 @@
|
|
|
828
830
|
"import.reset.status": "Reset status",
|
|
829
831
|
"import.remove.selected": "Remove the selected items from the list",
|
|
830
832
|
"import.remove.btn": "Remove",
|
|
833
|
+
"import.remove.confirm.msg": "Are you sure you want to remove selected files: '{{name}}'?",
|
|
831
834
|
"import.last.import.settings": "Last import settings",
|
|
832
835
|
"import.mode.not.supported.constraint": "This mode is not supported when importing multiple items.",
|
|
833
836
|
"import.enable.replace.option": "Enable this to replace the data in one or more graphs with the imported data.",
|
|
@@ -914,7 +917,7 @@
|
|
|
914
917
|
"jdbc.not.delete.sql.msg": "Could not delete SQL table",
|
|
915
918
|
"jdbc.warning.unsaved.changes": "You have unsaved changes. Are you sure that you want to exit?",
|
|
916
919
|
"jdbc.not.get.sql.msg2": "Could not get SQL table configuration",
|
|
917
|
-
"jdbc.required.configuration.name": "SQL
|
|
920
|
+
"jdbc.required.configuration.name": "SQL table name is required",
|
|
918
921
|
"jdbc.saved.configuration": "SQL table configuration saved",
|
|
919
922
|
"jdbc.not.saved.configuration": "Could not save SQL table configuration",
|
|
920
923
|
"jdbc.configuration.updated": "SQL table configuration updated",
|
|
@@ -1234,13 +1237,17 @@
|
|
|
1234
1237
|
"similarity.could.not.get.indexes.error": "Could not get indexes",
|
|
1235
1238
|
"similarity.empty.index.name.error": "Index name cannot be empty",
|
|
1236
1239
|
"similarity.index.name.constraint": "Index name can contain only letters (a-z, A-Z), numbers (0-9), \"-\" and \"_\"",
|
|
1237
|
-
"similarity.
|
|
1238
|
-
"similarity.
|
|
1239
|
-
"similarity.
|
|
1240
|
+
"similarity.query.type.DATA.name": "Data",
|
|
1241
|
+
"similarity.query.type.SEARCH.name": "Search",
|
|
1242
|
+
"similarity.query.type.ANALOGICAL.name": "Analogical",
|
|
1243
|
+
"similarity.error.query.empty": "The '{{queryType}}' query cannot be empty.",
|
|
1244
|
+
"similarity.error.query.invalid": "Invalid '{{queryType}}' query",
|
|
1245
|
+
"similarity.error.query.invalid_type": "The '{{queryType}}' query must be a SELECT query",
|
|
1240
1246
|
"similarity.index.select.queries.constraint": "Similarity index requires SELECT queries.",
|
|
1241
1247
|
"similarity.could.not.get.search.queries.error": "Could not get search queries",
|
|
1242
1248
|
"similarity.existing.index.name.error": "Index with this name already exists.",
|
|
1243
1249
|
"similarity.create.index.error": "Could not create index",
|
|
1250
|
+
"similarity.create.index.successfully": "Similarity index created successfully.",
|
|
1244
1251
|
"similarity.indexes.select.queries.constraint": "Similarity indexes work only with SELECT queries.",
|
|
1245
1252
|
"similarity.explain.select.queries.constraint": "Explain only works with SELECT queries.",
|
|
1246
1253
|
"cannot.execute.update.error": "Cannot execute updates from this editor.",
|
|
@@ -1254,6 +1261,8 @@
|
|
|
1254
1261
|
"similarity.get.resource.error": "Could not get resource!",
|
|
1255
1262
|
"similarity.delete.index.warning": "Are you sure you want to delete the index '{{name}}'?",
|
|
1256
1263
|
"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!",
|
|
1264
|
+
"similarity.copy_of.prefix": "Copy_of",
|
|
1265
|
+
"similarity.warning.unsaved.changes": "You have unsaved changes. Are you sure that you want to exit?",
|
|
1257
1266
|
"sparql.template.get.templates.error": "Could not get SPARQL templates",
|
|
1258
1267
|
"sparql.template.delete.template.warning": "Are you sure you want to delete the SPARQL template '{{templateID}}'?",
|
|
1259
1268
|
"sparql.template.delete.template.success": "Deleted successfully SPARQL template",
|
|
@@ -1264,6 +1273,7 @@
|
|
|
1264
1273
|
"update.sparql.template.success.msg": "Updated SPARQL template",
|
|
1265
1274
|
"save.sparql.template.failure.msg": "Could not save {{templateID}} template",
|
|
1266
1275
|
"sparql.template.query.constraint": "The template query must be an UPDATE query",
|
|
1276
|
+
"sparql.template.query.invalid": "Invalid query",
|
|
1267
1277
|
"save.sparql.template.success.msg": "Saved SPARQL template",
|
|
1268
1278
|
"attach.remote.gdb.instance": "Attach a remote GraphDB instance",
|
|
1269
1279
|
"remote.location.url": "Location URL*",
|
|
@@ -1554,6 +1564,7 @@
|
|
|
1554
1564
|
"visual.config.search.box.starting.point": "Starting point - Search box",
|
|
1555
1565
|
"visual.config.query.results.starting.point": "Starting point - Query results",
|
|
1556
1566
|
"visual.config.fixed.resource.starting.point": "Starting point - Fixed resource",
|
|
1567
|
+
"visual.config.warning.unsaved.changes": "You have unsaved changes. Are you sure that you want to exit?",
|
|
1557
1568
|
"visual.edit.config": "Edit configuration",
|
|
1558
1569
|
"visual.delete.config": "Delete configuration",
|
|
1559
1570
|
"visual.saved.graphs": "Saved graphs",
|
|
@@ -1809,5 +1820,7 @@
|
|
|
1809
1820
|
"guide.step_plugin.welcome-what.content": "{{translatedGuideDescription}}<p>Let's get started for real now!</p>",
|
|
1810
1821
|
"guide.confirm.cancel.message": "Are you sure you want to stop the guide?",
|
|
1811
1822
|
"guide.unexpected.error.message": "The guide was cancelled due to an unexpected error. Please run the guide again and if the problem persists contact the support.",
|
|
1812
|
-
"guide.start.unexpected.error.message": "The guide cannot be started due to an unexpected error. Please try running the guide again and if the problem persists contact the support."
|
|
1823
|
+
"guide.start.unexpected.error.message": "The guide cannot be started due to an unexpected error. Please try running the guide again and if the problem persists contact the support.",
|
|
1824
|
+
"view.sparql-editor.title": "Ontotext Yasgui SPARQL Query & Update",
|
|
1825
|
+
"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."
|
|
1813
1826
|
}
|
|
@@ -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
|
+
}
|
|
@@ -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
|
-
|
|
122
|
-
|
|
123
|
+
YasrSteps.getResultTableHeader().should('be.visible');
|
|
124
|
+
YasrSteps.getResultTableHeaderColumns().should('have.length', 5);
|
|
123
125
|
});
|
|
124
126
|
});
|
|
@@ -0,0 +1,315 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import {SimilarityIndexCreateSteps} from "../../steps/explore/similarity-index-create-steps";
|
|
2
|
+
import {RepositorySelectorSteps} from "../../steps/repository-selector-steps";
|
|
3
|
+
import {YasqeSteps} from "../../steps/yasgui/yasqe-steps";
|
|
4
|
+
import {ModalDialogSteps, VerifyConfirmationDialogOptions} from "../../steps/modal-dialog-steps";
|
|
5
|
+
import {SimilarityIndexesSteps} from "../../steps/explore/similarity-indexes-steps";
|
|
6
|
+
|
|
7
|
+
const FILE_TO_IMPORT = 'people.zip';
|
|
8
|
+
|
|
9
|
+
describe('Confirmations when try to change repository', () => {
|
|
10
|
+
|
|
11
|
+
let secondRepositoryId;
|
|
12
|
+
let repositoryId;
|
|
13
|
+
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
const repositoryId = 'similarity-index-' + Date.now();
|
|
16
|
+
cy.createRepository({id: repositoryId});
|
|
17
|
+
cy.presetRepository(repositoryId);
|
|
18
|
+
cy.importServerFile(repositoryId, FILE_TO_IMPORT);
|
|
19
|
+
secondRepositoryId = 'create-similarity-index-second-repo' + Date.now();
|
|
20
|
+
cy.createRepository({id: secondRepositoryId});
|
|
21
|
+
SimilarityIndexCreateSteps.visit();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
afterEach(() => {
|
|
25
|
+
cy.deleteRepository(repositoryId);
|
|
26
|
+
cy.deleteRepository(secondRepositoryId);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('should not display confirm message if create similarity form is dirty and try to change repository', () => {
|
|
30
|
+
// Given I opened the create similarity view,
|
|
31
|
+
// and create similarity form is dirty.
|
|
32
|
+
SimilarityIndexCreateSteps.typeSimilarityIndexName('index name');
|
|
33
|
+
|
|
34
|
+
// When I change the repository.
|
|
35
|
+
RepositorySelectorSteps.selectRepository(secondRepositoryId);
|
|
36
|
+
// Then I expect to not be redirected to similarity indexes view.
|
|
37
|
+
SimilarityIndexCreateSteps.verifyUrl();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('should display confirm message if edit similarity create form is dirty (Search query changed) and try to change repository', () => {
|
|
41
|
+
const similarityIndexName = 'SimilarityIndex';
|
|
42
|
+
YasqeSteps.waitUntilQueryIsVisible();
|
|
43
|
+
SimilarityIndexCreateSteps.typeSimilarityIndexName(similarityIndexName);
|
|
44
|
+
SimilarityIndexCreateSteps.create();
|
|
45
|
+
SimilarityIndexesSteps.getEditButton(similarityIndexName).click();
|
|
46
|
+
|
|
47
|
+
// Given I opened the edit similarity view,
|
|
48
|
+
// During the initialization query is changed and this broke the test.
|
|
49
|
+
// Most the time the broken flow is:
|
|
50
|
+
// 1. cypress start to type 's';
|
|
51
|
+
// 2. query is changed
|
|
52
|
+
// 3. cypress continuous to type 'ome changes'.
|
|
53
|
+
// as result query is 'ome changes<data query>. YasqeSteps.writeInEditor function has check if parameter is filled, in our case 'some changes',
|
|
54
|
+
// and this broke the test. Add a little wait time to give chance yasqe query to be filled.
|
|
55
|
+
cy.wait(1000);
|
|
56
|
+
// and change "Search query".
|
|
57
|
+
YasqeSteps.writeInEditor('some changes');
|
|
58
|
+
|
|
59
|
+
// When I try to change repository.
|
|
60
|
+
// Then I expect to be asked for confirmation to be redirected to similarity indexes view.
|
|
61
|
+
ModalDialogSteps.verifyUrlChangedConfirmation(createVerifyConfirmationDialogOptions());
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('should display confirm message if edit similarity create form is dirty (Analogical query changed) and try to change repository', () => {
|
|
65
|
+
// Given I opened the edit similarity view,
|
|
66
|
+
const similarityIndexName = 'SimilarityIndex';
|
|
67
|
+
YasqeSteps.waitUntilQueryIsVisible();
|
|
68
|
+
SimilarityIndexCreateSteps.typeSimilarityIndexName(similarityIndexName);
|
|
69
|
+
SimilarityIndexCreateSteps.switchToCreatePredictionIndexTab();
|
|
70
|
+
SimilarityIndexCreateSteps.create();
|
|
71
|
+
SimilarityIndexesSteps.getEditButton(similarityIndexName).click();
|
|
72
|
+
// and change "Analogical query".
|
|
73
|
+
SimilarityIndexCreateSteps.switchToAnalogicalQueryTab();
|
|
74
|
+
YasqeSteps.writeInEditor('some changes');
|
|
75
|
+
|
|
76
|
+
// When I try to change repository.
|
|
77
|
+
// Then I expect to be asked for confirmation to be redirected to similarity indexes view.
|
|
78
|
+
ModalDialogSteps.verifyUrlChangedConfirmation(createVerifyConfirmationDialogOptions());
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
function createVerifyConfirmationDialogOptions() {
|
|
82
|
+
return new VerifyConfirmationDialogOptions()
|
|
83
|
+
.setChangePageFunction(() => RepositorySelectorSteps.selectRepository(secondRepositoryId))
|
|
84
|
+
.setConfirmationMessage('You have unsaved changes. Are you sure that you want to exit?')
|
|
85
|
+
.setVerifyCurrentUrl(() => cy.url().should('include', `${Cypress.config('baseUrl')}/similarity/index/create`))
|
|
86
|
+
.setVerifyRedirectedUrl(() => cy.url().should('eq', `${Cypress.config('baseUrl')}/similarity`));
|
|
87
|
+
}
|
|
88
|
+
});
|