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.
- package/fixtures/graphdb-import/resource-test-data.ttl +99 -0
- package/fixtures/graphql-editor/default-query-response.json +517 -0
- package/fixtures/guides/guides.json +764 -0
- package/fixtures/guides/movies.ttl +629 -0
- package/fixtures/guides/starwars.ttl +4384 -0
- package/fixtures/locale-en.json +44 -10
- package/fixtures/namespaces/ontotext-generated-namespace.json +22 -0
- package/fixtures/queries/empty-query-response.json +11 -0
- package/integration/cluster/cluster-management.spec.js +1 -2
- package/integration/explore/graphs.overview.spec.js +4 -2
- package/integration/explore/similariti-index-create.spec.js +333 -0
- package/integration/explore/similarity-index.spec.js +88 -0
- package/integration/explore/similarity.spec.js +180 -56
- package/integration/explore/visual-graph/graphs-config.spec.js +453 -0
- package/integration/explore/{visual.graph.spec.js → visual-graph/visual.graph.spec.js} +146 -347
- package/integration/guides/movies-interactive-guide.spec.js +73 -0
- package/integration/guides/star-wars-interactive-guide.js +60 -0
- package/integration/home/language-change.spec.js +3 -3
- package/integration/import/import.user.data.spec.js +2 -0
- package/integration/resource/resource.spec.js +357 -0
- package/integration/setup/aclmanagement/create-rule.spec.js +88 -11
- package/integration/setup/aclmanagement/delete-rule.spec.js +6 -4
- package/integration/setup/aclmanagement/edit-rule.spec.js +13 -8
- package/integration/setup/aclmanagement/render-rules.spec.js +4 -2
- package/integration/setup/aclmanagement/reorder-rules.spec.js +5 -3
- package/integration/setup/aclmanagement/revert-rules.spec.js +4 -3
- package/integration/setup/aclmanagement/scopes.spec.js +220 -0
- package/integration/setup/aclmanagement/update-rules.spec.js +17 -9
- package/integration/setup/jdbc-create.spec.js +330 -0
- package/integration/setup/jdbc.spec.js +78 -154
- package/integration/setup/my-settings.spec.js +9 -41
- package/integration/setup/sparql-template-create.js +150 -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/inferred-sameas.spec.js +47 -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 +51 -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 +55 -0
- package/integration/sparql-editor/yasgui-tabs.spec.js +107 -0
- package/integration/sparql-editor/yasr/download-as.spec.js +54 -0
- package/integration/sparql-editor/yasr/pagination.spec.js +234 -0
- package/integration/sparql-editor/yasr/table-plugin.spec.js +39 -0
- package/integration/sparql-editor/yasr/toolbar/visual-graph-button.spec.js +57 -0
- package/integration-flaky/explore/visual.graph.spec.js +3 -2
- 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/integration-flaky/sparql-editor/plugins/error-plugin.spec.js +83 -0
- package/integration-flaky/sparql-editor/yasr/table-plugin.spec.js +81 -0
- package/package.json +3 -1
- package/steps/application-steps.js +5 -0
- package/steps/autocomplete-steps.js +10 -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/guides/guide-dialog-steps.js +38 -0
- package/steps/guides/guide-steps.js +278 -0
- package/steps/guides/movies-guide-steps.js +241 -0
- package/steps/guides/star-wars-guide-steps.js +188 -0
- package/steps/import-steps.js +16 -0
- 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 +67 -0
- package/steps/repository-selector-steps.js +26 -0
- package/steps/repository-steps.js +4 -0
- package/steps/resource/resource-edit-steps.js +111 -0
- package/steps/resource/resource-steps.js +149 -0
- package/steps/setup/acl-management-steps.js +193 -35
- 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 +38 -0
- package/steps/sparql-editor-steps.js +20 -0
- package/steps/sparql-steps.js +0 -6
- package/steps/visual-graph-steps.js +365 -6
- 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 +30 -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-loader.js +10 -0
- package/steps/yasgui/yasgui-steps.js +191 -0
- package/steps/yasgui/yasqe-steps.js +187 -0
- package/steps/yasgui/yasr-steps.js +108 -0
- package/stubs/namespace-stubs.js +10 -0
- package/stubs/repositories-stub.js +58 -0
- package/stubs/security-stubs.js +69 -0
- package/stubs/yasgui/connectors-stubs.js +12 -0
- package/stubs/yasgui/query-stubs.js +253 -0
- package/support/index.js +3 -0
- package/support/repository-commands.js +5 -5
- package/support/sparql-commands.js +1 -1
- package/support/visual-graph-commands.js +25 -0
- package/integration/sparql/main.menu.spec.js +0 -232
- 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 -1253
- 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
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import {JdbcSteps} from "../../steps/setup/jdbc-steps";
|
|
2
|
+
import {JdbcCreateSteps} from "../../steps/setup/jdbc-create-steps";
|
|
3
|
+
import {ToasterSteps} from "../../steps/toaster-steps";
|
|
4
|
+
import {YasrSteps} from "../../steps/yasgui/yasr-steps";
|
|
5
|
+
import {ModalDialogSteps, VerifyConfirmationDialogOptions} from "../../steps/modal-dialog-steps";
|
|
6
|
+
import {YasqeSteps} from "../../steps/yasgui/yasqe-steps";
|
|
7
|
+
import {MainMenuSteps} from "../../steps/main-menu-steps";
|
|
8
|
+
import {RepositorySelectorSteps} from "../../steps/repository-selector-steps";
|
|
9
|
+
import {YasguiLoader} from "../../steps/yasgui/yasgui-loader";
|
|
10
|
+
|
|
11
|
+
const FILE_TO_IMPORT = '200-row-allianz.ttl';
|
|
12
|
+
const DEFAULT_QUERY = 'PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n' +
|
|
13
|
+
'\n' +
|
|
14
|
+
'# Selects two variables to use as columns\n' +
|
|
15
|
+
'SELECT ?id ?label {\n' +
|
|
16
|
+
' ?id rdfs:label ?label\n' +
|
|
17
|
+
' # The following placeholder must be present in the query\n' +
|
|
18
|
+
' #!filter\n' +
|
|
19
|
+
'}';
|
|
20
|
+
|
|
21
|
+
describe('JDBC configuration', () => {
|
|
22
|
+
|
|
23
|
+
let repositoryId;
|
|
24
|
+
let secondRepositoryId;
|
|
25
|
+
|
|
26
|
+
beforeEach(() => {
|
|
27
|
+
repositoryId = 'jdbc-repo-' + Date.now();
|
|
28
|
+
secondRepositoryId = repositoryId + '-second';
|
|
29
|
+
cy.createRepository({id: repositoryId});
|
|
30
|
+
cy.createRepository({id: secondRepositoryId});
|
|
31
|
+
cy.presetRepository(repositoryId);
|
|
32
|
+
cy.importServerFile(repositoryId, FILE_TO_IMPORT);
|
|
33
|
+
JdbcCreateSteps.visit();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
afterEach(() => {
|
|
37
|
+
cy.deleteRepository(repositoryId);
|
|
38
|
+
cy.deleteRepository(secondRepositoryId);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('Should open saved jdbc configs catalog when repository is changed', () => {
|
|
42
|
+
// Given I have opened the jdbc configurations page
|
|
43
|
+
// When I change the repository
|
|
44
|
+
RepositorySelectorSteps.selectRepository(secondRepositoryId);
|
|
45
|
+
// Then I expect to see the jdbc config catalog page
|
|
46
|
+
JdbcSteps.verifyUrl();
|
|
47
|
+
// And the jdbc config catalog should be empty
|
|
48
|
+
JdbcSteps.getJDBCConfigurations().should('be.visible');
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('should not allow preview if query is invalid or column are not selected', () => {
|
|
52
|
+
// When I open the create JDBC configuration page,
|
|
53
|
+
// and click on "Preview" button.
|
|
54
|
+
JdbcCreateSteps.clickOnPreviewButton();
|
|
55
|
+
|
|
56
|
+
// Then I expect to see error notification,
|
|
57
|
+
ToasterSteps.verifyError('Please define at least one column');
|
|
58
|
+
// and "Column type" tab to be opened,
|
|
59
|
+
JdbcCreateSteps.getActiveTab().contains('Column types');
|
|
60
|
+
// and two columns to be suggested.
|
|
61
|
+
JdbcCreateSteps.getColumnSuggestionRows().should('have.length', 2);
|
|
62
|
+
|
|
63
|
+
// When I click "Preview" again.
|
|
64
|
+
JdbcCreateSteps.clickOnPreviewButton();
|
|
65
|
+
|
|
66
|
+
// Then I expect to see loader,
|
|
67
|
+
YasguiLoader.verifyMessage('Preview of first 100 rows of table', 1);
|
|
68
|
+
// and see the generated preview.
|
|
69
|
+
YasrSteps.getResults().should('be.visible');
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('should contains exactly columns in preview than selected in Columns type tag', () => {
|
|
73
|
+
// When I open the create JDBC configuration page,
|
|
74
|
+
JdbcCreateSteps.openColumnTypesTab();
|
|
75
|
+
// waite columns to be suggested,
|
|
76
|
+
JdbcCreateSteps.getColumnSuggestionRows().should('have.length', 2);
|
|
77
|
+
// and make preview on default query.
|
|
78
|
+
JdbcCreateSteps.clickOnPreviewButton();
|
|
79
|
+
|
|
80
|
+
// Then I expect to see three columns. One for index and others are from the query.
|
|
81
|
+
YasrSteps.getResultRowCells(1).should('have.length', 3);
|
|
82
|
+
|
|
83
|
+
// When I try to remove a column.
|
|
84
|
+
JdbcCreateSteps.openColumnTypesTab();
|
|
85
|
+
JdbcCreateSteps.clickOnDeleteColumnButton();
|
|
86
|
+
|
|
87
|
+
// Then I expect to be asked to confirm deletion of the column.
|
|
88
|
+
ModalDialogSteps.verifyDialogBody('Are you sure you want to delete the column \'id\'?');
|
|
89
|
+
|
|
90
|
+
// When I click on cancel button.
|
|
91
|
+
ModalDialogSteps.clickOnCancelButton();
|
|
92
|
+
|
|
93
|
+
// Then I expect the column not be deleted.
|
|
94
|
+
JdbcCreateSteps.getColumnSuggestionRows().should('have.length', 2);
|
|
95
|
+
|
|
96
|
+
// When I try to remove a column.
|
|
97
|
+
JdbcCreateSteps.openColumnTypesTab();
|
|
98
|
+
JdbcCreateSteps.clickOnDeleteColumnButton();
|
|
99
|
+
|
|
100
|
+
// Then I expect to be asked to confirm deletion of the column.
|
|
101
|
+
ModalDialogSteps.verifyDialogBody('Are you sure you want to delete the column \'id\'?');
|
|
102
|
+
|
|
103
|
+
// When I click on close button.
|
|
104
|
+
ModalDialogSteps.clickOnCloseButton();
|
|
105
|
+
|
|
106
|
+
// Then I expect the column not be deleted.
|
|
107
|
+
JdbcCreateSteps.getColumnSuggestionRows().should('have.length', 2);
|
|
108
|
+
|
|
109
|
+
// When I remove a column.
|
|
110
|
+
JdbcCreateSteps.openColumnTypesTab();
|
|
111
|
+
JdbcCreateSteps.clickOnDeleteColumnButton();
|
|
112
|
+
|
|
113
|
+
// Then I expect to be asked to confirm deletion of the column.
|
|
114
|
+
ModalDialogSteps.verifyDialogBody('Are you sure you want to delete the column \'id\'?');
|
|
115
|
+
|
|
116
|
+
// When I click on confirm button.
|
|
117
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
118
|
+
|
|
119
|
+
// Then I expect the column be deleted.
|
|
120
|
+
JdbcCreateSteps.getColumnSuggestionRows().should('have.length', 1);
|
|
121
|
+
|
|
122
|
+
// When I click on preview button.
|
|
123
|
+
JdbcCreateSteps.clickOnPreviewButton();
|
|
124
|
+
|
|
125
|
+
// Then I expect to see two columns. One for index and one from the query.
|
|
126
|
+
YasrSteps.getResultRowCells(1).should('have.length', 2);
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it('should suggests me all columns when I click on suggest button', () => {
|
|
130
|
+
// When I open the create JDBC configuration page,
|
|
131
|
+
JdbcCreateSteps.openColumnTypesTab();
|
|
132
|
+
// waite columns to be suggested,
|
|
133
|
+
JdbcCreateSteps.getColumnSuggestionRows().should('have.length', 2);
|
|
134
|
+
// When I remove all columns.
|
|
135
|
+
JdbcCreateSteps.clickOnDeleteColumnButton(0);
|
|
136
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
137
|
+
JdbcCreateSteps.clickOnDeleteColumnButton(0);
|
|
138
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
139
|
+
JdbcCreateSteps.getColumnSuggestionRows().should('have.length', 0);
|
|
140
|
+
|
|
141
|
+
// When I click on "Suggest" button.
|
|
142
|
+
JdbcCreateSteps.clickOnSuggestButton();
|
|
143
|
+
// Then I expect all columns to be suggested without confirmation.
|
|
144
|
+
JdbcCreateSteps.getColumnSuggestionRows().should('have.length', 2);
|
|
145
|
+
|
|
146
|
+
// When I click on "Suggest" button when there are selected columns.
|
|
147
|
+
JdbcCreateSteps.clickOnDeleteColumnButton(0);
|
|
148
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
149
|
+
JdbcCreateSteps.getColumnSuggestionRows().should('have.length', 1);
|
|
150
|
+
JdbcCreateSteps.clickOnSuggestButton();
|
|
151
|
+
|
|
152
|
+
// Then I expect to be asked to confirm the suggestion.
|
|
153
|
+
ModalDialogSteps.verifyDialogBody('Are you sure you want to get suggestions for all columns? This action will overwrite all column type mappings!');
|
|
154
|
+
|
|
155
|
+
// When I click on close button.
|
|
156
|
+
ModalDialogSteps.clickOnCloseButton();
|
|
157
|
+
|
|
158
|
+
// Then I expect suggestion to not be applied.
|
|
159
|
+
JdbcCreateSteps.getColumnSuggestionRows().should('have.length', 1);
|
|
160
|
+
|
|
161
|
+
// When I click on "Suggestion" button.
|
|
162
|
+
JdbcCreateSteps.clickOnSuggestButton();
|
|
163
|
+
|
|
164
|
+
// Then I expect to be asked to confirm the suggestion.
|
|
165
|
+
ModalDialogSteps.verifyDialogBody('Are you sure you want to get suggestions for all columns? This action will overwrite all column type mappings!');
|
|
166
|
+
|
|
167
|
+
// When I click on cancel button.
|
|
168
|
+
ModalDialogSteps.clickOnCancelButton();
|
|
169
|
+
|
|
170
|
+
// Then I expect suggestion to not be applied.
|
|
171
|
+
JdbcCreateSteps.getColumnSuggestionRows().should('have.length', 1);
|
|
172
|
+
|
|
173
|
+
// When I click on "Suggestion" button.
|
|
174
|
+
JdbcCreateSteps.clickOnSuggestButton();
|
|
175
|
+
|
|
176
|
+
// Then I expect to be asked to confirm the suggestion.
|
|
177
|
+
ModalDialogSteps.verifyDialogBody('Are you sure you want to get suggestions for all columns? This action will overwrite all column type mappings!');
|
|
178
|
+
|
|
179
|
+
// When I click on confirm button.
|
|
180
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
181
|
+
|
|
182
|
+
// Then I expect suggestion to not be applied.
|
|
183
|
+
JdbcCreateSteps.getColumnSuggestionRows().should('have.length', 2);
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
it('should not allow configuration to be saved if some of required fields are not filled', () => {
|
|
187
|
+
// When I open the create JDBC configuration page,
|
|
188
|
+
// and try to save the configuration.
|
|
189
|
+
JdbcCreateSteps.clickOnSave();
|
|
190
|
+
|
|
191
|
+
// Then I expect to see error message describes that configuration name is required.
|
|
192
|
+
JdbcCreateSteps.getJdbcConfigurationNameIsRequired().should('be.visible');
|
|
193
|
+
JdbcCreateSteps.getJdbcConfigurationNameIsRequired().contains('SQL table name is required');
|
|
194
|
+
|
|
195
|
+
// When I type the name of the configuration,
|
|
196
|
+
JdbcCreateSteps.typeTableName('Test table name');
|
|
197
|
+
// and type wrong query,
|
|
198
|
+
YasqeSteps.pasteQuery('Wrong query');
|
|
199
|
+
// and try to save configuration.
|
|
200
|
+
JdbcCreateSteps.clickOnSave();
|
|
201
|
+
|
|
202
|
+
// Then I expect to see error message described that the query must be select query.
|
|
203
|
+
JdbcCreateSteps.getInvalidQueryMode().should('be.visible');
|
|
204
|
+
JdbcCreateSteps.getInvalidQueryMode().contains('The data query must be a SELECT query');
|
|
205
|
+
|
|
206
|
+
// When I type wrong select query
|
|
207
|
+
YasqeSteps.pasteQuery('Select * where {?s ?p ?o ?g}');
|
|
208
|
+
// and try to save the configuration
|
|
209
|
+
JdbcCreateSteps.clickOnSave();
|
|
210
|
+
|
|
211
|
+
// Then I expect to see error message described that the query is not valid.
|
|
212
|
+
JdbcCreateSteps.getInvalidQuery().should('be.visible');
|
|
213
|
+
JdbcCreateSteps.getInvalidQuery().contains('Invalid query');
|
|
214
|
+
|
|
215
|
+
// When I type correct select query
|
|
216
|
+
YasqeSteps.pasteQuery(DEFAULT_QUERY);
|
|
217
|
+
// and try to save the configuration
|
|
218
|
+
JdbcCreateSteps.clickOnSave();
|
|
219
|
+
|
|
220
|
+
// Then I expect to see error message
|
|
221
|
+
ToasterSteps.verifyError('Please define at least one column');
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
it('should not display confirm message when if the fields of configuration are not changed', () => {
|
|
225
|
+
// When I open the create JDBC configuration page,
|
|
226
|
+
// and try to change page
|
|
227
|
+
JdbcSteps.visit();
|
|
228
|
+
|
|
229
|
+
// Then I expect the new page is loaded.
|
|
230
|
+
JdbcSteps.verifyUrl();
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
it('should display confirm message when configuration name is changed', () => {
|
|
235
|
+
// When I open the create JDBC configuration page,
|
|
236
|
+
// type configuration name,
|
|
237
|
+
JdbcCreateSteps.typeTableName('Configuration name');
|
|
238
|
+
JdbcCreateSteps.getJDBCConfigNameField().should('have.value', 'Configuration name');
|
|
239
|
+
ModalDialogSteps.verifyUrlChangedConfirmation(createVerifyConfirmationDialogOptions());
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
it('should display confirm message when the configuration query data is changed', () => {
|
|
243
|
+
// When I open the create JDBC configuration page,
|
|
244
|
+
// type and change the query,
|
|
245
|
+
YasqeSteps.writeInEditor("Some changes");
|
|
246
|
+
ModalDialogSteps.verifyUrlChangedConfirmation(createVerifyConfirmationDialogOptions());
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
it('should display confirm message when the selected columns are changed', () => {
|
|
250
|
+
// When I open the create JDBC configuration page,
|
|
251
|
+
// and change selected columns.
|
|
252
|
+
JdbcCreateSteps.openColumnTypesTab();
|
|
253
|
+
JdbcCreateSteps.clickOnDeleteColumnButton(0);
|
|
254
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
255
|
+
ModalDialogSteps.verifyUrlChangedConfirmation(createVerifyConfirmationDialogOptions());
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
it('should display confirm message when try to change the repository', () => {
|
|
259
|
+
const secondRepositoryId = 'jdbc-repo-second-repo' + Date.now();
|
|
260
|
+
cy.createRepository({id: secondRepositoryId});
|
|
261
|
+
|
|
262
|
+
// When I open a configuration for edit,
|
|
263
|
+
createConfigurationAndOpenInEdit('Test table');
|
|
264
|
+
// Make some changes
|
|
265
|
+
YasqeSteps.writeInEditor('Make changes');
|
|
266
|
+
|
|
267
|
+
// When I try to change the selected repository.
|
|
268
|
+
RepositorySelectorSteps.selectRepository(secondRepositoryId);
|
|
269
|
+
|
|
270
|
+
// Then I expect to be asked to confirm changing of repository.
|
|
271
|
+
ModalDialogSteps.verifyDialogBody('You have unsaved changes. Are you sure that you want to exit?');
|
|
272
|
+
|
|
273
|
+
// When I click on close button.
|
|
274
|
+
ModalDialogSteps.clickOnCloseButton();
|
|
275
|
+
|
|
276
|
+
// Then I expect to stay on same page
|
|
277
|
+
JdbcCreateSteps.verifyUrl();
|
|
278
|
+
|
|
279
|
+
// When I try to change the selected repository.
|
|
280
|
+
RepositorySelectorSteps.selectRepository(secondRepositoryId);
|
|
281
|
+
|
|
282
|
+
// Then I expect to be asked to confirm changing of repository.
|
|
283
|
+
ModalDialogSteps.verifyDialogBody('You have unsaved changes. Are you sure that you want to exit?');
|
|
284
|
+
|
|
285
|
+
// When I click on cancel button.
|
|
286
|
+
ModalDialogSteps.clickOnCancelButton();
|
|
287
|
+
|
|
288
|
+
// Then I expect to stay on same page
|
|
289
|
+
JdbcCreateSteps.verifyUrl();
|
|
290
|
+
|
|
291
|
+
// When I try to change the selected repository.
|
|
292
|
+
RepositorySelectorSteps.selectRepository(secondRepositoryId);
|
|
293
|
+
|
|
294
|
+
// Then I expect to be asked to confirm changing of repository.
|
|
295
|
+
ModalDialogSteps.verifyDialogBody('You have unsaved changes. Are you sure that you want to exit?');
|
|
296
|
+
|
|
297
|
+
// When I click on confirm button.
|
|
298
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
299
|
+
|
|
300
|
+
// Then I expect to stay on same page
|
|
301
|
+
JdbcSteps.verifyUrl();
|
|
302
|
+
|
|
303
|
+
cy.deleteRepository(secondRepositoryId);
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
function createConfigurationAndOpenInEdit(tableName) {
|
|
308
|
+
JdbcSteps.visit();
|
|
309
|
+
// Creates a configuration.
|
|
310
|
+
JdbcSteps.clickOnCreateJdbcConfigurationButton();
|
|
311
|
+
YasqeSteps.waitUntilQueryIsVisible();
|
|
312
|
+
JdbcCreateSteps.typeTableName(tableName);
|
|
313
|
+
JdbcCreateSteps.openColumnTypesTab();
|
|
314
|
+
// waite selected column to be loaded.
|
|
315
|
+
JdbcCreateSteps.getColumnSuggestionRows().should('have.length', 2);
|
|
316
|
+
JdbcCreateSteps.clickOnSave();
|
|
317
|
+
|
|
318
|
+
ToasterSteps.verifySuccess('SQL table configuration saved');
|
|
319
|
+
|
|
320
|
+
// Opens created configuration for edit.
|
|
321
|
+
JdbcSteps.clickOnEditButton(0);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
function createVerifyConfirmationDialogOptions() {
|
|
325
|
+
return new VerifyConfirmationDialogOptions()
|
|
326
|
+
.setChangePageFunction(() => MainMenuSteps.clickOnMenuImport())
|
|
327
|
+
.setConfirmationMessage('You have unsaved changes. Are you sure that you want to exit?')
|
|
328
|
+
.setVerifyCurrentUrl(() => cy.url().should('eq', `${Cypress.config('baseUrl')}/jdbc/configuration/create`))
|
|
329
|
+
.setVerifyRedirectedUrl(() => cy.url().should('eq', `${Cypress.config('baseUrl')}/import#user`));
|
|
330
|
+
}
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
+
import {JdbcSteps} from "../../steps/setup/jdbc-steps";
|
|
2
|
+
import {JdbcCreateSteps} from "../../steps/setup/jdbc-create-steps";
|
|
3
|
+
import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
|
|
4
|
+
import {YasqeSteps} from "../../steps/yasgui/yasqe-steps";
|
|
5
|
+
|
|
1
6
|
const FILE_TO_IMPORT = '200-row-allianz.ttl';
|
|
2
|
-
const JDBC_CONFIG_NAME = 'jdbc_config';
|
|
3
|
-
const QUERY = "PREFIX ex:<http://example.com/#>\n" +
|
|
4
|
-
"PREFIX base:<http://example/base/>\n" +
|
|
5
|
-
"PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>\n" +
|
|
6
|
-
"PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n" +
|
|
7
|
-
"PREFIX foaf: <http://xmlns.com/foaf/0.1/>\n" +
|
|
8
|
-
"\n" +
|
|
9
|
-
"select ?id ?sentiment_score ?fraud_score ?customer_loyalty where { \n" +
|
|
10
|
-
"\t?id rdf:type ex:Customer;\n" +
|
|
11
|
-
" \tex:sentiment ?sentiment_score;\n" +
|
|
12
|
-
" \tex:fraudScore ?fraud_score;\n" +
|
|
13
|
-
" \tex:customerLoyalty ?customer_loyalty_id.\n" +
|
|
14
|
-
" ?customer_loyalty_id rdfs:label ?customer_loyalty.\n" +
|
|
15
|
-
" # !filter\n" +
|
|
16
|
-
"} ";
|
|
17
7
|
const EDIT_QUERY = "PREFIX ex:<http://example.com/#>\n" +
|
|
18
8
|
"PREFIX base:<http://example/base/>\n" +
|
|
19
9
|
"PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>\n" +
|
|
@@ -37,170 +27,104 @@ describe('JDBC configuration', () => {
|
|
|
37
27
|
cy.createRepository({id: repositoryId});
|
|
38
28
|
cy.presetRepository(repositoryId);
|
|
39
29
|
cy.importServerFile(repositoryId, FILE_TO_IMPORT);
|
|
40
|
-
|
|
41
|
-
cy.window();
|
|
30
|
+
JdbcSteps.visit();
|
|
42
31
|
});
|
|
43
32
|
|
|
44
33
|
afterEach(() => {
|
|
45
34
|
cy.deleteRepository(repositoryId);
|
|
46
35
|
});
|
|
47
36
|
|
|
48
|
-
it('
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
});
|
|
37
|
+
it('Should not create a new JDBC configuration click on cancel button', () => {
|
|
38
|
+
// When I am on JDBC configurations page and click on create a new table configuration button.
|
|
39
|
+
JdbcSteps.clickOnCreateJdbcConfigurationButton();
|
|
52
40
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
cy.pasteQuery(QUERY);
|
|
56
|
-
getJDBCConfigNameField().type(JDBC_CONFIG_NAME);
|
|
57
|
-
|
|
58
|
-
// switch to SQL columns config tab
|
|
59
|
-
getColumnTypesTab().click();
|
|
60
|
-
// verify columns length and content
|
|
61
|
-
getSQLTableRows().should('have.length', 4);
|
|
62
|
-
getSQLTableConfig()
|
|
63
|
-
.should('be.visible')
|
|
64
|
-
.and('contain', 'sentiment_score');
|
|
65
|
-
|
|
66
|
-
getSaveButton().click();
|
|
67
|
-
// verify config is created
|
|
68
|
-
getConfigurationList().should('contain', JDBC_CONFIG_NAME);
|
|
69
|
-
getEditButton().click();
|
|
70
|
-
// used to verify that the input field is active
|
|
71
|
-
typeQuery("{downarrow}");
|
|
72
|
-
|
|
73
|
-
getPreviewButton().click();
|
|
74
|
-
getLoader().should('not.exist');
|
|
75
|
-
|
|
76
|
-
// verify results content
|
|
77
|
-
getPreviewTable()
|
|
78
|
-
.should('be.visible')
|
|
79
|
-
.and('contain', 'SENTIMENT_SCORE')
|
|
80
|
-
.and('contain', 'CUSTOMER_LOYALTY')
|
|
81
|
-
.and('contain', 'ID')
|
|
82
|
-
.and('contain', 'FRAUD_SCORE');
|
|
83
|
-
|
|
84
|
-
// clear current query and paste the edited one, to test the suggest functionality
|
|
85
|
-
clearQuery();
|
|
86
|
-
cy.pasteQuery(EDIT_QUERY);
|
|
87
|
-
getColumnTypesTab().click();
|
|
88
|
-
// click suggest button to update the changes from the second query
|
|
89
|
-
getSuggestButton().click();
|
|
90
|
-
getConfirmSuggestButton().click();
|
|
91
|
-
// verify columns length and content
|
|
92
|
-
getSQLTableRows().should('have.length', 3);
|
|
93
|
-
getSQLTableConfig()
|
|
94
|
-
.should('be.visible')
|
|
95
|
-
.and('not.contain', 'sentiment_score');
|
|
96
|
-
getSaveButton().click();
|
|
97
|
-
|
|
98
|
-
getEditButton().click();
|
|
99
|
-
// Verify that changes have been applied upon saving
|
|
100
|
-
// used to verify that the input field is active
|
|
101
|
-
typeQuery("{downarrow}");
|
|
102
|
-
getPreviewButton().click();
|
|
103
|
-
getLoader().should('not.exist');
|
|
104
|
-
|
|
105
|
-
// verify results content
|
|
106
|
-
getPreviewTable()
|
|
107
|
-
.should('be.visible')
|
|
108
|
-
.and('contain', 'ID')
|
|
109
|
-
.and('contain', 'FRAUD_SCORE')
|
|
110
|
-
.and('contain', 'CUSTOMER_LOYALTY');
|
|
111
|
-
|
|
112
|
-
getCancelButton().click();
|
|
113
|
-
// Delete jdbc configuration
|
|
114
|
-
cy.get('.jdbc-list-configurations').should('be.visible');
|
|
115
|
-
getDeleteButton().click();
|
|
116
|
-
getConfirmDialogButton().click();
|
|
117
|
-
getConfigurationList().should('contain', 'No tables are defined');
|
|
118
|
-
});
|
|
119
|
-
});
|
|
41
|
+
// Then I expect to be redirected to create JDBC configuration page.
|
|
42
|
+
JdbcCreateSteps.verifyUrl();
|
|
120
43
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
44
|
+
// When I fill correct data,
|
|
45
|
+
JdbcCreateSteps.typeTableName('JdbcTest');
|
|
46
|
+
JdbcCreateSteps.openColumnTypesTab();
|
|
124
47
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
48
|
+
// And click on cancel button.
|
|
49
|
+
JdbcCreateSteps.clickOnCancel();
|
|
128
50
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
51
|
+
// Then, I expect to be asked to confirm the cancellation.
|
|
52
|
+
// When I confirm
|
|
53
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
132
54
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
55
|
+
// Then I expect to be redirected to Jdbc configurations page,
|
|
56
|
+
JdbcSteps.verifyUrl();
|
|
57
|
+
// and the configuration to not be created.
|
|
58
|
+
JdbcSteps.getJDBCConfigurations().should('contain', 'No tables are defined');
|
|
59
|
+
});
|
|
136
60
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
61
|
+
it('Should create a new JDBC configuration, edit, preview, then delete', () => {
|
|
62
|
+
// When I am on JDBC configurations page and click on create a new table configuration button.
|
|
63
|
+
JdbcSteps.clickOnCreateJdbcConfigurationButton();
|
|
64
|
+
|
|
65
|
+
// Then I expect to be redirected to create JDBC configuration page.
|
|
66
|
+
JdbcCreateSteps.verifyUrl();
|
|
142
67
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
68
|
+
// When I fill correct data,
|
|
69
|
+
JdbcCreateSteps.typeTableName('JdbcTest');
|
|
70
|
+
// and columns are selected.
|
|
71
|
+
JdbcCreateSteps.openColumnTypesTab();
|
|
72
|
+
JdbcCreateSteps.getColumnSuggestionRows().should('have.length', 2);
|
|
147
73
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
74
|
+
// And click on save button.
|
|
75
|
+
JdbcCreateSteps.clickOnSave();
|
|
151
76
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
77
|
+
// Then I expect to be redirected to Jdbc configurations page,
|
|
78
|
+
JdbcSteps.verifyUrl();
|
|
79
|
+
// and the configuration not be created.
|
|
80
|
+
JdbcSteps.getJDBCConfigurationResults().should('have.length', 1);
|
|
155
81
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
82
|
+
// When I click on edit button,
|
|
83
|
+
JdbcSteps.clickOnEditButton();
|
|
84
|
+
// change the query,
|
|
85
|
+
YasqeSteps.pasteQuery(EDIT_QUERY);
|
|
86
|
+
// and click on save button.
|
|
87
|
+
JdbcCreateSteps.clickOnSave();
|
|
159
88
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
89
|
+
// Then I expect to be redirected to JDBC configurations page.
|
|
90
|
+
JdbcSteps.verifyUrl();
|
|
163
91
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
92
|
+
// When I click on delete button.
|
|
93
|
+
JdbcSteps.clickOnDeleteButton();
|
|
167
94
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
95
|
+
// Then I expect to be asked to confirm the deletion,
|
|
96
|
+
// and click on close dialog button.
|
|
97
|
+
ModalDialogSteps.clickOnCloseButton();
|
|
171
98
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
99
|
+
// Then I expect configuration to not be deleted.
|
|
100
|
+
JdbcSteps.getJDBCConfigurationResults().should('have.length', 1);
|
|
175
101
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
102
|
+
// When I click on delete button.
|
|
103
|
+
JdbcSteps.clickOnDeleteButton();
|
|
179
104
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
105
|
+
// Then I expect to be asked to confirm the deletion,
|
|
106
|
+
// and click on cancel dialog button.
|
|
107
|
+
ModalDialogSteps.clickOnCancelButton();
|
|
183
108
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
109
|
+
// Then I expect configuration to not be deleted.
|
|
110
|
+
JdbcSteps.getJDBCConfigurationResults().should('have.length', 1);
|
|
187
111
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
112
|
+
// When I click on delete button.
|
|
113
|
+
JdbcSteps.clickOnDeleteButton();
|
|
191
114
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
115
|
+
// Then I expect to be asked to confirm the deletion,
|
|
116
|
+
// and click on cancel dialog button.
|
|
117
|
+
ModalDialogSteps.clickOnCancelButton();
|
|
195
118
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
119
|
+
// When I click on delete button.
|
|
120
|
+
JdbcSteps.clickOnDeleteButton();
|
|
199
121
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
122
|
+
// Then I expect to be asked to confirm the deletion,
|
|
123
|
+
// and when click on confirm dialog button.
|
|
124
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
203
125
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
126
|
+
// Then I expect the configuration to be deleted.
|
|
127
|
+
JdbcSteps.getJDBCConfigurations().should('contain', 'No tables are defined');
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
});
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {SparqlEditorSteps} from "../../steps/sparql-editor-steps";
|
|
2
|
+
import {YasqeSteps} from "../../steps/yasgui/yasqe-steps";
|
|
3
|
+
|
|
1
4
|
describe('My Settings', () => {
|
|
2
5
|
|
|
3
6
|
let repositoryId;
|
|
@@ -109,44 +112,17 @@ describe('My Settings', () => {
|
|
|
109
112
|
.then(() => {
|
|
110
113
|
verifyUserSettingsUpdated();
|
|
111
114
|
//Go to SPARQL editor and verify changes are persisted for the admin user
|
|
112
|
-
|
|
113
|
-
cy.window();
|
|
114
|
-
cy.url().should('contain', `${Cypress.config('baseUrl')}/sparql`);
|
|
115
|
-
|
|
116
|
-
waitUntilYASQUEBtnsAreVisible();
|
|
115
|
+
SparqlEditorSteps.visitSparqlEditorPage();
|
|
117
116
|
|
|
118
117
|
//verify disabled default inference, sameAs and total results count
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
.find('.icon-2-5x.icon-inferred-off')
|
|
122
|
-
.should('be.visible');
|
|
123
|
-
|
|
124
|
-
cy.get('#sameAs')
|
|
125
|
-
.should('be.visible')
|
|
126
|
-
.find('.icon-2-5x.icon-sameas-off')
|
|
127
|
-
.should('be.visible');
|
|
118
|
+
YasqeSteps.getIncludeInferredStatementsButton().should('have.class', 'icon-inferred-off');
|
|
119
|
+
YasqeSteps.getExpandResultsOverSameAsButton().should('have.class', 'icon-same-as-off');
|
|
128
120
|
|
|
129
121
|
//clear default query and paste a new one that will generate more than 1000 results
|
|
130
|
-
|
|
131
|
-
|
|
122
|
+
YasqeSteps.clearEditor();
|
|
123
|
+
YasqeSteps.pasteQuery(testResultCountQuery);
|
|
132
124
|
|
|
133
|
-
|
|
134
|
-
.invoke('val', testResultCountQuery).trigger('change', {force: true})
|
|
135
|
-
cy.waitUntilQueryIsVisible();
|
|
136
|
-
cy.verifyQueryAreaContains(testResultCountQuery);
|
|
137
|
-
|
|
138
|
-
cy.get('#wb-sparql-runQuery')
|
|
139
|
-
.should('be.visible')
|
|
140
|
-
.and('not.be.disabled').click()
|
|
141
|
-
.then(() => {
|
|
142
|
-
// Retry until success message is shown
|
|
143
|
-
cy.waitUntil(() =>
|
|
144
|
-
cy.get('#yasr-inner')
|
|
145
|
-
.should('be.visible')
|
|
146
|
-
.find('.results-info .text-xs-right')
|
|
147
|
-
.find('.results-description')
|
|
148
|
-
.then(result => result && result.text().indexOf('Showing results from 1 to 1,000 of at least 1,001') > -1));
|
|
149
|
-
});
|
|
125
|
+
YasqeSteps.executeQuery();
|
|
150
126
|
|
|
151
127
|
//return to My Settings to revert the changes
|
|
152
128
|
visitSettingsView();
|
|
@@ -269,14 +245,6 @@ describe('My Settings', () => {
|
|
|
269
245
|
return cy.get('#wb-user-submit').scrollIntoView().should('be.visible');
|
|
270
246
|
}
|
|
271
247
|
|
|
272
|
-
function waitUntilYASQUEBtnsAreVisible() {
|
|
273
|
-
cy.waitUntil(() =>
|
|
274
|
-
cy.get('#queryEditor #yasqe_buttons')
|
|
275
|
-
.find('#buttons')
|
|
276
|
-
.then(buttons =>
|
|
277
|
-
buttons && buttons.length > 0));
|
|
278
|
-
}
|
|
279
|
-
|
|
280
248
|
function verifyUserSettingsUpdated() {
|
|
281
249
|
cy.waitUntil(() =>
|
|
282
250
|
cy.get('#toast-container')
|