graphdb-workbench-tests 2.5.1 → 2.6.0-RC2
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 +53 -12
- 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 +228 -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 +201 -39
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {ACL_VIEW, AclManagementSteps} from "../../../steps/setup/acl-management-steps";
|
|
2
2
|
import {ApplicationSteps} from "../../../steps/application-steps";
|
|
3
3
|
import {ModalDialogSteps} from "../../../steps/modal-dialog-steps";
|
|
4
4
|
|
|
@@ -18,21 +18,23 @@ describe('ACL Management: update rules', () => {
|
|
|
18
18
|
cy.enableAutocomplete(repositoryId);
|
|
19
19
|
AclManagementSteps.importRules(repositoryId);
|
|
20
20
|
AclManagementSteps.visit();
|
|
21
|
+
ApplicationSteps.geLoader().should('not.exist');
|
|
21
22
|
// ensure rules are rendered
|
|
22
23
|
AclManagementSteps.getAclRules().should('have.length.gt', 0);
|
|
23
24
|
});
|
|
24
25
|
|
|
25
26
|
it('Should be able to edit and save ACL', () => {
|
|
26
27
|
// Given I have opened ACL management page
|
|
27
|
-
AclManagementSteps.
|
|
28
|
+
AclManagementSteps.checkStatementRules(ACL_VIEW);
|
|
28
29
|
// When I add a new rule
|
|
29
30
|
AclManagementSteps.addRule(1);
|
|
30
31
|
AclManagementSteps.fillSubject(2, '<urn:John>');
|
|
31
32
|
AclManagementSteps.fillPredicate(2, '*');
|
|
32
33
|
AclManagementSteps.fillObject(2, '*');
|
|
33
34
|
AclManagementSteps.fillContext(2, '*');
|
|
34
|
-
AclManagementSteps.fillRole(2, '
|
|
35
|
+
AclManagementSteps.fillRole(2, 'ROLE1');
|
|
35
36
|
AclManagementSteps.selectPolicy(2, 'deny');
|
|
37
|
+
AclManagementSteps.selectOperation(2, 'write');
|
|
36
38
|
AclManagementSteps.saveRule(2);
|
|
37
39
|
// And I edit an existing rule
|
|
38
40
|
AclManagementSteps.editRule(1);
|
|
@@ -40,38 +42,44 @@ describe('ACL Management: update rules', () => {
|
|
|
40
42
|
AclManagementSteps.fillPredicate(1, '*');
|
|
41
43
|
AclManagementSteps.fillObject(1, '*');
|
|
42
44
|
AclManagementSteps.fillContext(1, '*');
|
|
43
|
-
AclManagementSteps.fillRole(1, '
|
|
45
|
+
AclManagementSteps.fillRole(1, 'TEST');
|
|
44
46
|
AclManagementSteps.selectPolicy(1, 'allow');
|
|
47
|
+
AclManagementSteps.selectOperation(1, 'write');
|
|
45
48
|
AclManagementSteps.saveRule(1);
|
|
46
49
|
// And I delete an existing rule
|
|
47
50
|
AclManagementSteps.deleteRule(5);
|
|
48
51
|
ModalDialogSteps.clickOnConfirmButton();
|
|
49
52
|
// And I save the ACL list
|
|
50
53
|
AclManagementSteps.saveAcl();
|
|
54
|
+
ApplicationSteps.geLoader().should('not.exist');
|
|
51
55
|
// Then I expect the ACL to be saved
|
|
52
56
|
ApplicationSteps.getSuccessNotifications().should('be.visible');
|
|
53
57
|
AclManagementSteps.getAclRules().should('have.length', 5);
|
|
54
58
|
const editedRule = {
|
|
59
|
+
"scope": "statement",
|
|
60
|
+
"policy": "deny",
|
|
61
|
+
"role": "ROLE1",
|
|
62
|
+
"operation": "write",
|
|
55
63
|
"subject": "<urn:John>",
|
|
56
64
|
"predicate": "*",
|
|
57
65
|
"object": "*",
|
|
58
66
|
"context": "*",
|
|
59
|
-
"role": "CUSTOM_ROLE1",
|
|
60
|
-
"policy": "deny",
|
|
61
67
|
"moveUp": true,
|
|
62
68
|
"moveDown": true
|
|
63
69
|
};
|
|
64
70
|
const newRule = {
|
|
71
|
+
"scope": "statement",
|
|
72
|
+
"policy": "allow",
|
|
73
|
+
"role": "TEST",
|
|
74
|
+
"operation": "write",
|
|
65
75
|
"subject": "<urn:Me>",
|
|
66
76
|
"predicate": "*",
|
|
67
77
|
"object": "*",
|
|
68
78
|
"context": "*",
|
|
69
|
-
"role": "CUSTOM_TEST",
|
|
70
|
-
"policy": "allow",
|
|
71
79
|
"moveUp": true,
|
|
72
80
|
"moveDown": true
|
|
73
81
|
};
|
|
74
|
-
AclManagementSteps.
|
|
82
|
+
AclManagementSteps.checkStatementRules([ACL_VIEW[0], newRule, editedRule, ACL_VIEW[2], ACL_VIEW[3]]);
|
|
75
83
|
});
|
|
76
84
|
|
|
77
85
|
it('Should prevent leaving the page when there is new rule added', () => {
|
|
@@ -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
|
+
}
|