graphdb-workbench-tests 3.2.0-cypress-config → 3.2.0
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/cypress.config.js +2 -12
- package/e2e-legacy/cluster/cluster-states.spec.js +3 -3
- package/e2e-legacy/import/initial-state/import-page-without-selected-repository.spec.js +1 -1
- package/e2e-legacy/not-found/not-found.spec.js +23 -0
- package/e2e-legacy/ttyg/chat-panel.spec.js +30 -0
- package/e2e-legacy/ttyg/create-agent.spec.js +20 -9
- package/e2e-legacy/ttyg/create-chat.spec.js +2 -1
- package/e2e-legacy/ttyg/ttyg-initial-state-with-selected-repository.spec.js +1 -1
- package/fixtures/ttyg/agent/get-agent-defaults.json +7 -2
- package/fixtures/ttyg/agent/get-similarity-indexes-for-another-repo.json +6 -0
- package/fixtures/ttyg/agent/get-similarity-indexes.json +13 -0
- package/fixtures/ttyg/chats/ask-question-cancel.json +12 -0
- package/fixtures/ttyg/chats/cancel-question-response.json +1 -0
- package/fixtures/ttyg/chats/create/create-chat-response.json +10 -14
- package/fixtures/ttyg/chats/create/question-response-after-chat-creation.json +29 -0
- package/npm-shrinkwrap.json +821 -854
- package/package.json +1 -2
- package/steps/base-steps.js +4 -0
- package/steps/not-found/not-found-steps.js +23 -0
- package/steps/operations-statuses-component-steps.js +3 -3
- package/steps/setup/user-and-access-steps.js +3 -3
- package/steps/ttyg/chat-panel-steps.js +20 -0
- package/steps/ttyg/ttyg-agent-settings-modal.steps.js +14 -2
- package/stubs/ttyg/ttyg-stubs.js +44 -6
package/cypress.config.js
CHANGED
|
@@ -25,7 +25,7 @@ export default defineConfig({
|
|
|
25
25
|
on('file:preprocessor', webpackPreprocessor({
|
|
26
26
|
webpackOptions: {
|
|
27
27
|
resolve: {
|
|
28
|
-
extensions: ['.js', '.
|
|
28
|
+
extensions: ['.js', '.json'],
|
|
29
29
|
modules: ['node_modules', '.'],
|
|
30
30
|
fullySpecified: false,
|
|
31
31
|
alias: {
|
|
@@ -44,16 +44,6 @@ export default defineConfig({
|
|
|
44
44
|
},
|
|
45
45
|
module: {
|
|
46
46
|
rules: [
|
|
47
|
-
{
|
|
48
|
-
test: /\.jsx?$/,
|
|
49
|
-
exclude: /node_modules/,
|
|
50
|
-
use: {
|
|
51
|
-
loader: 'babel-loader',
|
|
52
|
-
options: {
|
|
53
|
-
presets: ['@babel/preset-env']
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
47
|
{
|
|
58
48
|
test: /\.js$/,
|
|
59
49
|
resolve: {
|
|
@@ -68,7 +58,7 @@ export default defineConfig({
|
|
|
68
58
|
return setupPlugins(on, config);
|
|
69
59
|
},
|
|
70
60
|
baseUrl: 'http://localhost:9000',
|
|
71
|
-
specPattern: './**/*.
|
|
61
|
+
specPattern: './**/*.js',
|
|
72
62
|
supportFile: 'support/e2e.js',
|
|
73
63
|
reporter: "cypress-multi-reporters",
|
|
74
64
|
reporterOptions: {
|
|
@@ -104,14 +104,14 @@ describe('Cluster states', () => {
|
|
|
104
104
|
ClusterViewSteps.getLink('pc-desktop-7300-pc-desktop-7302').should('have.css', 'stroke-dasharray', '10px, 10px')
|
|
105
105
|
.and('have.css', 'marker-mid', 'url("#arrowhead_big")')
|
|
106
106
|
.invoke('attr', 'stroke')
|
|
107
|
-
.should('eq', 'var(--secondary-
|
|
107
|
+
.should('eq', 'var(--gw-secondary-base)');
|
|
108
108
|
// And I expect an out of sync link between the leader and the out of sync node (the one receiving the snapshot)
|
|
109
109
|
ClusterViewSteps.getLink('pc-desktop-7301-pc-desktop-7300').should('have.css', 'stroke-dasharray', '10px, 10px')
|
|
110
110
|
.invoke('attr', 'stroke')
|
|
111
|
-
.should('eq', 'var(--
|
|
111
|
+
.should('eq', 'var(--gw-neutral-base)');
|
|
112
112
|
// And I expect to have an in sync link between the leader and the node sending the snapshot
|
|
113
113
|
ClusterViewSteps.getLink('pc-desktop-7301-pc-desktop-7302').should('have.css', 'stroke-dasharray', 'none')
|
|
114
114
|
.invoke('attr', 'stroke')
|
|
115
|
-
.should('eq', 'var(--secondary-
|
|
115
|
+
.should('eq', 'var(--gw-secondary-base)');
|
|
116
116
|
});
|
|
117
117
|
});
|
|
@@ -23,6 +23,6 @@ describe('Initial state of the import view without a selected repository', () =>
|
|
|
23
23
|
|
|
24
24
|
const verifyInitialStateWhenNoRepositoryIsSelected = () => {
|
|
25
25
|
RepositoryErrorsWidgetSteps.getWidget().should('be.visible');
|
|
26
|
-
ImportUserDataSteps.getResourcesTable().should('
|
|
26
|
+
ImportUserDataSteps.getResourcesTable().should('not.exist');
|
|
27
27
|
};
|
|
28
28
|
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {NotFoundSteps} from "../../steps/not-found/not-found-steps.js";
|
|
2
|
+
|
|
3
|
+
describe('Not found page', () => {
|
|
4
|
+
|
|
5
|
+
it('Should display the 404 not found page for an unknown route', () => {
|
|
6
|
+
// Given, I navigate to an unknown route
|
|
7
|
+
NotFoundSteps.visit('/unknown-route');
|
|
8
|
+
|
|
9
|
+
// Then, I expect to see the 404 not found page
|
|
10
|
+
NotFoundSteps.getNotFoundBanner().should('be.visible');
|
|
11
|
+
NotFoundSteps.getNotFoundContent().should('contain', '404 That’s an error!');
|
|
12
|
+
NotFoundSteps.getNotFoundContent().should('contain', 'The requested URL was not found on this server. That’s all I know.');
|
|
13
|
+
NotFoundSteps.getGoHomeButton().should('be.visible');
|
|
14
|
+
|
|
15
|
+
// When, I click on the "Go Home" button
|
|
16
|
+
NotFoundSteps.clickGoHomeButton();
|
|
17
|
+
|
|
18
|
+
// Then, I expect to be redirected to the home page
|
|
19
|
+
NotFoundSteps.getUrl().should('eq', `${Cypress.config('baseUrl')}/`);
|
|
20
|
+
// And the banner should no longer be visible
|
|
21
|
+
NotFoundSteps.getNotFoundBanner().should('not.exist');
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -190,6 +190,36 @@ describe('Ttyg ChatPanel', () => {
|
|
|
190
190
|
.and('contain', 'completion tokens');
|
|
191
191
|
});
|
|
192
192
|
|
|
193
|
+
it('Should abort question', () => {
|
|
194
|
+
// When I type a question
|
|
195
|
+
ChatPanelSteps.getQuestionInputElement()
|
|
196
|
+
.should('be.visible')
|
|
197
|
+
.and('not.have.attr', 'disabled');
|
|
198
|
+
ChatPanelSteps.getQuestionInputElement()
|
|
199
|
+
.type('Who is Han Solo?');
|
|
200
|
+
|
|
201
|
+
// Then I expect the "Ask" button be active
|
|
202
|
+
ChatPanelSteps.getAskButtonElement().should('be.enabled');
|
|
203
|
+
|
|
204
|
+
// When I click on "Ask" button
|
|
205
|
+
TTYGStubs.stubAnswerQuestionWithDelay();
|
|
206
|
+
TTYGStubs.stubCancelQuestion();
|
|
207
|
+
ChatPanelSteps.askQuestion();
|
|
208
|
+
// Then the Cancel button should become visible and the Ask button should be hidden
|
|
209
|
+
ChatPanelSteps.getAskButtonElement().should('not.exist');
|
|
210
|
+
ChatPanelSteps.getCancelButton().should('be.visible');
|
|
211
|
+
// When I cancel the question
|
|
212
|
+
ChatPanelSteps.cancelQuestion();
|
|
213
|
+
// Then the Cancel button should be replaced with the Ask button
|
|
214
|
+
ChatPanelSteps.getCancelButton().should('not.exist');
|
|
215
|
+
ChatPanelSteps.getAskButtonElement().should('be.visible');
|
|
216
|
+
// Then the default Agent response should be visible
|
|
217
|
+
ChatPanelSteps.getAssistantAnswer(2).invoke('text').then((text) => {
|
|
218
|
+
expect(text.trim()).to.equal('Request cancelled by the user.');
|
|
219
|
+
});
|
|
220
|
+
ChatPanelSteps.getAssistantIcon(2).should('not.exist');
|
|
221
|
+
});
|
|
222
|
+
|
|
193
223
|
// Can't test this on CI
|
|
194
224
|
it.skip('Should copy an answer when click on copy button', () => {
|
|
195
225
|
// When I click on copy button
|
|
@@ -2,11 +2,11 @@ import {TTYGViewSteps} from "../../steps/ttyg/ttyg-view-steps";
|
|
|
2
2
|
import {TTYGStubs} from "../../stubs/ttyg/ttyg-stubs";
|
|
3
3
|
import {RepositoriesStubs} from "../../stubs/repositories/repositories-stubs";
|
|
4
4
|
import {TtygAgentSettingsModalSteps} from "../../steps/ttyg/ttyg-agent-settings-modal.steps";
|
|
5
|
-
import {SimilarityIndexStubs} from "../../stubs/similarity-index-stubs";
|
|
6
5
|
import {ConnectorStubs} from "../../stubs/connector-stubs";
|
|
7
6
|
import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
|
|
8
7
|
import {RepositoriesStub} from "../../stubs/repositories-stub";
|
|
9
8
|
import {AlertDialogSteps} from "../../steps/alert-dialog-steps";
|
|
9
|
+
import {ApplicationSteps} from '../../steps/application-steps.js';
|
|
10
10
|
|
|
11
11
|
describe('TTYG create new agent', () => {
|
|
12
12
|
const repositoryId = 'starwars';
|
|
@@ -68,10 +68,12 @@ describe('TTYG create new agent', () => {
|
|
|
68
68
|
// enable SPARQL extraction method and disable it again to check the error message for the extraction methods
|
|
69
69
|
TtygAgentSettingsModalSteps.enableSparqlExtractionMethod();
|
|
70
70
|
// The component here is the bootstrap collapse component, so we need to wait for the animation to finish, otherwise the test might fail randomly
|
|
71
|
+
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
71
72
|
cy.wait(1000);
|
|
72
73
|
TtygAgentSettingsModalSteps.getSparqlExtractionMethodPanel().should('be.visible');
|
|
73
74
|
TtygAgentSettingsModalSteps.disableSparqlExtractionMethod();
|
|
74
75
|
// The component here is the bootstrap collapse component, so we need to wait for the animation to finish, otherwise the test might fail randomly
|
|
76
|
+
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
75
77
|
cy.wait(1000);
|
|
76
78
|
TtygAgentSettingsModalSteps.getSparqlExtractionMethodPanel().should('not.exist');
|
|
77
79
|
TtygAgentSettingsModalSteps.getSaveAgentButton().should('be.disabled');
|
|
@@ -143,6 +145,7 @@ describe('TTYG create new agent', () => {
|
|
|
143
145
|
TtygAgentSettingsModalSteps.saveAgent();
|
|
144
146
|
TtygAgentSettingsModalSteps.getCreatingAgentLoader().should('be.visible');
|
|
145
147
|
cy.wait('@create-agent').then((interception) => {
|
|
148
|
+
// eslint-disable-next-line no-undef
|
|
146
149
|
assert.deepEqual(interception.request.body, {
|
|
147
150
|
"id": "id",
|
|
148
151
|
"name": "Test Agent",
|
|
@@ -251,7 +254,7 @@ describe('TTYG create new agent', () => {
|
|
|
251
254
|
}, () => {
|
|
252
255
|
TTYGStubs.stubChatsListGetNoResults();
|
|
253
256
|
TTYGStubs.stubAgentListGet('/ttyg/agent/get-agent-list-0.json');
|
|
254
|
-
|
|
257
|
+
TTYGStubs.getSimilarityIndexesForRepo();
|
|
255
258
|
// Given I have opened the ttyg page
|
|
256
259
|
TTYGViewSteps.visit();
|
|
257
260
|
cy.wait('@get-all-repositories');
|
|
@@ -274,7 +277,7 @@ describe('TTYG create new agent', () => {
|
|
|
274
277
|
}, () => {
|
|
275
278
|
TTYGStubs.stubChatsListGetNoResults();
|
|
276
279
|
TTYGStubs.stubAgentListGet('/ttyg/agent/get-agent-list-0.json');
|
|
277
|
-
|
|
280
|
+
TTYGStubs.getSimilarityIndexesForRepo(repositoryId);
|
|
278
281
|
// Given I have opened the ttyg page
|
|
279
282
|
TTYGViewSteps.visit();
|
|
280
283
|
cy.wait('@get-all-repositories');
|
|
@@ -286,8 +289,10 @@ describe('TTYG create new agent', () => {
|
|
|
286
289
|
TtygAgentSettingsModalSteps.selectRepository(repositoryId);
|
|
287
290
|
// And I enable the similarity search extraction method
|
|
288
291
|
TtygAgentSettingsModalSteps.enableSimilaritySearchMethodPanel();
|
|
289
|
-
// Then I expect similarity index to be selected
|
|
290
|
-
TtygAgentSettingsModalSteps.
|
|
292
|
+
// Then I expect the first similarity search index instance to be selected
|
|
293
|
+
TtygAgentSettingsModalSteps.getSimilarityIndexSelectedOption().should('have.text', 'otkg-vector-new');
|
|
294
|
+
// And I expect that no vector fields from that instance should be selected
|
|
295
|
+
TtygAgentSettingsModalSteps.getSimilarityIndexSelectedVectorFieldsValue().should('contain', 'Select field');
|
|
291
296
|
// Then agent save button should be enabled
|
|
292
297
|
TtygAgentSettingsModalSteps.getSaveAgentButton().should('be.enabled');
|
|
293
298
|
// When I set the similarity index threshold
|
|
@@ -297,6 +302,7 @@ describe('TTYG create new agent', () => {
|
|
|
297
302
|
TtygAgentSettingsModalSteps.getSimilarityIndexMaxTriplesField().should('have.value', '');
|
|
298
303
|
TtygAgentSettingsModalSteps.setSimilarityIndexMaxTriples('100');
|
|
299
304
|
// When I save the agent
|
|
305
|
+
// !!! This stub is not for agent with similarity search method, but it's ok for this test !!!
|
|
300
306
|
TTYGStubs.stubAgentCreate();
|
|
301
307
|
TTYGStubs.stubAgentListGet('/ttyg/agent/get-agent-list-new-agent.json');
|
|
302
308
|
TtygAgentSettingsModalSteps.saveAgent();
|
|
@@ -432,7 +438,7 @@ describe('TTYG create new agent', () => {
|
|
|
432
438
|
TTYGStubs.stubChatsListGetNoResults();
|
|
433
439
|
TTYGStubs.stubAgentListGet('/ttyg/agent/get-agent-list-0.json');
|
|
434
440
|
ConnectorStubs.stubGetConnectors();
|
|
435
|
-
|
|
441
|
+
TTYGStubs.getSimilarityIndexesForRepo(repositoryId );
|
|
436
442
|
// Given I have opened the ttyg page
|
|
437
443
|
TTYGViewSteps.visit();
|
|
438
444
|
cy.wait('@get-all-repositories');
|
|
@@ -444,16 +450,21 @@ describe('TTYG create new agent', () => {
|
|
|
444
450
|
|
|
445
451
|
// When I open Similarity index name panel
|
|
446
452
|
TtygAgentSettingsModalSteps.enableSimilaritySearchMethodPanel();
|
|
453
|
+
cy.wait('@get-similarity-indexes');
|
|
447
454
|
// Then I expect to see the first index selected.
|
|
448
|
-
TtygAgentSettingsModalSteps.verifySimilarityIndexSelected('
|
|
455
|
+
TtygAgentSettingsModalSteps.verifySimilarityIndexSelected('otkg-vector-new');
|
|
449
456
|
|
|
450
457
|
// When I select another repository that have similarity connectors
|
|
458
|
+
TTYGStubs.getSimilarityIndexesForRepo('biomarkers', '/ttyg/agent/get-similarity-indexes-for-another-repo.json');
|
|
451
459
|
TtygAgentSettingsModalSteps.selectRepository('biomarkers');
|
|
460
|
+
cy.wait('@get-similarity-indexes');
|
|
452
461
|
// Then I expect to see the first similarity index from new repository selected.
|
|
453
|
-
TtygAgentSettingsModalSteps.verifySimilarityIndexSelected('
|
|
462
|
+
TtygAgentSettingsModalSteps.verifySimilarityIndexSelected('biomarkers-vector');
|
|
454
463
|
|
|
455
464
|
// When I select a repository that not have similarity indexes
|
|
456
465
|
TtygAgentSettingsModalSteps.selectRepository('ttyg-repo-1725518186812');
|
|
466
|
+
// Then I expect an error message to be open for similarity search index missing
|
|
467
|
+
ApplicationSteps.getErrorNotifications().should('be.visible');
|
|
457
468
|
// Then I expect help message to be open
|
|
458
469
|
TtygAgentSettingsModalSteps.getSimilaritySearchIndexMissingHelp().should('be.visible');
|
|
459
470
|
|
|
@@ -522,7 +533,7 @@ describe('TTYG create new agent', () => {
|
|
|
522
533
|
// When I open agent settings dialog and make all steps so the create button became enabled.
|
|
523
534
|
TTYGStubs.stubChatsListGetNoResults();
|
|
524
535
|
TTYGStubs.stubAgentListGet('/ttyg/agent/get-agent-list-0.json');
|
|
525
|
-
|
|
536
|
+
TTYGStubs.getSimilarityIndexesForRepo();
|
|
526
537
|
TTYGViewSteps.visit();
|
|
527
538
|
cy.wait('@get-all-repositories');
|
|
528
539
|
TTYGViewSteps.createFirstAgent();
|
|
@@ -47,9 +47,10 @@ describe('TTYG create chat', () => {
|
|
|
47
47
|
ChatPanelSteps.getAskButtonElement().should('be.enabled');
|
|
48
48
|
|
|
49
49
|
// When I click on "Ask" button.
|
|
50
|
-
TTYGStubs.
|
|
50
|
+
TTYGStubs.stubCreateNewChat();
|
|
51
51
|
ChatPanelSteps.getAskButtonElement().scrollIntoView().click();
|
|
52
52
|
cy.wait('@create-chat');
|
|
53
|
+
cy.wait('@ask-first-chat-question');
|
|
53
54
|
|
|
54
55
|
// Then I expect new chat to be created in a new group "Today" and be selected
|
|
55
56
|
TTYGViewSteps.getChatGroup(0).should('contain', 'Today');
|
|
@@ -10,7 +10,7 @@ function verifyStateWithSelectedRepository() {
|
|
|
10
10
|
TTYGViewSteps.getApiKeyMessage().should('be.visible');
|
|
11
11
|
TTYGViewSteps.getMissingApiKeyToastMessage()
|
|
12
12
|
.should('be.visible')
|
|
13
|
-
.and('contain', 'Set the config property \'graphdb.llm.api-key\' to your LLM API key
|
|
13
|
+
.and('contain', 'Set the config property \'graphdb.llm.api-key\' to your LLM API key');
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
// TODO: skipped until BE releases an updated version with the new API key.
|
|
@@ -25,9 +25,10 @@
|
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"method": "similarity_search",
|
|
28
|
-
"similarityIndex":
|
|
28
|
+
"similarityIndex": null,
|
|
29
29
|
"similarityIndexThreshold": 0.6,
|
|
30
|
-
"maxNumberOfTriplesPerCall": 0
|
|
30
|
+
"maxNumberOfTriplesPerCall": 0,
|
|
31
|
+
"connectorType": "similarity"
|
|
31
32
|
},
|
|
32
33
|
{
|
|
33
34
|
"method": "retrieval_search",
|
|
@@ -39,6 +40,10 @@
|
|
|
39
40
|
"additionalExtractionMethods": [
|
|
40
41
|
{
|
|
41
42
|
"method": "iri_discovery_search"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"method": "autocomplete_iri_discovery_search",
|
|
46
|
+
"limit": 0
|
|
42
47
|
}
|
|
43
48
|
]
|
|
44
49
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"runStatus":"cancelled","message":"Request cancelled by the user."}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id":
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"timestamp": "creationDate",
|
|
13
|
-
"name": null
|
|
14
|
-
}
|
|
15
|
-
]
|
|
2
|
+
"id": null,
|
|
3
|
+
"conversationId": "thread_new_created_chat",
|
|
4
|
+
"agentId": null,
|
|
5
|
+
"role": null,
|
|
6
|
+
"message": null,
|
|
7
|
+
"timestamp": 0,
|
|
8
|
+
"name": "New chat",
|
|
9
|
+
"usage": null,
|
|
10
|
+
"isTerminalState": false,
|
|
11
|
+
"terminalStatusCode": null
|
|
16
12
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "thread_tpv1izmd9bIjxkhUiCd5x2Xz",
|
|
3
|
+
"name": "Hello! How can I assist you today?",
|
|
4
|
+
"messages": [
|
|
5
|
+
{
|
|
6
|
+
"id": "msg_drDW9OTkPkY0oGoXSdPD5qEx",
|
|
7
|
+
"conversationId": "thread_tpv1izmd9bIjxkhUiCd5x2Xz",
|
|
8
|
+
"agentId": "asst_0llP8yAJlFY2yCWrz8Ovfzjs",
|
|
9
|
+
"role": "assistant",
|
|
10
|
+
"message": "Hello! How can I assist you today?",
|
|
11
|
+
"timestamp": "creationDate",
|
|
12
|
+
"name": null,
|
|
13
|
+
"usage": {
|
|
14
|
+
"completionTokens": 11,
|
|
15
|
+
"promptTokens": 374,
|
|
16
|
+
"totalTokens": 385
|
|
17
|
+
},
|
|
18
|
+
"isTerminalState": false,
|
|
19
|
+
"terminalStatusCode": null
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"timestamp": "creationDate",
|
|
23
|
+
"continueRunId": null,
|
|
24
|
+
"usage": {
|
|
25
|
+
"completionTokens": 11,
|
|
26
|
+
"promptTokens": 374,
|
|
27
|
+
"totalTokens": 385
|
|
28
|
+
}
|
|
29
|
+
}
|