graphdb-workbench-tests 2.8.0-TR4 → 2.8.0-Test
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/locale-en.json +22 -5
- package/fixtures/ttyg/chats/export-chat.json +34 -0
- package/fixtures/ttyg/chats/get-chat-1.json +10 -1
- package/integration/explore/class.relationships.spec.js +3 -3
- package/integration/ttyg/agent-list.spec.js +5 -0
- package/integration/ttyg/chat-list.spec.js +73 -8
- package/integration/ttyg/clone-agent.spec.js +71 -0
- package/integration/ttyg/create-agent.spec.js +6 -34
- package/integration/ttyg/edit-agent.spec.js +1 -1
- package/integration/ttyg/ttyg-view.spec.js +4 -5
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/steps/ttyg/ttyg-agent-settings-modal.steps.js +9 -1
- package/steps/ttyg/ttyg-view-steps.js +12 -6
- package/stubs/ttyg/ttyg-stubs.js +9 -1
package/fixtures/locale-en.json
CHANGED
|
@@ -280,6 +280,14 @@
|
|
|
280
280
|
"messages": {
|
|
281
281
|
"answer_copy_successful": "The answer was successfully copied to the clipboard.",
|
|
282
282
|
"answer_copy_failed": "Failed to copy the answer to the clipboard."
|
|
283
|
+
},
|
|
284
|
+
"dialog": {
|
|
285
|
+
"confirm_repository_change_before_open_similarity": {
|
|
286
|
+
"body": "If you proceed with creating the similarity index, GraphDB will open in a new tab and switch to the <b>{{repositoryId}}</b> repository."
|
|
287
|
+
},
|
|
288
|
+
"confirm_repository_change_before_open_connectors": {
|
|
289
|
+
"body": "If you proceed with creating the ChatGPT retrieval connector, GraphDB will open in a new tab and switch to the <b>{{repositoryId}}</b> repository."
|
|
290
|
+
}
|
|
283
291
|
}
|
|
284
292
|
},
|
|
285
293
|
"agent": {
|
|
@@ -289,7 +297,8 @@
|
|
|
289
297
|
"create_agent_modal": {
|
|
290
298
|
"title": {
|
|
291
299
|
"create": "Create Agent",
|
|
292
|
-
"edit": "Edit Agent"
|
|
300
|
+
"edit": "Edit Agent",
|
|
301
|
+
"clone": "Clone Agent"
|
|
293
302
|
},
|
|
294
303
|
"advanced_settings": {
|
|
295
304
|
"show": "Show advanced settings",
|
|
@@ -297,7 +306,7 @@
|
|
|
297
306
|
},
|
|
298
307
|
"form": {
|
|
299
308
|
"agent_name": {
|
|
300
|
-
"label": "
|
|
309
|
+
"label": "Agent name",
|
|
301
310
|
"placeholder": "Enter user friendly name"
|
|
302
311
|
},
|
|
303
312
|
"repository": {
|
|
@@ -323,7 +332,7 @@
|
|
|
323
332
|
},
|
|
324
333
|
"fts_search": {
|
|
325
334
|
"label": "Full-text search",
|
|
326
|
-
"fts_disabled_message": "
|
|
335
|
+
"fts_disabled_message": "You must <a href=\"{{repositoryEditPage}}\" target=\"_blank\">enable the full-text search (FTS) index</a> to use this method.",
|
|
327
336
|
"missing_repository_id": "Repository ID must be selected"
|
|
328
337
|
},
|
|
329
338
|
"sparql_search": {
|
|
@@ -342,14 +351,22 @@
|
|
|
342
351
|
"similarity_index": {
|
|
343
352
|
"label": "Similarity index name",
|
|
344
353
|
"loading_indexes": "Loading similarity indexes...",
|
|
345
|
-
"
|
|
354
|
+
"no_similarity_index": {
|
|
355
|
+
"message_1": "You must",
|
|
356
|
+
"message_2": "create a similarity index",
|
|
357
|
+
"message_3": "to use this method"
|
|
358
|
+
}
|
|
346
359
|
},
|
|
347
360
|
"similarity_threshold": {
|
|
348
361
|
"label": "Similarity threshold"
|
|
349
362
|
},
|
|
350
363
|
"retrieval_search": {
|
|
351
364
|
"label": "ChatGPT retrieval connector",
|
|
352
|
-
"
|
|
365
|
+
"no_retrieval_connectors": {
|
|
366
|
+
"message_1": "You must",
|
|
367
|
+
"message_2": "create ChatGPT retrieval connector",
|
|
368
|
+
"message_3": "to use this method"
|
|
369
|
+
}
|
|
353
370
|
},
|
|
354
371
|
"connector_id": {
|
|
355
372
|
"label": "ChatGPT retrieval connector"
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "thread_2IeqabOdLFcjAVub2DsMmdr6",
|
|
3
|
+
"name": "Han Solo is a fictional character in the...",
|
|
4
|
+
"messages": [
|
|
5
|
+
{
|
|
6
|
+
"id": "msg_1niL7yYidTfiGZynCiryiMMd",
|
|
7
|
+
"conversationId": "thread_gy2K7D3efStfchq2v5VvpEvn",
|
|
8
|
+
"agentId": null,
|
|
9
|
+
"role": "user",
|
|
10
|
+
"message": "Who are the Han Solo's children?",
|
|
11
|
+
"timestamp": "1725875483",
|
|
12
|
+
"name": null
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": "msg_YbtWCL64HPu9Kf7SbeRlrwCc",
|
|
16
|
+
"conversationId": "thread_gy2K7D3efStfchq2v5VvpEvn",
|
|
17
|
+
"agentId": "asst_uoKp5kgnPlyZHhRXY7P2r9D7",
|
|
18
|
+
"role": "assistant",
|
|
19
|
+
"message": "Han Solo is a fictional character in the Star Wars franchise. He is a Human male with fair skin and brown eyes. Han Solo is portrayed by Harrison Ford in the original Star Wars trilogy and in \"The Force Awakens.\" The character also appears in several other films and media within the Star Wars universe.\n\n**Key Details:**\n- **Gender:** Male\n- **Height:** 180 cm\n- **Mass:** 80 kg\n- **Birth Year:** 29BBY\n- **Eye Color:** Brown\n- **Hair Color:** Brown\n- **Homeworld:** Corellia (Planet 22)\n\n**Description:**\nHan Solo is a character in the Star Wars franchise. In the original film trilogy, Han and his co-pilot, Chewbacca, became involved in the Rebel Alliance's struggle against the Galactic Empire. During the course of the Star Wars narrative, he becomes a chief figure in the Alliance and succeeding galactic governments. Star Wars creator George Lucas described the character as \"a ",
|
|
20
|
+
"timestamp": "1725875332",
|
|
21
|
+
"name": null
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "msg_A9UeOFT9SF3pKzJzar1HwM7d",
|
|
25
|
+
"conversationId": "thread_gy2K7D3efStfchq2v5VvpEvn",
|
|
26
|
+
"agentId": null,
|
|
27
|
+
"role": "user",
|
|
28
|
+
"message": "Who is Han Solo?",
|
|
29
|
+
"timestamp": "1725875323",
|
|
30
|
+
"name": null
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"timestamp": "1725875483"
|
|
34
|
+
}
|
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
"id": "{chatId}",
|
|
3
3
|
"name": "Han Solo is a fictional character in the...",
|
|
4
4
|
"messages": [
|
|
5
|
+
{
|
|
6
|
+
"id": "msg_YbtWCL64HPu9Kf7SbsssseRlrwCc",
|
|
7
|
+
"conversationId": "thread_gy2K7D3efStfchq2v5VvpEvn",
|
|
8
|
+
"agentId": "asst_uoKp5kgnPlyZHhRXY7P2r9D7",
|
|
9
|
+
"role": "assistant",
|
|
10
|
+
"message": "Han Solo is a fictional character in the Star ",
|
|
11
|
+
"timestamp": "1725875332",
|
|
12
|
+
"name": null
|
|
13
|
+
},
|
|
5
14
|
{
|
|
6
15
|
"id": "msg_1niL7yYidTfiGZynCiryiMMd",
|
|
7
16
|
"conversationId": "thread_gy2K7D3efStfchq2v5VvpEvn",
|
|
@@ -16,7 +25,7 @@
|
|
|
16
25
|
"conversationId": "thread_gy2K7D3efStfchq2v5VvpEvn",
|
|
17
26
|
"agentId": "asst_uoKp5kgnPlyZHhRXY7P2r9D7",
|
|
18
27
|
"role": "assistant",
|
|
19
|
-
"message": "Han Solo is a fictional character in the Star Wars franchise.
|
|
28
|
+
"message": "Han Solo is a fictional character in the Star Wars franchise.",
|
|
20
29
|
"timestamp": "1725875332",
|
|
21
30
|
"name": null
|
|
22
31
|
},
|
|
@@ -52,15 +52,15 @@ describe('Class relations screen validation', () => {
|
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
it('Search for a class', function () {
|
|
55
|
-
// Expect
|
|
56
|
-
verifyListLength(
|
|
55
|
+
// Expect 39 rows initially to be visible
|
|
56
|
+
verifyListLength(39);
|
|
57
57
|
// Filter by partial name
|
|
58
58
|
filterByClass(':Wine');
|
|
59
59
|
// Expecting 6 rows to be present
|
|
60
60
|
verifyListLength(6);
|
|
61
61
|
// Clear the filter and expect all rows to be visible again
|
|
62
62
|
getFilterField().clear();
|
|
63
|
-
verifyListLength(
|
|
63
|
+
verifyListLength(39);
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
it('Test class relationships for given graph', () => {
|
|
@@ -13,6 +13,7 @@ describe('TTYG agent list', () => {
|
|
|
13
13
|
TTYGStubs.stubChatsListGet();
|
|
14
14
|
// Given I have opened the ttyg page
|
|
15
15
|
TTYGViewSteps.visit();
|
|
16
|
+
cy.wait('@get-agent-list-0');
|
|
16
17
|
// When the ttyg page is loaded
|
|
17
18
|
// Then I should see the agent list with agents filtered by the current repository
|
|
18
19
|
TTYGViewSteps.getAgentsPanel().should('be.visible');
|
|
@@ -24,9 +25,11 @@ describe('TTYG agent list', () => {
|
|
|
24
25
|
|
|
25
26
|
it('Should be able to toggle agents panel', () => {
|
|
26
27
|
TTYGStubs.stubChatsListGet();
|
|
28
|
+
TTYGStubs.stubChatGet();
|
|
27
29
|
TTYGStubs.stubAgentListGet();
|
|
28
30
|
// Given I have opened the ttyg page
|
|
29
31
|
TTYGViewSteps.visit();
|
|
32
|
+
cy.wait('@get-chat');
|
|
30
33
|
// When the ttyg page is loaded
|
|
31
34
|
// Then I should see the agent list
|
|
32
35
|
TTYGViewSteps.getAgents().should('have.length', 2);
|
|
@@ -43,9 +46,11 @@ describe('TTYG agent list', () => {
|
|
|
43
46
|
|
|
44
47
|
it('Should be able to filter the agent list by repository', () => {
|
|
45
48
|
TTYGStubs.stubAgentListGet();
|
|
49
|
+
TTYGStubs.stubChatGet();
|
|
46
50
|
TTYGStubs.stubChatsListGet();
|
|
47
51
|
// Given I have opened the ttyg page
|
|
48
52
|
TTYGViewSteps.visit();
|
|
53
|
+
cy.wait('@get-chat');
|
|
49
54
|
// When the ttyg page is loaded
|
|
50
55
|
TTYGViewSteps.getAgents().should('have.length', 2);
|
|
51
56
|
// Then Agent list filter should be set to All
|
|
@@ -3,9 +3,9 @@ import {TTYGStubs} from "../../stubs/ttyg/ttyg-stubs";
|
|
|
3
3
|
import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
|
|
4
4
|
import {RepositoriesStubs} from "../../stubs/repositories/repositories-stubs";
|
|
5
5
|
import {ApplicationSteps} from "../../steps/application-steps";
|
|
6
|
+
import HomeSteps from "../../steps/home-steps";
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
describe.skip('TTYG chat list', () => {
|
|
8
|
+
describe('TTYG chat list', () => {
|
|
9
9
|
|
|
10
10
|
beforeEach(() => {
|
|
11
11
|
RepositoriesStubs.stubRepositories(0, '/repositories/get-ttyg-repositories.json');
|
|
@@ -14,9 +14,12 @@ describe.skip('TTYG chat list', () => {
|
|
|
14
14
|
|
|
15
15
|
it('Should render chat list', () => {
|
|
16
16
|
TTYGStubs.stubChatsListGet();
|
|
17
|
+
TTYGStubs.stubChatGet();
|
|
17
18
|
TTYGStubs.stubAgentListGet();
|
|
19
|
+
TTYGStubs.stubChatGet();
|
|
18
20
|
// Given I have opened the ttyg page
|
|
19
21
|
TTYGViewSteps.visit();
|
|
22
|
+
cy.wait('@get-chat');
|
|
20
23
|
// When the ttyg page is loaded
|
|
21
24
|
// Then I should see the chat list
|
|
22
25
|
// TODO: Temporary removed because it fails on CI.
|
|
@@ -27,9 +30,9 @@ describe.skip('TTYG chat list', () => {
|
|
|
27
30
|
// And the first chat group should have 3 chats
|
|
28
31
|
verifyChatList([
|
|
29
32
|
[
|
|
30
|
-
{name: '
|
|
33
|
+
{name: 'Test chat 3'},
|
|
31
34
|
{name: 'Test chat 2'},
|
|
32
|
-
{name: '
|
|
35
|
+
{name: 'Very long chat name which does not fit in the sidebar'}
|
|
33
36
|
],
|
|
34
37
|
[{name: 'Test chat 4'}]
|
|
35
38
|
]);
|
|
@@ -38,6 +41,7 @@ describe.skip('TTYG chat list', () => {
|
|
|
38
41
|
it('Should render no results when there are no chats', () => {
|
|
39
42
|
TTYGStubs.stubChatsListGetNoResults();
|
|
40
43
|
TTYGStubs.stubAgentListGet();
|
|
44
|
+
TTYGStubs.stubChatGet();
|
|
41
45
|
// Given I have opened the ttyg page
|
|
42
46
|
TTYGViewSteps.visit();
|
|
43
47
|
// When the ttyg page is loaded
|
|
@@ -50,12 +54,20 @@ describe.skip('TTYG chat list', () => {
|
|
|
50
54
|
TTYGViewSteps.getChatByDayGroups().should('have.length', 0);
|
|
51
55
|
});
|
|
52
56
|
|
|
53
|
-
it('Should be able to edit an existing chat name by double click on the chat in the list',
|
|
57
|
+
it('Should be able to edit an existing chat name by double click on the chat in the list', {
|
|
58
|
+
retries: {
|
|
59
|
+
runMode: 1,
|
|
60
|
+
openMode: 0
|
|
61
|
+
}
|
|
62
|
+
}, () => {
|
|
54
63
|
TTYGStubs.stubChatsListGet();
|
|
64
|
+
TTYGStubs.stubChatGet();
|
|
55
65
|
TTYGStubs.stubAgentListGet();
|
|
56
66
|
TTYGStubs.stubChatUpdate();
|
|
67
|
+
TTYGStubs.stubChatGet();
|
|
57
68
|
// Given I have opened the ttyg page and there are chats loaded
|
|
58
69
|
TTYGViewSteps.visit();
|
|
70
|
+
cy.wait('@get-chat');
|
|
59
71
|
// And I double-click on the chat name I want to rename
|
|
60
72
|
TTYGViewSteps.editChatName(1, 0);
|
|
61
73
|
// Then I should see the chat name input
|
|
@@ -69,12 +81,20 @@ describe.skip('TTYG chat list', () => {
|
|
|
69
81
|
TTYGViewSteps.getChatFromGroup(1, 0).should('contain', 'New chat name');
|
|
70
82
|
});
|
|
71
83
|
|
|
72
|
-
it('Should be able to edit an existing chat name through the action menu',
|
|
84
|
+
it('Should be able to edit an existing chat name through the action menu', {
|
|
85
|
+
retries: {
|
|
86
|
+
runMode: 1,
|
|
87
|
+
openMode: 0
|
|
88
|
+
}
|
|
89
|
+
}, () => {
|
|
73
90
|
TTYGStubs.stubChatsListGet();
|
|
91
|
+
TTYGStubs.stubChatGet();
|
|
74
92
|
TTYGStubs.stubAgentListGet();
|
|
75
93
|
TTYGStubs.stubChatUpdate();
|
|
94
|
+
TTYGStubs.stubChatGet();
|
|
76
95
|
// Given I have opened the ttyg page and there are chats loaded
|
|
77
96
|
TTYGViewSteps.visit();
|
|
97
|
+
cy.wait('@get-chat');
|
|
78
98
|
// And I open the action menu for the chat I want to rename
|
|
79
99
|
TTYGViewSteps.selectChat(1, 0);
|
|
80
100
|
TTYGViewSteps.triggerEditChatActionMenu(1, 0);
|
|
@@ -91,27 +111,33 @@ describe.skip('TTYG chat list', () => {
|
|
|
91
111
|
|
|
92
112
|
it('Should be able to cancel a chat name editing', () => {
|
|
93
113
|
TTYGStubs.stubChatsListGet();
|
|
114
|
+
TTYGStubs.stubChatGet();
|
|
94
115
|
TTYGStubs.stubAgentListGet();
|
|
116
|
+
TTYGStubs.stubChatGet();
|
|
95
117
|
// Given I have opened the ttyg page and there are chats loaded
|
|
96
118
|
TTYGViewSteps.visit();
|
|
119
|
+
cy.wait('@get-chat');
|
|
97
120
|
// And I double-click on the first chat
|
|
98
121
|
TTYGViewSteps.editChatName(0, 0);
|
|
99
122
|
// Then I should see the chat name input
|
|
100
|
-
TTYGViewSteps.getChatNameInput(0, 0).should('be.visible').and('have.value', '
|
|
123
|
+
TTYGViewSteps.getChatNameInput(0, 0).should('be.visible').and('have.value', 'Test chat 3');
|
|
101
124
|
// When I change the chat name
|
|
102
125
|
TTYGViewSteps.writeChatName(0, 0, 'New chat name');
|
|
103
126
|
// And I hit [esc] key
|
|
104
127
|
TTYGViewSteps.cancelChatNameSaving(0, 0);
|
|
105
128
|
// Then I should see the old chat name
|
|
106
|
-
TTYGViewSteps.getChatFromGroup(0, 0).should('contain', '
|
|
129
|
+
TTYGViewSteps.getChatFromGroup(0, 0).should('contain', 'Test chat 3');
|
|
107
130
|
});
|
|
108
131
|
|
|
109
132
|
it('Should be able to delete a chat', () => {
|
|
110
133
|
TTYGStubs.stubChatsListGet();
|
|
134
|
+
TTYGStubs.stubChatGet();
|
|
111
135
|
TTYGStubs.stubAgentListGet();
|
|
112
136
|
TTYGStubs.stubChatDelete();
|
|
137
|
+
TTYGStubs.stubChatGet();
|
|
113
138
|
// Given I have opened the ttyg page and there are chats loaded
|
|
114
139
|
TTYGViewSteps.visit();
|
|
140
|
+
cy.wait('@get-chat');
|
|
115
141
|
// When I select the delete action from the chat action menu
|
|
116
142
|
TTYGViewSteps.triggerDeleteChatActionMenu(1, 0);
|
|
117
143
|
// Then I should see the chat deletion confirmation dialog
|
|
@@ -129,9 +155,25 @@ describe.skip('TTYG chat list', () => {
|
|
|
129
155
|
TTYGViewSteps.getChatByDayGroups().should('have.length', 1);
|
|
130
156
|
});
|
|
131
157
|
|
|
158
|
+
it('Should be able to export chat from chat list export action', () => {
|
|
159
|
+
TTYGStubs.stubAgentListGet();
|
|
160
|
+
TTYGStubs.stubChatsListGet();
|
|
161
|
+
TTYGStubs.stubChatExport();
|
|
162
|
+
TTYGStubs.stubChatGet();
|
|
163
|
+
// Given I have opened the ttyg page and there are chats loaded
|
|
164
|
+
TTYGViewSteps.visit();
|
|
165
|
+
cy.wait('@get-chat');
|
|
166
|
+
// When I select the export chat action chat panel toolbar
|
|
167
|
+
TTYGViewSteps.triggerExportChatActionMenu(1, 0);
|
|
168
|
+
cy.wait('@export-chat');
|
|
169
|
+
// Then I expect to download the chat as a file
|
|
170
|
+
TTYGViewSteps.verifyFileExists('chat-export.json')
|
|
171
|
+
});
|
|
172
|
+
|
|
132
173
|
it('Should show error notification if chat list fails to load', () => {
|
|
133
174
|
TTYGStubs.stubChatListGetError();
|
|
134
175
|
TTYGStubs.stubAgentListGet();
|
|
176
|
+
TTYGStubs.stubChatGet();
|
|
135
177
|
// Given I have opened the ttyg page
|
|
136
178
|
TTYGViewSteps.visit();
|
|
137
179
|
// When the chat list fails to load
|
|
@@ -142,6 +184,29 @@ describe.skip('TTYG chat list', () => {
|
|
|
142
184
|
// And the chat list should not be visible
|
|
143
185
|
TTYGViewSteps.getChatsPanel().should('be.hidden');
|
|
144
186
|
});
|
|
187
|
+
|
|
188
|
+
it('should persist selected chat', () => {
|
|
189
|
+
TTYGStubs.stubChatsListGet();
|
|
190
|
+
TTYGStubs.stubChatGet();
|
|
191
|
+
TTYGStubs.stubAgentListGet();
|
|
192
|
+
// Given I have opened the ttyg page
|
|
193
|
+
TTYGViewSteps.visit();
|
|
194
|
+
cy.wait('@get-chat');
|
|
195
|
+
TTYGViewSteps.getChatFromGroup(0, 0).should('have.class', 'selected');
|
|
196
|
+
|
|
197
|
+
// When I select another chat,
|
|
198
|
+
TTYGViewSteps.selectChat(0, 2);
|
|
199
|
+
TTYGViewSteps.getChatFromGroup(0, 0).should('have.not.class', 'selected');
|
|
200
|
+
TTYGViewSteps.getChatFromGroup(0, 2).should('have.class', 'selected');
|
|
201
|
+
// change the page,
|
|
202
|
+
HomeSteps.visit();
|
|
203
|
+
cy.wait('@get-chat');
|
|
204
|
+
// and came back to the ttyg page
|
|
205
|
+
TTYGViewSteps.visit();
|
|
206
|
+
|
|
207
|
+
// Then I expect to last used chat be selected.
|
|
208
|
+
TTYGViewSteps.getChatFromGroup(0, 2).should('have.class', 'selected');
|
|
209
|
+
});
|
|
145
210
|
});
|
|
146
211
|
|
|
147
212
|
/**
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import {RepositoriesStubs} from "../../stubs/repositories/repositories-stubs";
|
|
2
|
+
import {NamespaceStubs} from "../../stubs/namespace-stubs";
|
|
3
|
+
import {TTYGViewSteps} from "../../steps/ttyg/ttyg-view-steps";
|
|
4
|
+
import {TTYGStubs} from "../../stubs/ttyg/ttyg-stubs";
|
|
5
|
+
import {TtygAgentSettingsModalSteps} from "../../steps/ttyg/ttyg-agent-settings-modal.steps";
|
|
6
|
+
|
|
7
|
+
describe('TTYG clone an agent', () => {
|
|
8
|
+
const repositoryId = 'starwars';
|
|
9
|
+
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
RepositoriesStubs.stubRepositories(0, '/repositories/get-ttyg-repositories.json');
|
|
12
|
+
cy.presetRepository(repositoryId);
|
|
13
|
+
NamespaceStubs.stubNameSpaceResponse(repositoryId, '/namespaces/get-repository-starwars-namespaces.json');
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it(' should be able to clone an agent.', () => {
|
|
17
|
+
TTYGStubs.stubAgentListGet();
|
|
18
|
+
TTYGStubs.stubChatsListGet();
|
|
19
|
+
TTYGStubs.stubChatGet();
|
|
20
|
+
// Given I have opened the ttyg page
|
|
21
|
+
TTYGViewSteps.visit();
|
|
22
|
+
cy.wait('@get-chat');
|
|
23
|
+
// When I select to clone an agent
|
|
24
|
+
TTYGViewSteps.triggerCloneAgentActionMenu(0);
|
|
25
|
+
// Then I expect to see the clone agent settings modal
|
|
26
|
+
TtygAgentSettingsModalSteps.getDialog().should('be.visible');
|
|
27
|
+
TtygAgentSettingsModalSteps.getDialogHeader().should('contain', 'Clone Agent');
|
|
28
|
+
// And I expect the agent name to be prefixed with 'clone-'
|
|
29
|
+
TtygAgentSettingsModalSteps.getAgentNameField().should('have.value', 'clone-agent-1');
|
|
30
|
+
// And the FTS search method should be selected
|
|
31
|
+
TtygAgentSettingsModalSteps.getSelectedExtractionMethods().should('have.length', 1);
|
|
32
|
+
TtygAgentSettingsModalSteps.getSelectedExtractionMethod(0).should('contain', 'Full-text search');
|
|
33
|
+
// And the agent save button should be enabled
|
|
34
|
+
TtygAgentSettingsModalSteps.getSaveAgentButton().should('be.enabled').and('contain', 'Save');
|
|
35
|
+
// When I change the agent name
|
|
36
|
+
TtygAgentSettingsModalSteps.clearAgentName();
|
|
37
|
+
TtygAgentSettingsModalSteps.typeAgentName('agent-11');
|
|
38
|
+
// And I select additional extraction method
|
|
39
|
+
TtygAgentSettingsModalSteps.checkIriDiscoverySearchCheckbox();
|
|
40
|
+
// And save the agent
|
|
41
|
+
// We don't verify the response here, we just want to make sure the request is sent with the correct data
|
|
42
|
+
TTYGStubs.stubAgentCreate();
|
|
43
|
+
TtygAgentSettingsModalSteps.saveAgent();
|
|
44
|
+
cy.wait('@create-agent').then((interception) => {
|
|
45
|
+
assert.deepEqual(interception.request.body, {
|
|
46
|
+
"id": "asst_gAPcrHQQ9ZIxD5eXWH2BNFfo",
|
|
47
|
+
"name": "agent-11",
|
|
48
|
+
"repositoryId": "starwars",
|
|
49
|
+
"model": "gpt-4o",
|
|
50
|
+
"temperature": 0,
|
|
51
|
+
"topP": 0,
|
|
52
|
+
"seed": null,
|
|
53
|
+
"assistantsInstructions": {
|
|
54
|
+
"systemInstruction": "",
|
|
55
|
+
"userInstruction": ""
|
|
56
|
+
},
|
|
57
|
+
"assistantExtractionMethods": [
|
|
58
|
+
{
|
|
59
|
+
"method": "fts_search",
|
|
60
|
+
"maxNumberOfTriplesPerCall": 44
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"additionalExtractionMethods": [
|
|
64
|
+
{
|
|
65
|
+
"method": "iri_discovery_search"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
});
|
|
@@ -31,7 +31,12 @@ describe('TTYG create new agent', () => {
|
|
|
31
31
|
TTYGViewSteps.getNoAgentsView().should('be.visible');
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
it('Should be able to create a new agent with SPARQL extraction method on the no agents view',
|
|
34
|
+
it('Should be able to create a new agent with SPARQL extraction method on the no agents view', {
|
|
35
|
+
retries: {
|
|
36
|
+
runMode: 1,
|
|
37
|
+
openMode: 0
|
|
38
|
+
}
|
|
39
|
+
}, () => {
|
|
35
40
|
TTYGStubs.stubChatsListGetNoResults();
|
|
36
41
|
TTYGStubs.stubAgentListGet('/ttyg/agent/get-agent-list-0.json');
|
|
37
42
|
// Given I have opened the ttyg page
|
|
@@ -48,9 +53,6 @@ describe('TTYG create new agent', () => {
|
|
|
48
53
|
// agent name
|
|
49
54
|
fillAgentName('Test Agent');
|
|
50
55
|
|
|
51
|
-
// repository ID
|
|
52
|
-
fillRepository(repositoryId);
|
|
53
|
-
|
|
54
56
|
// SPARQL extraction method settings
|
|
55
57
|
|
|
56
58
|
// At least one extraction method must be selected
|
|
@@ -131,28 +133,6 @@ describe('TTYG create new agent', () => {
|
|
|
131
133
|
TTYGViewSteps.getAgent(0).should('contain', 'Test Agent').and('contain', 'starwars');
|
|
132
134
|
});
|
|
133
135
|
|
|
134
|
-
it('Should require repository ID to be selected to be able to configure the FTS extraction method', () => {
|
|
135
|
-
RepositoriesStubs.stubGetRepositoryConfig(repositoryId, '/repositories/get-repository-config-starwars-disabled-fts.json');
|
|
136
|
-
TTYGStubs.stubChatsListGetNoResults();
|
|
137
|
-
TTYGStubs.stubAgentListGet('/ttyg/agent/get-agent-list-0.json');
|
|
138
|
-
// Given I have opened the ttyg page
|
|
139
|
-
TTYGViewSteps.visit();
|
|
140
|
-
cy.wait('@get-all-repositories');
|
|
141
|
-
// When I click on the create agent button
|
|
142
|
-
TTYGViewSteps.createFirstAgent();
|
|
143
|
-
// When I open the full text search extraction method panel
|
|
144
|
-
TtygAgentSettingsModalSteps.toggleFTSExtractionMethodPanel();
|
|
145
|
-
// Then I should see an error alert for repository id not selected
|
|
146
|
-
TtygAgentSettingsModalSteps.getMissingRepositoryIdErrorInFtsSearchPanel().should('be.visible')
|
|
147
|
-
.and('contain', 'Repository ID must be selected');
|
|
148
|
-
// And I should not see the max triples field
|
|
149
|
-
TtygAgentSettingsModalSteps.getFtsSearchMaxTriplesFormGroup().should('be.hidden');
|
|
150
|
-
// When I select a repository
|
|
151
|
-
TtygAgentSettingsModalSteps.selectRepository(repositoryId);
|
|
152
|
-
// Then the error alert should be hidden
|
|
153
|
-
TtygAgentSettingsModalSteps.getMissingRepositoryIdErrorInFtsSearchPanel().should('not.exist');
|
|
154
|
-
});
|
|
155
|
-
|
|
156
136
|
it('Should require FTS to be enabled for selected repository when creating agent with FTS extraction method', () => {
|
|
157
137
|
RepositoriesStubs.stubGetRepositoryConfig(repositoryId, '/repositories/get-repository-config-starwars-disabled-fts.json');
|
|
158
138
|
TTYGStubs.stubChatsListGetNoResults();
|
|
@@ -299,7 +279,6 @@ describe('TTYG create new agent', () => {
|
|
|
299
279
|
TtygAgentSettingsModalSteps.typeAgentName('Test Agent');
|
|
300
280
|
TtygAgentSettingsModalSteps.selectRepository(repositoryId);
|
|
301
281
|
// When I select and open the GPT retrieval connector method panel
|
|
302
|
-
TtygAgentSettingsModalSteps.toggleRetrievalMethodPanel();
|
|
303
282
|
TtygAgentSettingsModalSteps.enableRetrievalMethodPanel();
|
|
304
283
|
// And I select a retrieval connector
|
|
305
284
|
TtygAgentSettingsModalSteps.getRetrievalConnectorField().should('have.value', '');
|
|
@@ -339,10 +318,3 @@ function fillAgentName(name) {
|
|
|
339
318
|
TtygAgentSettingsModalSteps.getAgentNameError().should('be.visible').and('contain', 'This field is required');
|
|
340
319
|
TtygAgentSettingsModalSteps.typeAgentName(name);
|
|
341
320
|
}
|
|
342
|
-
|
|
343
|
-
function fillRepository(repositoryId) {
|
|
344
|
-
TtygAgentSettingsModalSteps.getRepositoryIdError().should('be.visible').and('contain', 'This field is required');
|
|
345
|
-
TtygAgentSettingsModalSteps.selectRepository(repositoryId);
|
|
346
|
-
// the save button should be disabled because there are other required fields that are not filled in yet
|
|
347
|
-
TtygAgentSettingsModalSteps.getSaveAgentButton().should('be.disabled');
|
|
348
|
-
}
|
|
@@ -5,7 +5,7 @@ import {TTYGStubs} from "../../stubs/ttyg/ttyg-stubs";
|
|
|
5
5
|
import {TtygAgentSettingsModalSteps} from "../../steps/ttyg/ttyg-agent-settings-modal.steps";
|
|
6
6
|
import {ToasterSteps} from "../../steps/toaster-steps";
|
|
7
7
|
|
|
8
|
-
describe('TTYG
|
|
8
|
+
describe('TTYG edit an agent', () => {
|
|
9
9
|
const repositoryId = 'starwars';
|
|
10
10
|
|
|
11
11
|
beforeEach(() => {
|
|
@@ -14,13 +14,13 @@ describe('TTYG view', () => {
|
|
|
14
14
|
NamespaceStubs.stubNameSpaceResponse(repositoryId, '/namespaces/get-repository-starwars-namespaces.json');
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
it.skip('Should load ttyg page and render main components', () => {
|
|
17
|
+
it('Should load ttyg page and render main components', () => {
|
|
19
18
|
TTYGStubs.stubChatsListGet();
|
|
20
19
|
TTYGStubs.stubAgentListGet();
|
|
21
20
|
TTYGStubs.stubChatGet();
|
|
22
21
|
// Given I have opened the ttyg page
|
|
23
22
|
TTYGViewSteps.visit();
|
|
23
|
+
cy.wait('@get-chat');
|
|
24
24
|
// When the ttyg page is loaded
|
|
25
25
|
// Then I should see the ttyg view
|
|
26
26
|
TTYGViewSteps.getTtygView().should('exist');
|
|
@@ -28,8 +28,8 @@ describe('TTYG view', () => {
|
|
|
28
28
|
// Verify the chats sidebar
|
|
29
29
|
TTYGViewSteps.getChatsPanel().should('be.visible');
|
|
30
30
|
TTYGViewSteps.getToggleChatsSidebarButton().should('be.visible');
|
|
31
|
-
// The create chat button is
|
|
32
|
-
TTYGViewSteps.getCreateChatButton().should('
|
|
31
|
+
// The create chat button is visible when there are chats
|
|
32
|
+
TTYGViewSteps.getCreateChatButton().should('exist');
|
|
33
33
|
// Verify the agents sidebar
|
|
34
34
|
TTYGViewSteps.getAgentsPanel().should('be.visible');
|
|
35
35
|
TTYGViewSteps.getHelpButton().should('be.visible');
|
|
@@ -39,7 +39,6 @@ describe('TTYG view', () => {
|
|
|
39
39
|
TTYGViewSteps.getChat().should('be.visible');
|
|
40
40
|
TTYGViewSteps.getChatPanelToolbar().should('be.visible');
|
|
41
41
|
TTYGViewSteps.getEditCurrentAgentButton().should('be.visible');
|
|
42
|
-
TTYGViewSteps.getExportCurrentChatButton().should('be.visible');
|
|
43
42
|
});
|
|
44
43
|
|
|
45
44
|
it('Should render no agents view if no agent is created yet', () => {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphdb-workbench-tests",
|
|
3
|
-
"version": "2.8.0-
|
|
3
|
+
"version": "2.8.0-Test",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "graphdb-workbench-tests",
|
|
9
|
-
"version": "2.8.0-
|
|
9
|
+
"version": "2.8.0-Test",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"cypress": "^13.3.1",
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ export class TtygAgentSettingsModalSteps extends ModalDialogSteps {
|
|
|
17
17
|
// Agent name
|
|
18
18
|
|
|
19
19
|
static getAgentNameFormGroup() {
|
|
20
|
-
return this.getDialog().find('.agent-name');
|
|
20
|
+
return this.getDialog().find('.agent-name-label');
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
static getAgentNameField() {
|
|
@@ -65,6 +65,14 @@ export class TtygAgentSettingsModalSteps extends ModalDialogSteps {
|
|
|
65
65
|
return this.getDialog().find(`#${method}_method_heading`);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
static getSelectedExtractionMethods() {
|
|
69
|
+
return this.getDialog().find('.extraction-method-heading.selected');
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
static getSelectedExtractionMethod(index) {
|
|
73
|
+
return this.getSelectedExtractionMethods().eq(index);
|
|
74
|
+
}
|
|
75
|
+
|
|
68
76
|
static getExtractionMethodPanel(method) {
|
|
69
77
|
return this.getDialog().find(`#${method}_method_content`).find('.extraction-method-options');
|
|
70
78
|
}
|
|
@@ -89,6 +89,11 @@ export class TTYGViewSteps {
|
|
|
89
89
|
this.getChatFromGroup(groupIndex, chatIndex).find('.chat-actions-menu .delete-chat-btn').click();
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
static triggerExportChatActionMenu(groupIndex, chatIndex) {
|
|
93
|
+
this.openChatActionMenu(groupIndex, chatIndex);
|
|
94
|
+
this.getChatFromGroup(groupIndex, chatIndex).find('.chat-actions-menu .export-chat-btn').click();
|
|
95
|
+
}
|
|
96
|
+
|
|
92
97
|
static getToggleChatsSidebarButton() {
|
|
93
98
|
return this.getChatsSidebar().find('.toggle-chats-sidebar-btn');
|
|
94
99
|
}
|
|
@@ -178,12 +183,8 @@ export class TTYGViewSteps {
|
|
|
178
183
|
return this.getEditCurrentAgentButton().click();
|
|
179
184
|
}
|
|
180
185
|
|
|
181
|
-
static
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
static exportCurrentChat() {
|
|
186
|
-
return this.getExportCurrentChatButton().click();
|
|
186
|
+
static verifyFileExists(fileName) {
|
|
187
|
+
cy.readFile('cypress/downloads/' + fileName);
|
|
187
188
|
}
|
|
188
189
|
|
|
189
190
|
static getChat() {
|
|
@@ -194,6 +195,11 @@ export class TTYGViewSteps {
|
|
|
194
195
|
this.getAgent(index).realHover().find('.open-agent-actions-btn').click();
|
|
195
196
|
}
|
|
196
197
|
|
|
198
|
+
static triggerCloneAgentActionMenu(index) {
|
|
199
|
+
this.openAgentActionMenu(index);
|
|
200
|
+
this.getAgent(index).find('.agent-actions-menu .clone-agent-btn').click();
|
|
201
|
+
}
|
|
202
|
+
|
|
197
203
|
static triggerDeleteAgentActionMenu(index) {
|
|
198
204
|
this.openAgentActionMenu(index);
|
|
199
205
|
this.getAgent(index).find('.agent-actions-menu .delete-agent-btn').click();
|
package/stubs/ttyg/ttyg-stubs.js
CHANGED
|
@@ -41,7 +41,7 @@ export class TTYGStubs extends Stubs {
|
|
|
41
41
|
static stubChatGet(fixture = '/ttyg/chats/get-chat-1.json', delay = 0) {
|
|
42
42
|
cy.fixture(fixture).then((body) => {
|
|
43
43
|
const bodyString = JSON.stringify(body);
|
|
44
|
-
cy.intercept('/rest/chat/conversations
|
|
44
|
+
cy.intercept('/rest/chat/conversations/*', (req) => {
|
|
45
45
|
const chatId = req.url.split('/').pop();
|
|
46
46
|
// Respond with the modified body
|
|
47
47
|
req.reply({
|
|
@@ -69,6 +69,14 @@ export class TTYGStubs extends Stubs {
|
|
|
69
69
|
}).as('delete-chat');
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
static stubChatExport() {
|
|
73
|
+
cy.intercept('/rest/chat/conversations/export/*', {
|
|
74
|
+
method: 'GET',
|
|
75
|
+
fixture: '/ttyg/chats/export-chat.json',
|
|
76
|
+
statusCode: 200
|
|
77
|
+
}).as('export-chat');
|
|
78
|
+
}
|
|
79
|
+
|
|
72
80
|
static stubAgentListGet(fixture = '/ttyg/agent/get-agent-list.json', delay = 0, invocation = 0) {
|
|
73
81
|
cy.intercept('/rest/chat/agents', {
|
|
74
82
|
method: 'GET',
|