graphdb-workbench-tests 3.2.0-TR5 → 3.2.0-TR6

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.
@@ -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('be.hidden');
26
+ ImportUserDataSteps.getResourcesTable().should('not.exist');
27
27
  };
28
28
  });
@@ -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
- SimilarityIndexStubs.stubGetSimilarityIndexes('/similarity/get-similarity-indexes-0.json');
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
- SimilarityIndexStubs.stubGetSimilarityIndexes();
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.getSimilarityIndexField().should('have.value', '0');
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 all vector fields from that instance should be selected
295
+ TtygAgentSettingsModalSteps.getSimilarityIndexSelectedVectorFieldsFieldsCount().should('contain', '1 selected');
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
- SimilarityIndexStubs.stubTTYGSimilarityIndexes();
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('similarity_index_starwars_one');
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('similarity_index_biomarkers_one');
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
- SimilarityIndexStubs.stubGetSimilarityIndexes('/similarity/get-similarity-indexes-0.json');
536
+ TTYGStubs.getSimilarityIndexesForRepo();
526
537
  TTYGViewSteps.visit();
527
538
  cy.wait('@get-all-repositories');
528
539
  TTYGViewSteps.createFirstAgent();
@@ -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": "similarity-index",
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,6 @@
1
+ {
2
+ "opensearch:biomarkers-vector": [
3
+ "docText1",
4
+ "docText2"
5
+ ]
6
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "opensearch:otkg-vector-new": [
3
+ "docText1"
4
+ ],
5
+ "similarity": [
6
+ "test",
7
+ "test-copy"
8
+ ],
9
+ "elasticsearch:otkg-vector": [
10
+ "docText1",
11
+ "docText2"
12
+ ]
13
+ }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "3.2.0-TR5",
3
+ "version": "3.2.0-TR6",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "graphdb-workbench-tests",
9
- "version": "3.2.0-TR5",
9
+ "version": "3.2.0-TR6",
10
10
  "license": "Apache-2.0",
11
11
  "devDependencies": {
12
12
  "@bahmutov/cypress-code-coverage": "^2.7.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "3.2.0-TR5",
3
+ "version": "3.2.0-TR6",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -7,7 +7,7 @@ export class UserAndAccessSteps {
7
7
 
8
8
  static visitInProdMode() {
9
9
  cy.visit('/users', {
10
- onBeforeLoad: (win) => {
10
+ onBeforeLoad: () => {
11
11
  EnvironmentStubs.stubWbProdMode();
12
12
  }
13
13
  });
@@ -186,7 +186,7 @@ export class UserAndAccessSteps {
186
186
  }
187
187
 
188
188
  static getPermissionError() {
189
- return cy.get('.permission-banner');
189
+ return cy.getByTestId('restricted-access-banner');
190
190
  }
191
191
 
192
192
  static getModal() {
@@ -227,7 +227,7 @@ export class TtygAgentSettingsModalSteps extends ModalDialogSteps {
227
227
  }
228
228
 
229
229
  static clickOnSimilaritySearchIndexMissingHelp() {
230
- this.getSimilaritySearchIndexMissingHelp().find('a').click();
230
+ this.getSimilaritySearchIndexMissingHelp().find('a').eq(0).click();
231
231
  }
232
232
 
233
233
  static getSimilarityIndexFormGroup() {
@@ -235,7 +235,11 @@ export class TtygAgentSettingsModalSteps extends ModalDialogSteps {
235
235
  }
236
236
 
237
237
  static getSimilarityIndexField() {
238
- return this.getSimilarityIndexFormGroup().find('select');
238
+ return this.getSimilarityIndexFormGroup().find('#connectorInstances');
239
+ }
240
+
241
+ static getSimilarityIndexSelectedOption() {
242
+ return this.getSimilarityIndexField().find('option:selected');
239
243
  }
240
244
 
241
245
  static selectSimilarityIndex(index) {
@@ -246,6 +250,14 @@ export class TtygAgentSettingsModalSteps extends ModalDialogSteps {
246
250
  this.getSimilarityIndexField().find('option:selected').should('have.text', similarityIndex);
247
251
  }
248
252
 
253
+ static getSimilarityIndexVectorFieldsField() {
254
+ return this.getSimilarityIndexFormGroup().find('#vectorFieldsSelect .multiselect-button');
255
+ }
256
+
257
+ static getSimilarityIndexSelectedVectorFieldsFieldsCount() {
258
+ return this.getSimilarityIndexVectorFieldsField().find('.multiselect-count');
259
+ }
260
+
249
261
  static getSimilarityIndexThresholdFormGroup() {
250
262
  return this.getExtractionMethodPanel('similarity_search').find('.similarity-index-threshold');
251
263
  }
@@ -86,8 +86,16 @@ export class TTYGStubs extends Stubs {
86
86
  }).as('get-agent-list');
87
87
  }
88
88
 
89
+ static getSimilarityIndexesForRepo(repositoryId, fixture = '/ttyg/agent/get-similarity-indexes.json', delay = 0) {
90
+ cy.intercept('GET', `rest/similarity/${repositoryId}/indexes`, {
91
+ fixture: fixture,
92
+ statusCode: 200,
93
+ delay: delay
94
+ }).as('get-similarity-indexes');
95
+ }
96
+
89
97
  static stubAgentListWithIncompatibleGet(delay = 0) {
90
- this.stubAgentListGet('/ttyg/agent/get-agent-list-with-incompatible-agents.json');
98
+ this.stubAgentListGet('/ttyg/agent/get-agent-list-with-incompatible-agents.json', delay);
91
99
  }
92
100
 
93
101
  static stubAgentGet(fixture = '/ttyg/agent/get-agent.json', delay = 0) {