graphdb-workbench-tests 2.7.4 → 2.8.0-TR2
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/connectors/get-connectors.json +8 -0
- package/fixtures/connectors/get-retrieval-connector-0.json +1 -0
- package/fixtures/connectors/get-retrieval-connector.json +29 -0
- package/fixtures/locale-en.json +282 -21
- package/fixtures/namespaces/get-repository-starwars-namespaces.json +252 -0
- package/fixtures/repositories/get-locations.json +72 -0
- package/fixtures/repositories/get-repositories.json +106 -0
- package/fixtures/repositories/get-repository-config-starwars-disabled-fts.json +201 -0
- package/fixtures/repositories/get-repository-config-starwars-enabled-fts.json +201 -0
- package/fixtures/repositories/get-ttyg-repositories.json +46 -0
- package/fixtures/similarity/get-similarity-indexes-0.json +1 -0
- package/fixtures/similarity/get-similarity-indexes.json +15 -0
- package/fixtures/ttyg/agent/create-agent.json +19 -0
- package/fixtures/ttyg/agent/get-agent-list-0.json +1 -0
- package/fixtures/ttyg/agent/get-agent-list-after-deleted.json +56 -0
- package/fixtures/ttyg/agent/get-agent-list-new-agent.json +93 -0
- package/fixtures/ttyg/agent/get-agent-list.json +74 -0
- package/fixtures/ttyg/chats/deleted-chat.json +3 -0
- package/fixtures/ttyg/chats/get-chat-1.json +34 -0
- package/fixtures/ttyg/chats/get-chat-list-0.json +1 -0
- package/fixtures/ttyg/chats/get-chat-list-with-deleted-chat.json +17 -0
- package/fixtures/ttyg/chats/get-chat-list-with-renamed-chat.json +22 -0
- package/fixtures/ttyg/chats/get-chat-list.json +22 -0
- package/fixtures/ttyg/chats/renamed-chat.json +4 -0
- package/integration/import/import-user-data.spec.js +2 -1
- package/integration/repository/attach-remote-location.spec.js +154 -0
- package/integration/repository/ontop-repository.spec.js +87 -1
- package/integration/repository/repositories.spec.js +4 -13
- package/integration/ttyg/agent-list.spec.js +69 -0
- package/integration/ttyg/agent-select-menu.spec.js +139 -0
- package/integration/ttyg/chat-list.spec.js +158 -0
- package/integration/ttyg/chat-panel.spec.js +79 -0
- package/integration/ttyg/create-agent.spec.js +348 -0
- package/integration/ttyg/delete-agent.spec.js +50 -0
- package/integration/ttyg/ttyg-view.spec.js +72 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/steps/import/import-steps.js +0 -4
- package/steps/modal-dialog-steps.js +8 -0
- package/steps/ontop-repository-steps.js +26 -0
- package/steps/repositories/attach-repository-steps.js +85 -0
- package/steps/repository-steps.js +33 -0
- package/steps/ttyg/chat-panel-steps.js +37 -0
- package/steps/ttyg/ttyg-agent-settings-modal.steps.js +363 -0
- package/steps/ttyg/ttyg-view-steps.js +253 -0
- package/steps/window-steps.js +5 -0
- package/stubs/connector-stubs.js +15 -0
- package/stubs/repositories/repositories-stubs.js +138 -0
- package/stubs/similarity-index-stubs.js +7 -0
- package/stubs/ttyg/ttyg-stubs.js +106 -0
|
@@ -55,6 +55,10 @@ export class RepositorySteps {
|
|
|
55
55
|
return RepositorySteps.getRepositoryFromList(id).find('.icon-connection-off');
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
static clickRepositoryConnectionOffBtn(id) {
|
|
59
|
+
RepositorySteps.getRepositoryConnectionOffBtn(id).click();
|
|
60
|
+
}
|
|
61
|
+
|
|
58
62
|
static getRepositoryConnectionOnBtn(id) {
|
|
59
63
|
return RepositorySteps.getRepositoryFromList(id).find('.icon-connection-on');
|
|
60
64
|
}
|
|
@@ -121,6 +125,22 @@ export class RepositorySteps {
|
|
|
121
125
|
return cy.get('.ot-edit-input');
|
|
122
126
|
}
|
|
123
127
|
|
|
128
|
+
static getUsernameFieldEditRepo() {
|
|
129
|
+
return cy.get('.form-group #username');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
static typeUsernameInEditRepo(username) {
|
|
133
|
+
this.getUsernameFieldEditRepo().type(username);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
static clickSaveEditedRepo() {
|
|
137
|
+
cy.get('#addEditOntopRepository').click();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
static typeURL(url) {
|
|
141
|
+
cy.get('#url').type(url);
|
|
142
|
+
}
|
|
143
|
+
|
|
124
144
|
static editRepositoryId() {
|
|
125
145
|
this.getRepositoryIdEditElement().click();
|
|
126
146
|
}
|
|
@@ -242,4 +262,17 @@ export class RepositorySteps {
|
|
|
242
262
|
static uploadRulesetFile(file) {
|
|
243
263
|
cy.get('input[type=file]').eq(1).selectFile(file, {force: true});
|
|
244
264
|
}
|
|
265
|
+
|
|
266
|
+
static getRepoIcon(type) {
|
|
267
|
+
return this.getLocalGraphDBTable().get(`.lead .icon-repo-${type}`);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
static assertRepositoryStatus(repositoryId, status) {
|
|
271
|
+
cy.waitUntil(() =>
|
|
272
|
+
RepositorySteps.getRepositoryFromList(repositoryId)
|
|
273
|
+
.should('be.visible')
|
|
274
|
+
.find('.repository-status .text-secondary')
|
|
275
|
+
.then(($el) => $el)
|
|
276
|
+
.then(($el) => $el && $el.text() === status));
|
|
277
|
+
}
|
|
245
278
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export class ChatPanelSteps {
|
|
2
|
+
|
|
3
|
+
static getChatPanel() {
|
|
4
|
+
return cy.get('.chat-panel');
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
static getChatDetailsElements() {
|
|
8
|
+
return ChatPanelSteps.getChatPanel().find('.chat-detail');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
static getChatDetailElement(index = 0) {
|
|
12
|
+
return ChatPanelSteps.getChatDetailsElements().eq(index).scrollIntoView();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
static getChatDetailActions(index = 0) {
|
|
16
|
+
return ChatPanelSteps.getChatDetailElement(index).find('.actions');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static getQuestionInputElement() {
|
|
20
|
+
return ChatPanelSteps.getChatPanel().find('.question-input');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static getAskButtonElement() {
|
|
24
|
+
return ChatPanelSteps.getChatPanel().find('.ask-button');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
static getChatDetailQuestionElement(index = 0) {
|
|
28
|
+
return ChatPanelSteps.getChatDetailElement(index).find('.question');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static regenerateQuestion(index) {
|
|
32
|
+
ChatPanelSteps.getChatDetailActions(index).find('.regenerate-question-btn').scrollIntoView().click();
|
|
33
|
+
}
|
|
34
|
+
static copyAnswer(index) {
|
|
35
|
+
ChatPanelSteps.getChatDetailActions(index).find('.copy-answer-btn').click({force: true});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import {ModalDialogSteps} from "../modal-dialog-steps";
|
|
2
|
+
|
|
3
|
+
export class TtygAgentSettingsModalSteps extends ModalDialogSteps {
|
|
4
|
+
|
|
5
|
+
static getSaveAgentButton() {
|
|
6
|
+
return this.getDialog().find('.save-agent-settings-btn');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
static saveAgent() {
|
|
10
|
+
this.getSaveAgentButton().click();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// =========================
|
|
14
|
+
// Form fields
|
|
15
|
+
// =========================
|
|
16
|
+
|
|
17
|
+
// Agent name
|
|
18
|
+
|
|
19
|
+
static getAgentNameFormGroup() {
|
|
20
|
+
return this.getDialog().find('.agent-name');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static getAgentNameField() {
|
|
24
|
+
return this.getAgentNameFormGroup().find('input');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
static typeAgentName(name) {
|
|
28
|
+
this.getAgentNameField().type(name);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static clearAgentName() {
|
|
32
|
+
this.getAgentNameField().clear();
|
|
33
|
+
cy.realPress('Tab');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static getAgentNameError() {
|
|
37
|
+
return this.getAgentNameFormGroup().find('.alert-danger');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Repository ID
|
|
41
|
+
|
|
42
|
+
static getRepositoryIdFromGroup() {
|
|
43
|
+
return this.getDialog().find('.repository-id');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static getRepositorySelect() {
|
|
47
|
+
return this.getRepositoryIdFromGroup().find('select');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
static selectRepository(repositoryId) {
|
|
51
|
+
this.getRepositorySelect().select(repositoryId);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static getRepositoryIdError() {
|
|
55
|
+
return this.getRepositoryIdFromGroup().find('.alert-danger');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Extraction methods
|
|
59
|
+
|
|
60
|
+
static getExtractionMethodError() {
|
|
61
|
+
return this.getDialog().find('.extraction-methods-group .extraction-method-required-error');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
static getExtractionMethod(method) {
|
|
65
|
+
return this.getDialog().find(`#${method}_method_heading`);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
static getExtractionMethodPanel(method) {
|
|
69
|
+
return this.getDialog().find(`#${method}_method_content`).find('.extraction-method-options');
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// SPARQL extraction method
|
|
73
|
+
|
|
74
|
+
static enableSparqlExtractionMethod() {
|
|
75
|
+
this.getExtractionMethod('sparql_search').find('.extraction-method-toggle label').click();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
static disableSparqlExtractionMethod() {
|
|
79
|
+
this.getExtractionMethod('sparql_search').find('.extraction-method-toggle label').click();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
static toggleSparqlExtractionMethodPanel() {
|
|
83
|
+
this.getExtractionMethod('sparql_search').find('.panel-toggle-link').click();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
static getSparqlExtractionMethodPanel() {
|
|
87
|
+
return this.getExtractionMethodPanel('sparql_search');
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
static getSparqlExtractionMethodError() {
|
|
91
|
+
return this.getSparqlExtractionMethodPanel().find('.sparql-method-option-required-error.alert-danger');
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
static selectSparqlMethodOntologyGraph() {
|
|
95
|
+
this.getSparqlExtractionMethodPanel().find('.ontology-graph-option input[type=radio]').click();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
static getSparqlMethodOntologyGraphField() {
|
|
99
|
+
return this.getSparqlExtractionMethodPanel().find('#ontologyGraph');
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
static clearSparqlMethodOntologyGraphField() {
|
|
103
|
+
return this.getSparqlMethodOntologyGraphField().clear();
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
static typeSparqlMethodOntologyGraphField(value) {
|
|
107
|
+
return this.getSparqlMethodOntologyGraphField().type(value);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
static selectSparqlMethodSparqlQuery() {
|
|
111
|
+
this.getSparqlExtractionMethodPanel().find('.sparql-query-option input[type=radio]').click();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
static getSparqlMethodSparqlQueryField() {
|
|
115
|
+
return this.getSparqlExtractionMethodPanel().find('#sparqlQuery');
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
static clearSparqlMethodSparqlQueryField() {
|
|
119
|
+
return this.getSparqlMethodSparqlQueryField().clear();
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
static typeSparqlMethodSparqlQueryField(value) {
|
|
123
|
+
// disabled the parsing of special character sequences because the value is a SPARQL query and may contain special characters
|
|
124
|
+
return this.getSparqlMethodSparqlQueryField().type(value, {parseSpecialCharSequences: false});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// FTS extraction method
|
|
128
|
+
|
|
129
|
+
static enableFtsExtractionMethod() {
|
|
130
|
+
this.getExtractionMethod('fts_search').find('.extraction-method-toggle label').click();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
static disableFtsExtractionMethod() {
|
|
134
|
+
this.getExtractionMethod('fts_search').find('.extraction-method-toggle label').click();
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
static toggleFTSExtractionMethodPanel() {
|
|
138
|
+
this.getExtractionMethod('fts_search').find('.panel-toggle-link').click();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
static getMissingRepositoryIdErrorInFtsSearchPanel() {
|
|
142
|
+
return this.getExtractionMethodPanel('fts_search').find('.missing-repositoryid-error');
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
static getFtsDisabledHelp() {
|
|
146
|
+
return this.getExtractionMethodPanel('fts_search').find('.fts-disabled-message');
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
static getFtsSearchMaxTriplesFormGroup() {
|
|
150
|
+
return this.getExtractionMethodPanel('fts_search').find('.max-triples');
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Similarity search method
|
|
154
|
+
|
|
155
|
+
static enableSimilaritySearchMethodPanel() {
|
|
156
|
+
this.getExtractionMethod('similarity_search').find('.extraction-method-toggle label').click();
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
static toggleSimilaritySearchMethodPanel() {
|
|
160
|
+
this.getExtractionMethod('similarity_search').find('.panel-toggle-link').click();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
static getSimilaritySearchIndexMissingHelp() {
|
|
164
|
+
return this.getExtractionMethodPanel('similarity_search').find('.no-similarity-index-message');
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
static getSimilarityIndexFormGroup() {
|
|
168
|
+
return this.getExtractionMethodPanel('similarity_search').find('.similarity-index');
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
static getSimilarityIndexField() {
|
|
172
|
+
return this.getSimilarityIndexFormGroup().find('select');
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
static selectSimilarityIndex(index) {
|
|
176
|
+
this.getSimilarityIndexField().select(index);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
static getSimilarityIndexThresholdFormGroup() {
|
|
180
|
+
return this.getExtractionMethodPanel('similarity_search').find('.similarity-index-threshold');
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
static getSimilarityIndexThresholdField() {
|
|
184
|
+
return this.getSimilarityIndexThresholdFormGroup().find('#similarityIndexThreshold');
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
static setSimilarityIndexThreshold(value) {
|
|
188
|
+
this.getSimilarityIndexThresholdField().invoke('val', value).trigger('input');
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
static getSimilarityIndexMaxTriplesFormGroup() {
|
|
192
|
+
return this.getExtractionMethodPanel('similarity_search').find('.similarity-max-triples');
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
static getSimilarityIndexMaxTriplesField() {
|
|
196
|
+
return this.getSimilarityIndexMaxTriplesFormGroup().find('input');
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
static setSimilarityIndexMaxTriples(value) {
|
|
200
|
+
this.getSimilarityIndexMaxTriplesField().invoke('val', value).trigger('input');
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Retrieval method
|
|
204
|
+
|
|
205
|
+
static enableRetrievalMethodPanel() {
|
|
206
|
+
this.getExtractionMethod('retrieval_search').find('.extraction-method-toggle label').click();
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
static toggleRetrievalMethodPanel() {
|
|
210
|
+
this.getExtractionMethod('retrieval_search').find('.panel-toggle-link').click();
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
static getMissingRetrievalConnectorHelp() {
|
|
214
|
+
return this.getExtractionMethodPanel('retrieval_search').find('.no-retrieval-connector-message');
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
static getRetrievalConnectorFormGroup() {
|
|
218
|
+
return this.getExtractionMethodPanel('retrieval_search').find('.retrieval-connector');
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
static getRetrievalConnectorField() {
|
|
222
|
+
return this.getRetrievalConnectorFormGroup().find('select');
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
static selectRetrievalConnector(connector) {
|
|
226
|
+
this.getRetrievalConnectorField().select(connector);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
static getQueryTemplateFormGroup() {
|
|
230
|
+
return this.getExtractionMethodPanel('retrieval_search').find('.query-template');
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
static getQueryTemplateField() {
|
|
234
|
+
return this.getQueryTemplateFormGroup().find('textarea');
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
static clearQueryTemplate() {
|
|
238
|
+
this.getQueryTemplateField().clear();
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
static typeQueryTemplate(value) {
|
|
242
|
+
// disabled the parsing of special character sequences because the value is a SPARQL query and may contain special characters
|
|
243
|
+
return this.getQueryTemplateField().type(value, {parseSpecialCharSequences: false});
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
static getRetrievalMaxTriplesFormGroup() {
|
|
247
|
+
return this.getExtractionMethodPanel('retrieval_search').find('.retrieval-connector-max-triples');
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
static getRetrievalMaxTriplesField() {
|
|
251
|
+
return this.getRetrievalMaxTriplesFormGroup().find('input');
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
static setRetrievalMaxTriples(value) {
|
|
255
|
+
this.getRetrievalMaxTriplesField().invoke('val', value).trigger('input');
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// GPT model
|
|
259
|
+
|
|
260
|
+
static getGptModelFormGroup() {
|
|
261
|
+
return this.getDialog().find('.gpt-model');
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
static getGptModelField() {
|
|
265
|
+
return this.getGptModelFormGroup().find('input');
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
static clearGptModel() {
|
|
269
|
+
this.getGptModelField().clear();
|
|
270
|
+
cy.realPress('Tab');
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
static getGptModelError() {
|
|
274
|
+
return this.getGptModelFormGroup().find('.alert-danger');
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
static typeGptModel(value) {
|
|
278
|
+
return this.getGptModelField().type(value);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// temperature
|
|
282
|
+
|
|
283
|
+
static getTemperatureFormGroup() {
|
|
284
|
+
return this.getDialog().find('.temperature');
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
static getTemperatureField() {
|
|
288
|
+
return this.getTemperatureFormGroup().find('#temperature');
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
static setTemperature(value) {
|
|
292
|
+
this.getTemperatureField().invoke('val', value).trigger('input');
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Top P
|
|
296
|
+
|
|
297
|
+
static getTopPFormGroup() {
|
|
298
|
+
return this.getDialog().find('.top-p');
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
static getTopPField() {
|
|
302
|
+
return this.getTopPFormGroup().find('#topP');
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
static setTopP(value) {
|
|
306
|
+
this.getTopPField().invoke('val', value).trigger('input');
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// Seed
|
|
310
|
+
|
|
311
|
+
static getSeedFormGroup() {
|
|
312
|
+
return this.getDialog().find('.seed');
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
static getSeedField() {
|
|
316
|
+
return this.getSeedFormGroup().find('#seed');
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
static clearSeed() {
|
|
320
|
+
this.getSeedField().clear();
|
|
321
|
+
cy.realPress('Tab');
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
static typeSeed(value) {
|
|
325
|
+
return this.getSeedField().type(value);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// System instructions
|
|
329
|
+
|
|
330
|
+
static getSystemInstructionsFormGroup() {
|
|
331
|
+
return this.getDialog().find('.system-instructions');
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
static getSystemInstructionsField() {
|
|
335
|
+
return this.getSystemInstructionsFormGroup().find('#systemInstruction');
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
static clearSystemInstructions() {
|
|
339
|
+
this.getSystemInstructionsField().clear();
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
static typeSystemInstructions(value) {
|
|
343
|
+
return this.getSystemInstructionsField().type(value);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// User instructions
|
|
347
|
+
|
|
348
|
+
static getUserInstructionsFormGroup() {
|
|
349
|
+
return this.getDialog().find('.user-instructions');
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
static getUserInstructionsField() {
|
|
353
|
+
return this.getUserInstructionsFormGroup().find('#userInstruction');
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
static clearUserInstructions() {
|
|
357
|
+
this.getUserInstructionsField().clear();
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
static typeUserInstructions(value) {
|
|
361
|
+
return this.getUserInstructionsField().type(value);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
export class TTYGViewSteps {
|
|
2
|
+
static visit() {
|
|
3
|
+
cy.visit('/chatgpt');
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
static getTtygView() {
|
|
7
|
+
return cy.get('.ttyg-view');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
static getTtygViewTitle() {
|
|
11
|
+
return cy.get('#ttyg-view-title');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
static getNoAgentsView() {
|
|
15
|
+
return this.getTtygView().find('.no-agents-view-component');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static getTtygViewContent() {
|
|
19
|
+
return cy.get('.ttyg-view-content');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static getChatsSidebar() {
|
|
23
|
+
return cy.get('.left-sidebar');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static getChatListLoadingIndicator() {
|
|
27
|
+
return this.getChatsSidebar().find('[onto-loader-fancy]');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static getChatsPanel() {
|
|
31
|
+
return this.getChatsSidebar().find('.chat-list-panel');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static getChatListComponent() {
|
|
35
|
+
return this.getChatsPanel().find('.chat-list-component');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static getChatByDayGroups() {
|
|
39
|
+
return this.getChatListComponent().find('.chat-group');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static getChatGroup(index) {
|
|
43
|
+
return this.getChatByDayGroups().eq(index);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static getChatsFromGroup(index) {
|
|
47
|
+
return this.getChatGroup(index).find('.chat-item');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
static getChatFromGroup(groupIndex, chatIndex) {
|
|
51
|
+
return this.getChatGroup(groupIndex).find('.chat-item').eq(chatIndex);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static selectChat(groupIndex, chatIndex) {
|
|
55
|
+
this.getChatFromGroup(groupIndex, chatIndex).click();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
static editChatName(groupIndex, chatIndex) {
|
|
59
|
+
this.getChatFromGroup(groupIndex, chatIndex).dblclick();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
static getChatNameInput(groupIndex, chatIndex) {
|
|
63
|
+
return this.getChatFromGroup(groupIndex, chatIndex).find('.inline-editable-text input');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
static writeChatName(groupIndex, chatIndex, name) {
|
|
67
|
+
this.getChatNameInput(groupIndex, chatIndex).clear().type(name);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
static saveChatName(groupIndex, chatIndex) {
|
|
71
|
+
this.getChatNameInput(groupIndex, chatIndex).type('{enter}');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
static cancelChatNameSaving(groupIndex, chatIndex) {
|
|
75
|
+
this.getChatNameInput(groupIndex, chatIndex).type('{esc}');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
static openChatActionMenu(groupIndex, chatIndex) {
|
|
79
|
+
this.getChatFromGroup(groupIndex, chatIndex).realHover().find('.open-chat-actions-btn').click();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
static triggerEditChatActionMenu(groupIndex, chatIndex) {
|
|
83
|
+
this.openChatActionMenu(groupIndex, chatIndex);
|
|
84
|
+
this.getChatFromGroup(groupIndex, chatIndex).find('.chat-actions-menu .rename-chat-btn').click();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
static triggerDeleteChatActionMenu(groupIndex, chatIndex) {
|
|
88
|
+
this.openChatActionMenu(groupIndex, chatIndex);
|
|
89
|
+
this.getChatFromGroup(groupIndex, chatIndex).find('.chat-actions-menu .delete-chat-btn').click();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
static getToggleChatsSidebarButton() {
|
|
93
|
+
return this.getChatsSidebar().find('.toggle-chats-sidebar-btn');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
static collapseChatsSidebar() {
|
|
97
|
+
return this.getToggleChatsSidebarButton().click();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
static expandChatsSidebar() {
|
|
101
|
+
return this.getToggleChatsSidebarButton().click();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
static getCreateChatButton() {
|
|
105
|
+
return this.getChatsSidebar().find('.create-chat-btn');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
static getAgentsSidebar() {
|
|
109
|
+
return cy.get('.right-sidebar');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
static getAgentsPanel() {
|
|
113
|
+
return this.getAgentsSidebar().find('.agent-list-panel');
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
static getAgentFilter() {
|
|
117
|
+
return this.getAgentsPanel().find('.agents-filter-dropdown');
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
static getSelectedAgentFilter() {
|
|
121
|
+
return this.getAgentFilter().find('.selected-filter');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
static filterAgentsByRepository(repository) {
|
|
125
|
+
this.getAgentFilter().click();
|
|
126
|
+
this.getAgentFilter().find('.dropdown-menu').find(`[data-value="${repository}"]`).click();
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
static getAgents() {
|
|
130
|
+
return this.getAgentsPanel().find('.agent-item');
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
static getAgent(index) {
|
|
134
|
+
return this.getAgents().eq(index);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
static getHelpButton() {
|
|
138
|
+
return this.getAgentsSidebar().find('.help-btn');
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
static getCreateFirstAgentButton() {
|
|
142
|
+
return this.getNoAgentsView().find('.create-agent-btn');
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
static getCreateAgentButton() {
|
|
146
|
+
return this.getAgentsSidebar().find('.create-agent-btn');
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
static createFirstAgent() {
|
|
150
|
+
this.getCreateFirstAgentButton().click();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
static getToggleAgentsSidebarButton() {
|
|
154
|
+
return this.getAgentsSidebar().find('.toggle-agents-sidebar-btn');
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
static collapseAgentsSidebar() {
|
|
158
|
+
return this.getToggleAgentsSidebarButton().click();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
static expandAgentsSidebar() {
|
|
162
|
+
return this.getToggleAgentsSidebarButton().click();
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
static getChatPanel() {
|
|
166
|
+
return this.getTtygView().find('.chat-content');
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
static getChatPanelToolbar() {
|
|
170
|
+
return this.getChatPanel().find('.toolbar');
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
static getEditCurrentAgentButton() {
|
|
174
|
+
return this.getChatPanelToolbar().find('.edit-current-agent-btn');
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
static editCurrentAgent() {
|
|
178
|
+
return this.getEditCurrentAgentButton().click();
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
static getExportCurrentChatButton() {
|
|
182
|
+
return this.getChatPanelToolbar().find('.export-current-chat-btn');
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
static exportCurrentChat() {
|
|
186
|
+
return this.getExportCurrentChatButton().click();
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
static getChat() {
|
|
190
|
+
return this.getChatPanel().find('.chat');
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
static openAgentActionMenu(index) {
|
|
194
|
+
this.getAgent(index).realHover().find('.open-agent-actions-btn').click();
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
static triggerDeleteAgentActionMenu(index) {
|
|
198
|
+
this.openAgentActionMenu(index);
|
|
199
|
+
this.getAgent(index).find('.agent-actions-menu .delete-agent-btn').click();
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
static getAgentDeletingLoader() {
|
|
203
|
+
return this.getAgentsPanel().find('.agent-list .deleting-agent-loader');
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @param {*[]} data
|
|
208
|
+
*/
|
|
209
|
+
static verifyAgentList(data) {
|
|
210
|
+
this.getAgents().should('have.length', data.length);
|
|
211
|
+
data.forEach((agent, index) => {
|
|
212
|
+
this.getAgent(index).within(() => {
|
|
213
|
+
cy.get('.agent-name').should('contain', agent.name);
|
|
214
|
+
cy.get('.related-repository').should('contain', agent.repositoryId);
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
static getAgentsMenu() {
|
|
220
|
+
return this.getTtygView().find('.agent-select-menu');
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
static getAgentsMenuToggleButton() {
|
|
224
|
+
return this.getAgentsMenu().find('.dropdown-toggle-btn');
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
static openAgentsMenu() {
|
|
228
|
+
this.getAgentsMenuToggleButton().click();
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
static getAgentsFromMenu() {
|
|
232
|
+
return this.getAgentsMenu().find('.agent-menu-item');
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
static getAgentFromMenu(index) {
|
|
236
|
+
return this.getAgentsFromMenu().eq(index);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
static selectAgent(index) {
|
|
240
|
+
this.getAgentFromMenu(index).click();
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
static verifySelectAgentMenuItems(data) {
|
|
244
|
+
this.openAgentsMenu();
|
|
245
|
+
this.getAgentsFromMenu().should('have.length', data.length);
|
|
246
|
+
data.forEach((agent, index) => {
|
|
247
|
+
this.getAgentFromMenu(index).within(() => {
|
|
248
|
+
cy.get('.agent-name').should('contain', agent.name);
|
|
249
|
+
cy.get('.repository-id').should('contain', agent.repositoryId);
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|