graphdb-workbench-tests 2.4.2-TR1 → 2.4.2
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/integration/setup/jdbc.spec.js +118 -121
- package/package.json +1 -1
|
@@ -33,7 +33,12 @@ describe('JDBC configuration', () => {
|
|
|
33
33
|
let repositoryId;
|
|
34
34
|
|
|
35
35
|
beforeEach(() => {
|
|
36
|
-
|
|
36
|
+
repositoryId = 'jdbc-repo-' + Date.now();
|
|
37
|
+
cy.createRepository({id: repositoryId});
|
|
38
|
+
cy.presetRepository(repositoryId);
|
|
39
|
+
cy.importServerFile(repositoryId, FILE_TO_IMPORT);
|
|
40
|
+
cy.visit('/jdbc');
|
|
41
|
+
cy.window();
|
|
37
42
|
});
|
|
38
43
|
|
|
39
44
|
afterEach(() => {
|
|
@@ -41,33 +46,34 @@ describe('JDBC configuration', () => {
|
|
|
41
46
|
});
|
|
42
47
|
|
|
43
48
|
it('Configuration table preview', () => {
|
|
44
|
-
//cy.visit('/jdbc');
|
|
45
49
|
// SQL configuration table should be visible
|
|
46
50
|
getConfigurationList().should('be.visible');
|
|
47
51
|
});
|
|
48
52
|
|
|
49
|
-
|
|
50
|
-
it.skip('Should create a new JDBC configuration, edit, preview, then delete', () => {
|
|
53
|
+
it('Should create a new JDBC configuration, edit, preview, then delete', () => {
|
|
51
54
|
getCreateNewJDBCConfigurationButon().click();
|
|
52
55
|
cy.pasteQuery(QUERY);
|
|
53
56
|
getJDBCConfigNameField().type(JDBC_CONFIG_NAME);
|
|
54
|
-
getColumnTypesTab().click(); //switch to SQL columns config tab
|
|
55
57
|
|
|
56
|
-
//
|
|
58
|
+
// switch to SQL columns config tab
|
|
59
|
+
getColumnTypesTab().click();
|
|
60
|
+
// verify columns length and content
|
|
57
61
|
getSQLTableRows().should('have.length', 4);
|
|
58
62
|
getSQLTableConfig()
|
|
59
63
|
.should('be.visible')
|
|
60
64
|
.and('contain', 'sentiment_score');
|
|
61
65
|
|
|
62
66
|
getSaveButton().click();
|
|
63
|
-
|
|
67
|
+
// verify config is created
|
|
68
|
+
getConfigurationList().should('contain', JDBC_CONFIG_NAME);
|
|
64
69
|
getEditButton().click();
|
|
70
|
+
// used to verify that the input field is active
|
|
71
|
+
typeQuery("{downarrow}");
|
|
65
72
|
|
|
66
|
-
|
|
67
|
-
getPreviewButton().click({force:true}); //click preview button
|
|
73
|
+
getPreviewButton().click();
|
|
68
74
|
getLoader().should('not.exist');
|
|
69
75
|
|
|
70
|
-
//verify results content
|
|
76
|
+
// verify results content
|
|
71
77
|
getPreviewTable()
|
|
72
78
|
.should('be.visible')
|
|
73
79
|
.and('contain', 'SENTIMENT_SCORE')
|
|
@@ -75,135 +81,126 @@ describe('JDBC configuration', () => {
|
|
|
75
81
|
.and('contain', 'ID')
|
|
76
82
|
.and('contain', 'FRAUD_SCORE');
|
|
77
83
|
|
|
78
|
-
//clear current query and paste the edited one, to test the suggest functionality
|
|
84
|
+
// clear current query and paste the edited one, to test the suggest functionality
|
|
79
85
|
clearQuery();
|
|
80
86
|
cy.pasteQuery(EDIT_QUERY);
|
|
81
87
|
getColumnTypesTab().click();
|
|
82
|
-
|
|
88
|
+
// click suggest button to update the changes from the second query
|
|
89
|
+
getSuggestButton().click();
|
|
83
90
|
getConfirmSuggestButton().click();
|
|
84
|
-
|
|
85
|
-
//verify columns length and content
|
|
91
|
+
// verify columns length and content
|
|
86
92
|
getSQLTableRows().should('have.length', 3);
|
|
87
93
|
getSQLTableConfig()
|
|
88
94
|
.should('be.visible')
|
|
89
95
|
.and('not.contain', 'sentiment_score');
|
|
90
96
|
getSaveButton().click();
|
|
91
|
-
getEditButton().click();
|
|
92
97
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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();
|
|
96
103
|
getLoader().should('not.exist');
|
|
97
104
|
|
|
98
|
-
//verify results content
|
|
105
|
+
// verify results content
|
|
99
106
|
getPreviewTable()
|
|
100
107
|
.should('be.visible')
|
|
101
|
-
.and('not.contain', 'SENTIMENT_SCORE')
|
|
102
|
-
.and('contain', 'CUSTOMER_LOYALTY')
|
|
103
108
|
.and('contain', 'ID')
|
|
104
|
-
.and('contain', 'FRAUD_SCORE')
|
|
105
|
-
|
|
109
|
+
.and('contain', 'FRAUD_SCORE')
|
|
110
|
+
.and('contain', 'CUSTOMER_LOYALTY');
|
|
106
111
|
|
|
107
|
-
|
|
112
|
+
getCancelButton().click();
|
|
113
|
+
// Delete jdbc configuration
|
|
108
114
|
cy.get('.jdbc-list-configurations').should('be.visible');
|
|
109
115
|
getDeleteButton().click();
|
|
110
116
|
getConfirmDialogButton().click();
|
|
111
|
-
getConfigurationList().should('contain', 'No
|
|
117
|
+
getConfigurationList().should('contain', 'No tables are defined');
|
|
112
118
|
});
|
|
113
|
-
|
|
114
|
-
function initRepositoryAndVisitJdbcView() {
|
|
115
|
-
repositoryId = 'jdbc-repo-' + Date.now();
|
|
116
|
-
cy.createRepository({id: repositoryId});
|
|
117
|
-
cy.presetRepository(repositoryId);
|
|
118
|
-
cy.importServerFile(repositoryId, FILE_TO_IMPORT);
|
|
119
|
-
cy.visit('/jdbc');
|
|
120
|
-
cy.window();
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function getCreateNewJDBCConfigurationButon() {
|
|
124
|
-
return cy.get('.create-sql-table-configuration');
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
function getJDBCConfigNameField() {
|
|
128
|
-
return cy.get('.sql-table-name');
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function getQueryArea() {
|
|
132
|
-
return cy.get('.CodeMirror');
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function getQueryTextArea() {
|
|
136
|
-
return getQueryArea().find('textarea');
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
function typeQuery(query) {
|
|
140
|
-
// getQueryTextArea().invoke('val', query).trigger('change', {force: true});
|
|
141
|
-
getQueryTextArea().type(query, {force: true});
|
|
142
|
-
cy.waitUntilQueryIsVisible();
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function clearQuery() {
|
|
146
|
-
// Using force because the textarea is not visible
|
|
147
|
-
getQueryTextArea().type(Cypress.env('modifierKey') + 'a{backspace}', {force: true});
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
function getColumnTypesTab() {
|
|
151
|
-
return cy.get('.nav-tabs').contains("Column types");
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
function getDataQueryTab() {
|
|
155
|
-
return cy.get('.nav-tabs').contains("Data query");
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function getSaveButton() {
|
|
159
|
-
return cy.get('.save-query-btn');
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
function getDeleteButton() {
|
|
163
|
-
return cy.get('.icon-trash');
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function getCancelButton() {
|
|
167
|
-
return cy.get('.cancel-query-btn');
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function getConfirmDialogButton() {
|
|
171
|
-
return cy.get('.btn-primary');
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
function getConfigurationList() {
|
|
175
|
-
return cy.get('.jdbc-list-configurations');
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
function getEditButton() {
|
|
179
|
-
return cy.get('.icon-edit');
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function getSQLTableRows() {
|
|
183
|
-
return cy.get('div.form-group.row.pt-1.ng-scope');
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
function getPreviewButton() {
|
|
187
|
-
return cy.get('.preview-btn');
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
function getSuggestButton(){
|
|
191
|
-
return cy.get('.sql-table-config .preview-btn');
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function getConfirmSuggestButton() {
|
|
195
|
-
return cy.get('.confirm-btn');
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function getLoader() {
|
|
199
|
-
return cy.get('.ot-loader-new-content');
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
function getPreviewTable() {
|
|
203
|
-
return cy.get('.resultsTable');
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
function getSQLTableConfig() {
|
|
207
|
-
return cy.get('.sql-table-config');
|
|
208
|
-
}
|
|
209
119
|
});
|
|
120
|
+
|
|
121
|
+
function getCreateNewJDBCConfigurationButon() {
|
|
122
|
+
return cy.get('.create-sql-table-configuration');
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function getJDBCConfigNameField() {
|
|
126
|
+
return cy.get('.sql-table-name');
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function getQueryArea() {
|
|
130
|
+
return cy.get('.CodeMirror');
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function getQueryTextArea() {
|
|
134
|
+
return getQueryArea().find('textarea');
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function typeQuery(query) {
|
|
138
|
+
// getQueryTextArea().invoke('val', query).trigger('change', {force: true});
|
|
139
|
+
getQueryTextArea().type(query, {force: true});
|
|
140
|
+
cy.waitUntilQueryIsVisible();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function clearQuery() {
|
|
144
|
+
// Using force because the textarea is not visible
|
|
145
|
+
getQueryTextArea().type(Cypress.env('modifierKey') + 'a{backspace}', {force: true});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function getColumnTypesTab() {
|
|
149
|
+
return cy.get('.nav-tabs').contains("Column types");
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function getDataQueryTab() {
|
|
153
|
+
return cy.get('.nav-tabs').contains("Data query");
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function getSaveButton() {
|
|
157
|
+
return cy.get('.save-query-btn');
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function getDeleteButton() {
|
|
161
|
+
return cy.get('.icon-trash');
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function getCancelButton() {
|
|
165
|
+
return cy.get('.cancel-query-btn');
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function getConfirmDialogButton() {
|
|
169
|
+
return cy.get('.btn-primary');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function getConfigurationList() {
|
|
173
|
+
return cy.get('.jdbc-list-configurations');
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function getEditButton() {
|
|
177
|
+
return cy.get('.icon-edit');
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function getSQLTableRows() {
|
|
181
|
+
return cy.get('div.form-group.row.pt-1.ng-scope');
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function getPreviewButton() {
|
|
185
|
+
return cy.get('.preview-btn');
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function getSuggestButton() {
|
|
189
|
+
return cy.get('.sql-table-config .preview-btn');
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function getConfirmSuggestButton() {
|
|
193
|
+
return cy.get('.confirm-btn');
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function getLoader() {
|
|
197
|
+
return cy.get('.ot-loader-new-content');
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function getPreviewTable() {
|
|
201
|
+
return cy.get('.resultsTable');
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function getSQLTableConfig() {
|
|
205
|
+
return cy.get('.sql-table-config');
|
|
206
|
+
}
|