graphdb-workbench-tests 3.1.0-WBM-8 → 3.1.0-plugins1

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.
Files changed (124) hide show
  1. package/.nycrc +10 -0
  2. package/cypress-legacy.config.js +9 -1
  3. package/cypress-security.config.js +40 -0
  4. package/cypress.config.js +3 -1
  5. package/e2e-flaky/import/import-user-data-url.spec.js +63 -0
  6. package/e2e-legacy/cluster/edit-cluster-nodes-modal.spec.js +44 -0
  7. package/e2e-legacy/explore/class-hierarchy/class.hierarchy.spec.js +1 -2
  8. package/e2e-legacy/explore/graphs-overview/graphs.overview.spec.js +2 -3
  9. package/e2e-legacy/explore/visual-graph/graphs-config.spec.js +5 -18
  10. package/e2e-legacy/explore/visual-graph/visual.graph.spec.js +1 -2
  11. package/e2e-legacy/graphql/activate-deactivate-graphql-endpoint.spec.js +1 -1
  12. package/e2e-legacy/graphql/create-graphql-endpoint.spec.js +1 -3
  13. package/e2e-legacy/graphql/delete-graphql-endpoint.spec.js +1 -1
  14. package/e2e-legacy/graphql/edit-graphql-enpoint.spec.js +1 -1
  15. package/e2e-legacy/graphql/export-graphql-endpoint-definition.spec.js +1 -1
  16. package/e2e-legacy/graphql/filter-graphql-endpoints-on-management-view.spec.js +2 -2
  17. package/e2e-legacy/graphql/graphql-endpoint-management-view.spec.js +5 -5
  18. package/e2e-legacy/graphql/graphql-playground.spec.js +1 -1
  19. package/e2e-legacy/graphql/import-graphql-endpoint-definitions.spec.js +1 -7
  20. package/e2e-legacy/graphql/set-default-graphql-endpoint.spec.js +1 -1
  21. package/e2e-legacy/help/guides/guides-with-repository.spec.js +32 -0
  22. package/e2e-legacy/help/guides/guides-without-repository.spec.js +20 -0
  23. package/e2e-legacy/{guides → help/guides}/movies-interactive-guide.spec.js +2 -2
  24. package/e2e-legacy/{guides → help/guides}/star-wars-interactive-guide.js +2 -2
  25. package/e2e-legacy/help/rest-api-documentatio/rest-api-documentation-with-repository.spec.js +32 -0
  26. package/e2e-legacy/help/rest-api-documentatio/rest-api-documentation-without-repository.spec.js +20 -0
  27. package/e2e-legacy/help/system-information/system-information-with-repository.spec.js +32 -0
  28. package/e2e-legacy/help/system-information/system-information-without-repository.spec.js +20 -0
  29. package/e2e-legacy/home/cookie-policy.spec.js +78 -59
  30. package/e2e-legacy/home/create-repository.spec.js +2 -6
  31. package/e2e-legacy/home/documentation-link.spec.js +31 -33
  32. package/e2e-legacy/home/google-analytics.spec.js +4 -6
  33. package/e2e-legacy/home/rdf-resource-search.spec.js +106 -138
  34. package/e2e-legacy/home/view-resource-autocomplete.spec.js +30 -21
  35. package/e2e-legacy/import/import-server-files-batch-operations.spec.js +1 -2
  36. package/e2e-legacy/import/import-server-files.spec.js +1 -2
  37. package/e2e-legacy/import/import-user-data-url.spec.js +1 -25
  38. package/e2e-legacy/import/import-user-data.spec.js +4 -2
  39. package/e2e-legacy/import/import-view.spec.js +1 -2
  40. package/e2e-legacy/monitor/global-operation-statuses-component.spec.js +13 -9
  41. package/e2e-legacy/repository/attach-remote-location.spec.js +2 -5
  42. package/e2e-legacy/repository/ontop-repository.spec.js +3 -12
  43. package/e2e-legacy/repository/repositories.spec.js +35 -46
  44. package/e2e-legacy/setup/aclmanagement/create-rule.spec.js +1 -2
  45. package/e2e-legacy/setup/aclmanagement/edit-rule.spec.js +1 -2
  46. package/e2e-legacy/setup/aclmanagement/reorder-rules.spec.js +1 -2
  47. package/e2e-legacy/setup/aclmanagement/scopes.spec.js +1 -2
  48. package/e2e-legacy/setup/autocomplete/autocomplete-with-repository.spec.js +40 -0
  49. package/e2e-legacy/setup/autocomplete/autocomplete-without-repository.spec.js +27 -0
  50. package/e2e-legacy/setup/{autocomplete.spec.js → autocomplete/autocomplete.spec.js} +5 -6
  51. package/e2e-legacy/setup/cluster/cluster-initial-state-with-cluster.spec.js +34 -0
  52. package/e2e-legacy/setup/cluster/cluster-initial-state-without-cluster.spec.js +25 -0
  53. package/e2e-legacy/setup/connectors-lucene.spec.js +1 -2
  54. package/e2e-legacy/setup/jdbc/jdbc-create.spec.js +2 -2
  55. package/e2e-legacy/setup/namespaces/namespaces-with-repository.spec.js +44 -0
  56. package/e2e-legacy/setup/namespaces/namespaces-without-repository.spec.js +27 -0
  57. package/e2e-legacy/setup/{namespaces.spec.js → namespaces/namespaces.spec.js} +4 -4
  58. package/e2e-legacy/setup/plugins/plugins-with-repository.spec.js +38 -0
  59. package/e2e-legacy/setup/plugins/plugins-without-repository.spec.js +28 -0
  60. package/e2e-legacy/setup/{plugins.spec.js → plugins/plugins.spec.js} +3 -3
  61. package/e2e-legacy/setup/sparql-template/sparql-template-create.js +10 -3
  62. package/e2e-legacy/setup/users-and-access/user-and-access.spec.js +38 -9
  63. package/e2e-legacy/sparql-editor/saved-query/edit-query.spec.js +3 -6
  64. package/e2e-legacy/sparql-editor/saved-query/readonly-query.spec.js +7 -13
  65. package/e2e-legacy/sparql-editor/saved-query/share-query.spec.js +2 -4
  66. package/e2e-legacy/sparql-editor/sparql-editor.spec.js +1 -4
  67. package/e2e-legacy/ttyg/agent-list.spec.js +38 -6
  68. package/e2e-legacy/ttyg/chat-list.spec.js +1 -2
  69. package/e2e-legacy/ttyg/clone-agent.spec.js +1 -0
  70. package/e2e-legacy/ttyg/create-agent.spec.js +10 -16
  71. package/e2e-legacy/ttyg/edit-agent.spec.js +69 -9
  72. package/e2e-legacy/ttyg/ttyg-initial-state-with-configured-api-key.spec.js +46 -0
  73. package/e2e-legacy/ttyg/ttyg-initial-state-with-selected-repository.spec.js +45 -0
  74. package/e2e-legacy/ttyg/ttyg-initial-state-without-repositories.spec.js +21 -0
  75. package/e2e-legacy/ttyg/ttyg-permission.spec.js +28 -20
  76. package/e2e-legacy/ttyg/ttyg-view.spec.js +1 -1
  77. package/e2e-security/setup/home/cookie-policy.spec.js +64 -0
  78. package/e2e-security/setup/users-and-access/create-user-permissions.spec.js +184 -0
  79. package/e2e-security/setup/users-and-access/graphql-user.spec.js +123 -0
  80. package/e2e-security/setup/users-and-access/repo-admin-role.spec.js +69 -0
  81. package/e2e-security/setup/users-and-access/turn-on-security-and-password-change.spec.js +87 -0
  82. package/e2e-security/setup/users-and-access/user-and-access.spec.js +87 -0
  83. package/e2e-security/setup/users-and-access/users-and-access-initial-state.spec.js +38 -0
  84. package/fixtures/repositories/free-access.json +13 -0
  85. package/fixtures/repositories/get-remote-and-local-repositories.json +34 -0
  86. package/fixtures/ttyg/agent/get-agent-defaults-assistant-api.json +44 -0
  87. package/fixtures/ttyg/agent/get-agent-defaults.json +2 -0
  88. package/npm-shrinkwrap.json +7633 -1817
  89. package/package.json +13 -7
  90. package/plugins/index.js +3 -2
  91. package/steps/base-steps.js +4 -0
  92. package/steps/cluster/cluster-page-steps.js +12 -2
  93. package/steps/error-steps.js +4 -7
  94. package/steps/graphql/graphql-endpoint-management-steps.js +2 -2
  95. package/steps/guides/guide-steps.js +20 -1
  96. package/steps/home-steps.js +59 -37
  97. package/steps/import/import-steps.js +8 -3
  98. package/steps/login-steps.js +14 -3
  99. package/steps/main-menu-steps.js +76 -6
  100. package/steps/operations-statuses-component-steps.js +5 -10
  101. package/steps/rdf-resource-search-steps.js +55 -0
  102. package/steps/repository-steps.js +17 -17
  103. package/steps/rest-api-documentation-steps.js +15 -0
  104. package/steps/setup/autocomplete-steps.js +17 -3
  105. package/steps/setup/namespace-steps.js +8 -2
  106. package/steps/setup/plugins-steps.js +11 -1
  107. package/steps/setup/settings-steps.js +18 -0
  108. package/steps/setup/user-and-access-steps.js +28 -2
  109. package/steps/system-information-steps.js +70 -0
  110. package/steps/ttyg/ttyg-agent-settings-modal.steps.js +74 -11
  111. package/steps/ttyg/ttyg-view-steps.js +39 -6
  112. package/steps/widgets/active-repository-widget-steps.js +4 -0
  113. package/steps/yasgui/yasr-steps.js +4 -0
  114. package/stubs/browser-stubs.js +21 -0
  115. package/stubs/environment-stubs.js +9 -1
  116. package/stubs/repositories/repositories-stubs.js +4 -0
  117. package/stubs/security-stubs.js +4 -0
  118. package/stubs/ttyg/ttyg-stubs.js +18 -2
  119. package/support/e2e.js +2 -1
  120. package/support/repository-commands.js +14 -1
  121. package/e2e-flaky/setup/users-and-access/security-and-free-access.spec.js +0 -57
  122. package/e2e-flaky/ttyg/ttyg-permission.spec.js +0 -67
  123. package/fixtures/locale-en.json +0 -3361
  124. /package/e2e-legacy/help/{system-information.spec.js → system-information/system-information.spec.js} +0 -0
@@ -1,8 +1,5 @@
1
1
  import {REPOSITORIES_URL} from "../support/repository-commands";
2
2
 
3
- /**
4
- * TODO: Fix me. Broken due to migration (loader is not implemented)
5
- */
6
3
  export class RepositorySteps {
7
4
 
8
5
  static visit() {
@@ -11,7 +8,6 @@ export class RepositorySteps {
11
8
  cy.visit('/repository');
12
9
  RepositorySteps.waitLoader();
13
10
  cy.wait('@getLocations');
14
- // cy.window();
15
11
  RepositorySteps.waitUntilRepositoriesPageIsLoaded();
16
12
  }
17
13
 
@@ -24,12 +20,6 @@ export class RepositorySteps {
24
20
  }
25
21
 
26
22
  static waitUntilRepositoriesPageIsLoaded() {
27
- // Workbench loading screen should not be visible
28
- /**
29
- * TODO: Fix me. Broken due to migration (loader is not implemented)
30
- */
31
- // cy.get('.ot-splash').should('not.be.visible');
32
-
33
23
  RepositorySteps.getRepositoriesDropdown().should('not.be.disabled');
34
24
  RepositorySteps.getCreateRepositoryButton().should('be.visible').and('not.be.disabled');
35
25
  }
@@ -40,6 +30,17 @@ export class RepositorySteps {
40
30
  .should('be.visible');
41
31
  }
42
32
 
33
+ static getRepositorySelection() {
34
+ return cy.getByTestId('repository-selection')
35
+ .scrollIntoView()
36
+ .should('be.visible');
37
+ }
38
+
39
+ static getRepositoriesInDropdown() {
40
+ return cy.get('.onto-dropdown-menu-item');
41
+ }
42
+
43
+
43
44
  static getRepositoriesList() {
44
45
  return cy.get('#wb-repositories-repositoryInGetRepositories');
45
46
  }
@@ -76,7 +77,7 @@ export class RepositorySteps {
76
77
  // Forcefully clicking it due to https://github.com/cypress-io/cypress/issues/695
77
78
  .should('be.visible')
78
79
  .and('not.be.disabled')
79
- .click({force: true});
80
+ .click();
80
81
  }
81
82
 
82
83
  static editRepository(repositoryId) {
@@ -203,13 +204,12 @@ export class RepositorySteps {
203
204
  }
204
205
 
205
206
  static selectRepoFromDropdown(repositoryId) {
206
- RepositorySteps.getRepositoriesDropdown()
207
- .click()
208
- .find('.dropdown-menu-right .dropdown-item')
207
+ RepositorySteps.getRepositoriesDropdown().click();
208
+ RepositorySteps.getRepositoriesInDropdown()
209
+ .should('be.visible')
209
210
  .contains(repositoryId)
210
- .closest('a')
211
- // Force the click because Cypress sometimes determines that the item has 0x0 dimensions
212
- .click({force: true});
211
+ .first()
212
+ .click();
213
213
  }
214
214
 
215
215
  static getSHACLRepositoryCheckbox() {
@@ -0,0 +1,15 @@
1
+ import {BaseSteps} from "./base-steps";
2
+
3
+ export class RestApiDocumentationSteps extends BaseSteps {
4
+ static visit() {
5
+ cy.visit('webapi');
6
+ }
7
+
8
+ static getRestApiContent() {
9
+ return this.getByTestId('rest-api-content');
10
+ }
11
+
12
+ static verifyInitialState() {
13
+ this.getRestApiContent().should('be.visible');
14
+ }
15
+ }
@@ -1,4 +1,6 @@
1
- export class AutocompleteSteps {
1
+ import {BaseSteps} from "../base-steps";
2
+
3
+ export class AutocompleteSteps extends BaseSteps {
2
4
 
3
5
  static visit() {
4
6
  cy.visit('/autocomplete');
@@ -23,7 +25,11 @@ export class AutocompleteSteps {
23
25
  }
24
26
 
25
27
  static getAutocompletePage() {
26
- return cy.get('#autocomplete');
28
+ return this.getByTestId('autocomplete-page');
29
+ }
30
+
31
+ static getAutocompletePageContent() {
32
+ return this.getAutocompletePage().getByTestId('autocomplete-content');
27
33
  }
28
34
 
29
35
  static getAutocompleteIndex() {
@@ -31,7 +37,11 @@ export class AutocompleteSteps {
31
37
  }
32
38
 
33
39
  static getAutocompleteHeader() {
34
- return this.getAutocompleteIndex().find('.autocomplete-header');
40
+ return this.getAutocompletePageContent().getByTestId('autocomplete-header');
41
+ }
42
+
43
+ static getAutocompleteLabelsContainer() {
44
+ return this.getAutocompletePage().getByTestId('autocomplete-labels-container');
35
45
  }
36
46
 
37
47
  static getAutocompleteSwitch() {
@@ -73,6 +83,10 @@ export class AutocompleteSteps {
73
83
  return this.getAutocompletePage().find('#wb-autocomplete-labels');
74
84
  }
75
85
 
86
+ static getLabelRows() {
87
+ return this.getAutocompleteLabels().find('.wb-autocomplete-labels-row')
88
+ }
89
+
76
90
  static getTableRows() {
77
91
  return cy.get('.wb-autocomplete-labels-row');
78
92
  }
@@ -1,10 +1,16 @@
1
- export class NamespaceSteps {
1
+ import {BaseSteps} from "../base-steps";
2
+
3
+ export class NamespaceSteps extends BaseSteps {
2
4
  static visit() {
3
5
  cy.visit('/namespaces');
4
6
  }
5
7
 
6
8
  static getNamespacesView() {
7
- return cy.get('#wb-namespaces');
9
+ return this.getByTestId('namespaces-page')
10
+ }
11
+
12
+ static getNamespacesContent() {
13
+ return this.getNamespacesView().getByTestId('namespaces-content');
8
14
  }
9
15
 
10
16
  // ------ Generic ------
@@ -1,4 +1,6 @@
1
- export class PluginsSteps {
1
+ import {BaseSteps} from "../base-steps";
2
+
3
+ export class PluginsSteps extends BaseSteps {
2
4
  static visit() {
3
5
  cy.visit('/plugins');
4
6
  }
@@ -7,6 +9,14 @@ export class PluginsSteps {
7
9
  return cy.get('#plugins');
8
10
  }
9
11
 
12
+ static getSearchPluginBar() {
13
+ return this.getPluginsView().getByTestId('search-plugins-bar');
14
+ }
15
+
16
+ static getPluginsList() {
17
+ return this.getPluginsView().getByTestId('plugins-list');
18
+ }
19
+
10
20
  static waitUntilPluginsPageIsLoaded() {
11
21
  // No active loader
12
22
  cy.get('.ot-loader').should('not.exist');
@@ -1,8 +1,26 @@
1
+ import {EnvironmentStubs} from "../../stubs/environment-stubs";
2
+
1
3
  export class SettingsSteps {
2
4
  static visit() {
3
5
  cy.visit('/settings');
4
6
  }
5
7
 
8
+ static visitInProdMode() {
9
+ cy.visit('/settings', {
10
+ onBeforeLoad: (win) => {
11
+ EnvironmentStubs.stubWbProdMode();
12
+ }
13
+ });
14
+ }
15
+
16
+ static visitInDevMode() {
17
+ cy.visit('/settings', {
18
+ onBeforeLoad: (win) => {
19
+ EnvironmentStubs.stubWbDevMode();
20
+ }
21
+ });
22
+ }
23
+
6
24
  static getSettingsPage() {
7
25
  return cy.get('#wb-user');
8
26
  }
@@ -1,12 +1,26 @@
1
+ import {EnvironmentStubs} from "../../stubs/environment-stubs";
2
+
1
3
  export class UserAndAccessSteps {
2
4
  static visit() {
3
5
  cy.visit('/users');
4
6
  }
5
7
 
8
+ static visitInProdMode() {
9
+ cy.visit('/users', {
10
+ onBeforeLoad: (win) => {
11
+ EnvironmentStubs.stubWbProdMode();
12
+ }
13
+ });
14
+ }
15
+
6
16
  static getUrl() {
7
17
  return cy.url();
8
18
  }
9
19
 
20
+ static isUsersUrlLoaded() {
21
+ return this.getUrl().should('include', '/users');
22
+ }
23
+
10
24
  static getSplashLoader() {
11
25
  return cy.get('.ot-loader');
12
26
  }
@@ -151,8 +165,20 @@ export class UserAndAccessSteps {
151
165
  cy.get('.write').click();
152
166
  }
153
167
 
154
- static getFieldError() {
155
- return cy.get('div.small');
168
+ static getCustomRoleFieldError() {
169
+ return cy.get('#user-custom-roles').find('small');
170
+ }
171
+
172
+ /**
173
+ * Returns the feedback <div> for the given login field error.
174
+ * @param field One of "username", "password", "confirmPassword"
175
+ */
176
+ static getUserFieldError(field) {
177
+ return cy.get(`.login-credentials [ng-show="${field}Error"].form-control-feedback`);
178
+ }
179
+
180
+ static getRepositoryRightsError() {
181
+ return cy.get('#user-repos [ng-show="repositoryCheckError"].form-control-feedback');
156
182
  }
157
183
 
158
184
  static getError() {
@@ -0,0 +1,70 @@
1
+ import {BaseSteps} from "./base-steps";
2
+
3
+ export class SystemInformationSteps extends BaseSteps {
4
+
5
+ static visit() {
6
+ cy.visit('sysinfo');
7
+ }
8
+
9
+ static getSystemInformationView() {
10
+ return this.getByTestId('system-info-page');
11
+ }
12
+
13
+ static getSystemInformationContent() {
14
+ return this.getSystemInformationView().getByTestId('system-info-content');
15
+ }
16
+
17
+ /////////////////////////////
18
+ // Application Info Tab
19
+ /////////////////////////////
20
+ static getApplicationInfoTab() {
21
+ return this.getSystemInformationContent().getByTestId('application-info-tab');
22
+ }
23
+
24
+ static getGraphDBInfo() {
25
+ return this.getApplicationInfoTab().getByTestId('graphdb-info');
26
+ }
27
+
28
+ static getOperatingSystemInfo() {
29
+ return this.getApplicationInfoTab().getByTestId('operation-system-info');
30
+ }
31
+
32
+ static getServerReport() {
33
+ return this.getApplicationInfoTab().getByTestId('server-report');
34
+ }
35
+
36
+ static getNewReportButton() {
37
+ return this.getServerReport().getByTestId('new-report-btn');
38
+ }
39
+
40
+ static getServerReportDownloadButton() {
41
+ return this.getServerReport().getByTestId('download-report-btn');
42
+ }
43
+
44
+ /////////////////////////////
45
+ // JVM Arguments Tab
46
+ /////////////////////////////
47
+ static getJVMArgumentsTab() {
48
+ return this.getSystemInformationContent().getByTestId('jvm-arguments-tab');
49
+ }
50
+
51
+ ////////////////////////////////
52
+ // Configuration Parameters Tab
53
+ ////////////////////////////////
54
+ static getConfigurationParametersTab() {
55
+ return this.getSystemInformationContent().getByTestId('configuration-parameters-tab');
56
+ }
57
+
58
+ static verifyInitialState() {
59
+ this.getSystemInformationView().should('exist');
60
+ this.getSystemInformationContent().should('be.visible');
61
+ this.getApplicationInfoTab().should('exist');
62
+ this.getGraphDBInfo().should('exist');
63
+ this.getJVMArgumentsTab().should('exist');
64
+ this.getConfigurationParametersTab().should('exist');
65
+ this.getOperatingSystemInfo().should('exist');
66
+ this.getServerReport().should('exist');
67
+ this.getServerReportDownloadButton().should('exist');
68
+ this.getNewReportButton().should('exist');
69
+ }
70
+ }
@@ -37,6 +37,30 @@ export class TtygAgentSettingsModalSteps extends ModalDialogSteps {
37
37
  return this.getAgentNameFormGroup().find('.alert-danger');
38
38
  }
39
39
 
40
+ static getExtIntegrationConfigBtn() {
41
+ return cy.get('.external-config-btn');
42
+ }
43
+
44
+ static openExtIntegrationConfig() {
45
+ this.getExtIntegrationConfigBtn().click();
46
+ }
47
+
48
+ static getExternalIntegrationModal() {
49
+ return cy.get('.external-integration-configuration-modal .modal-content');
50
+ }
51
+
52
+ static getAgentUrlField() {
53
+ return this.getExternalIntegrationModal().find('#agentId');
54
+ }
55
+
56
+ static getMethodUrlField() {
57
+ return this.getExternalIntegrationModal().find('#queryMethods');
58
+ }
59
+
60
+ static getDifyUrlField() {
61
+ return this.getExternalIntegrationModal().find('#difyExtension');
62
+ }
63
+
40
64
  // Repository ID
41
65
 
42
66
  static getRepositoryIdFromGroup() {
@@ -321,27 +345,62 @@ export class TtygAgentSettingsModalSteps extends ModalDialogSteps {
321
345
  this.getRetrievalConnectorField().find('option:selected').should('have.text', connectorName);
322
346
  }
323
347
 
324
- // GPT model
348
+ // LLM model
325
349
 
326
- static getGptModelFormGroup() {
327
- return this.getDialog().find('.gpt-model');
350
+ static getLLMModelFormGroup() {
351
+ return this.getDialog().find('.llm-model');
328
352
  }
329
353
 
330
- static getGptModelField() {
331
- return this.getGptModelFormGroup().find('input');
354
+ static getLLMModelField() {
355
+ return this.getLLMModelFormGroup().find('input');
332
356
  }
333
357
 
334
- static clearGptModel() {
335
- this.getGptModelField().clear();
358
+ static clearLLMModel() {
359
+ this.getLLMModelField().clear();
336
360
  cy.realPress('Tab');
337
361
  }
338
362
 
339
- static getGptModelError() {
340
- return this.getGptModelFormGroup().find('.alert-danger');
363
+ static getLLMModelError() {
364
+ return this.getLLMModelFormGroup().find('.alert-danger');
365
+ }
366
+
367
+ static typeLLMModel(value) {
368
+ return this.getLLMModelField().type(value);
369
+ }
370
+
371
+ static clickLLMModelField() {
372
+ this.getLLMModelField().click();
373
+ }
374
+
375
+ // Context size
376
+
377
+ static getContextSizeFormGroup() {
378
+ return this.getDialog().find('.context-size');
379
+ }
380
+
381
+ static getContextSizeField() {
382
+ return this.getDialog().find('.context-size input');
383
+ }
384
+
385
+ static clearContextSize() {
386
+ return this.getContextSizeField().clear();
341
387
  }
342
388
 
343
- static typeGptModel(value) {
344
- return this.getGptModelField().type(value);
389
+ static enterContextSize(input) {
390
+ this.getContextSizeField().type(input);
391
+ }
392
+
393
+ static getContextSizeError() {
394
+ return this.getContextSizeFormGroup().find('.alert-danger');
395
+ }
396
+
397
+ static resetContextSizeValue() {
398
+ this.getContextSizeField()
399
+ .realHover()
400
+ .then(() => this.getContextSizeFormGroup().find('.reset-context-size-btn'))
401
+ .scrollIntoView()
402
+ .should('be.visible')
403
+ .click();
345
404
  }
346
405
 
347
406
  // temperature
@@ -366,6 +425,10 @@ export class TtygAgentSettingsModalSteps extends ModalDialogSteps {
366
425
  return this.getTemperatureFormGroup().find('.high-temperature-warning');
367
426
  }
368
427
 
428
+ static scrollToTemperatureWarning() {
429
+ return this.getTemperatureWarning().scrollIntoView();
430
+ }
431
+
369
432
  // Top P
370
433
 
371
434
  static getTopPFormGroup() {
@@ -1,4 +1,6 @@
1
- export class TTYGViewSteps {
1
+ import {BaseSteps} from "../base-steps";
2
+
3
+ export class TTYGViewSteps extends BaseSteps {
2
4
  static visit() {
3
5
  cy.visit('/ttyg');
4
6
  }
@@ -12,7 +14,23 @@ export class TTYGViewSteps {
12
14
  }
13
15
 
14
16
  static getNoAgentsView() {
15
- return this.getTtygView().find('.no-agents-view-component');
17
+ return this.getTtygView().getByTestId('no-agents-view-component');
18
+ }
19
+
20
+ static getTtygInfoMessage() {
21
+ return this.getNoAgentsView().getByTestId('ttyg-info-message');
22
+ }
23
+
24
+ static getTtygagentMessage() {
25
+ return this.getNoAgentsView().getByTestId('ttyg-agent-message');
26
+ }
27
+
28
+ static getApiKeyMessage() {
29
+ return this.getNoAgentsView().getByTestId('ttyg-api-key-message');
30
+ }
31
+
32
+ static getMissingApiKeyToastMessage() {
33
+ return cy.get('.toast.toast-error');
16
34
  }
17
35
 
18
36
  static getTtygViewContent() {
@@ -106,6 +124,13 @@ export class TTYGViewSteps {
106
124
  return this.getToggleChatsSidebarButton().click();
107
125
  }
108
126
 
127
+ static openAgentSettingsModalForAgent(index) {
128
+ TTYGViewSteps.expandAgentsSidebar();
129
+ TTYGViewSteps.openAgentsMenu();
130
+ TTYGViewSteps.selectAgent(index);
131
+ TTYGViewSteps.editCurrentAgent();
132
+ }
133
+
109
134
  static getCreateChatButton() {
110
135
  return this.getChatsSidebar().find('.create-chat-btn');
111
136
  }
@@ -217,12 +242,12 @@ export class TTYGViewSteps {
217
242
  return this.getAgent(index).realHover().find('.open-agent-actions-btn');
218
243
  }
219
244
 
220
- static openAgentActionMenu(index) {
245
+ static toggleAgentActionMenu(index) {
221
246
  this.getOpenAgentActionsButton(index).click();
222
247
  }
223
248
 
224
249
  static triggerEditAgentActionMenu(index) {
225
- this.openAgentActionMenu(index);
250
+ this.toggleAgentActionMenu(index);
226
251
  this.getEditAgentButton(index).click();
227
252
  }
228
253
 
@@ -230,8 +255,16 @@ export class TTYGViewSteps {
230
255
  return this.getAgent(index).find('.agent-actions-menu .edit-agent-btn');
231
256
  }
232
257
 
258
+ static getExternalIntegrationConfigButton(index) {
259
+ return this.getAgent(index).find('.agent-actions-menu .ext-integration-agent-btn');
260
+ }
261
+
262
+ static openExternalIntegrationConfigButton(index) {
263
+ return this.getExternalIntegrationConfigButton(index).click();
264
+ }
265
+
233
266
  static triggerCloneAgentActionMenu(index) {
234
- this.openAgentActionMenu(index);
267
+ this.toggleAgentActionMenu(index);
235
268
  this.getCloneAgentButton(index).click();
236
269
  }
237
270
 
@@ -240,7 +273,7 @@ export class TTYGViewSteps {
240
273
  }
241
274
 
242
275
  static triggerDeleteAgentActionMenu(index) {
243
- this.openAgentActionMenu(index);
276
+ this.toggleAgentActionMenu(index);
244
277
  this.getDeleteAgentButton(index).click();
245
278
  }
246
279
 
@@ -22,4 +22,8 @@ export class ActiveRepositoryWidgetSteps {
22
22
  static getInferredStatements() {
23
23
  return this.getWidget().find('.inferred-statements .data-value');
24
24
  }
25
+
26
+ static getImportLink() {
27
+ return this.getWidget().find('a.btn-link[href="import"]');
28
+ }
25
29
  }
@@ -11,6 +11,10 @@ export class YasrSteps {
11
11
  return YasrSteps.getYasr().find('.yasr_response_chip');
12
12
  }
13
13
 
14
+ static getResponseInfoMessage() {
15
+ return YasrSteps.getResponseInfo().find('.response-info-message');
16
+ }
17
+
14
18
  static getErrorHeader() {
15
19
  return YasrSteps.getResultHeader().get('.errorHeader');
16
20
  }
@@ -0,0 +1,21 @@
1
+ export class BrowserStubs {
2
+ static WINDOW_OPEN_ALIAS = (isDefinition = false) => {
3
+ return isDefinition ? 'windowOpen' : '@windowOpen';
4
+ }
5
+
6
+ static NAVIGATE_TO_URL_ALIAS = (isDefinition) => {
7
+ return isDefinition ? 'navigateToUrl' : '@navigateToUrl';
8
+ }
9
+
10
+ static stubWindowOpen() {
11
+ cy.window().then((win) => {
12
+ cy.stub(win, 'open').as(BrowserStubs.WINDOW_OPEN_ALIAS(true))
13
+ })
14
+ }
15
+
16
+ static spyNavigateToUrl() {
17
+ cy.window().then((win) => {
18
+ cy.spy(win.singleSpa, 'navigateToUrl').as(BrowserStubs.NAVIGATE_TO_URL_ALIAS(true))
19
+ })
20
+ }
21
+ }
@@ -1,4 +1,8 @@
1
1
  export class EnvironmentStubs {
2
+ static PRODUCT_INFO_ALIAS = (isDefinition) => {
3
+ return isDefinition ? 'productInfo' : '@productInfo';
4
+ }
5
+
2
6
  static stubWbProdMode() {
3
7
  cy.window().then((win) => {
4
8
  win.wbDevMode = false;
@@ -11,6 +15,10 @@ export class EnvironmentStubs {
11
15
  });
12
16
  }
13
17
 
18
+ static spyProductInfo() {
19
+ cy.intercept('/rest/info/version?local=1').as('productInfo')
20
+ }
21
+
14
22
  static stubProductInfo(productVersion) {
15
23
  cy.intercept('GET', '/rest/info/version?local=1', {
16
24
  statusCode: 200,
@@ -21,7 +29,7 @@ export class EnvironmentStubs {
21
29
  "sesame": "4.3.13",
22
30
  "Workbench": "2.8.0-TR5"
23
31
  }
24
- }).as('productInfo');
32
+ }).as(EnvironmentStubs.PRODUCT_INFO_ALIAS(true));
25
33
 
26
34
  }
27
35
  }
@@ -7,6 +7,10 @@ export class RepositoriesStubs extends Stubs {
7
7
  RepositoriesStubs.stubGetQueryResponse('/rest/repositories/all', fixture, 'get-all-repositories', withDelay);
8
8
  }
9
9
 
10
+ static stubFreeAccess(withDelay = 0, fixture = '/repositories/free-access.json') {
11
+ RepositoriesStubs.stubGetQueryResponse('/rest/security/free-access', fixture, 'free-access', withDelay);
12
+ }
13
+
10
14
  static spyGetRepositories() {
11
15
  cy.intercept('GET', '/rest/repositories/all').as('getRepositories');
12
16
  }
@@ -1,5 +1,9 @@
1
1
  export class SecurityStubs {
2
2
 
3
+ static spyOnAuthenticatedUser() {
4
+ cy.intercept('/rest/security/authenticated-user').as('get-authenticated-user')
5
+ }
6
+
3
7
  static stubUserSecurity(infer = true, sameAs = true, userName = 'admin') {
4
8
  cy.intercept(`rest/security/users/${userName}`, (req) => {
5
9
  req.reply(SecurityStubs.getAdminResponse(infer, sameAs));
@@ -135,9 +135,9 @@ export class TTYGStubs extends Stubs {
135
135
  }).as('delete-agent');
136
136
  }
137
137
 
138
- static stubAgentDefaultsGet() {
138
+ static stubAgentDefaultsGet(fixture = '/ttyg/agent/get-agent-defaults.json') {
139
139
  cy.intercept('GET', '/rest/chat/agents/default', {
140
- fixture: '/ttyg/agent/get-agent-defaults.json',
140
+ fixture,
141
141
  statusCode: 200
142
142
  }).as('get-agent-defaults');
143
143
  }
@@ -167,4 +167,20 @@ export class TTYGStubs extends Stubs {
167
167
  statusCode: 200
168
168
  }).as('explain-response');
169
169
  }
170
+
171
+ static getExternalUrl() {
172
+ cy.intercept('GET', 'rest/info/external-url', {
173
+ statusCode: 200,
174
+ body: 'http://user-pc:7200'
175
+ }).as('external-url');
176
+ }
177
+
178
+ static stubForApiType(type = 'default') {
179
+ const fixtures = {
180
+ default: '/ttyg/agent/get-agent-defaults.json',
181
+ assistants: '/ttyg/agent/get-agent-defaults-assistant-api.json'
182
+ };
183
+ this.stubAgentListGet('/ttyg/agent/get-agent-list-autocomplete-query.json');
184
+ this.stubAgentDefaultsGet(fixtures[type]);
185
+ }
170
186
  }
package/support/e2e.js CHANGED
@@ -23,6 +23,8 @@ import 'cypress-real-events';
23
23
  import 'cypress-file-upload';
24
24
  import {LicenseStubs} from "../stubs/license-stubs";
25
25
  import {SecurityStubs} from "../stubs/security-stubs";
26
+ // https://github.com/bahmutov/cypress-code-coverage
27
+ require('@bahmutov/cypress-code-coverage/support');
26
28
 
27
29
  // Configures an environment variable with the key used for common actions (cmd on mac, ctrl on other OS).
28
30
  // This variable must be used in all actions that type e.g. ctrl-a to select text.
@@ -44,6 +46,5 @@ beforeEach(() => {
44
46
  // for some reason.
45
47
  // It'll be good to investigate it a bit sometime.
46
48
  SecurityStubs.stubGetAdminUser();
47
- // SecurityStubs.stubUpdateUserData('admin');
48
49
  }
49
50
  });