graphdb-workbench-tests 2.7.6 → 2.8.0-RC1

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 (119) hide show
  1. package/cypress.config.js +3 -0
  2. package/fixtures/cluster/2-nodes-cluster-group-status-deleted.json +30 -0
  3. package/fixtures/cluster/2-nodes-cluster-group-status.json +30 -0
  4. package/fixtures/cluster/3-nodes-cluster-group-status-after-replace.json +44 -0
  5. package/fixtures/cluster/3-nodes-cluster-group-status-building-snapshot.json +4 -1
  6. package/fixtures/cluster/3-nodes-cluster-group-status-receiving-snapshot.json +4 -1
  7. package/fixtures/cluster/3-nodes-cluster-group-status-sending-snapshot.json +4 -1
  8. package/fixtures/cluster/3-nodes-cluster-group-status-waiting-for-snapshot.json +4 -1
  9. package/fixtures/cluster/3-nodes-cluster-group-status.json +12 -3
  10. package/fixtures/cluster/4-nodes-cluster-group-status.json +58 -0
  11. package/fixtures/cluster/cluster-config.json +1 -0
  12. package/fixtures/cluster/cluster-node-status.json +4 -1
  13. package/fixtures/connectors/get-connectors.json +8 -0
  14. package/fixtures/connectors/get-retrieval-connector-0.json +1 -0
  15. package/fixtures/connectors/get-retrieval-connector.json +29 -0
  16. package/fixtures/connectors/get-ttyg-chatgpt-connectors.json +188 -0
  17. package/fixtures/locale-en.json +630 -61
  18. package/fixtures/namespaces/get-repository-starwars-namespaces.json +252 -0
  19. package/fixtures/remote-location/get-0-remote-locations.json +1 -2
  20. package/fixtures/remote-location/get-1-remote-locations.json +2 -4
  21. package/fixtures/remote-location/get-2-remote-locations.json +3 -6
  22. package/fixtures/remote-location/get-3-remote-locations.json +4 -8
  23. package/fixtures/remote-location/get-4-remote-locations.json +54 -0
  24. package/fixtures/remote-location/remote-location-status-in-cluster.json +1 -2
  25. package/fixtures/remote-location/remote-location-status-not-in-cluster.json +1 -2
  26. package/fixtures/remote-location/remote-locations-filter.json +1 -2
  27. package/fixtures/repositories/get-locations.json +67 -0
  28. package/fixtures/repositories/get-repositories.json +106 -0
  29. package/fixtures/repositories/get-repository-config-starwars-disabled-fts.json +201 -0
  30. package/fixtures/repositories/get-repository-config-starwars-enabled-fts.json +201 -0
  31. package/fixtures/repositories/get-ttyg-repositories.json +74 -0
  32. package/fixtures/similarity/get-similarity-indexes-0.json +1 -0
  33. package/fixtures/similarity/get-similarity-indexes.json +15 -0
  34. package/fixtures/similarity/get-ttyg-similarity-connectors.json +46 -0
  35. package/fixtures/ttyg/agent/create-agent.json +20 -0
  36. package/fixtures/ttyg/agent/get-agent-defaults.json +42 -0
  37. package/fixtures/ttyg/agent/get-agent-list-0.json +1 -0
  38. package/fixtures/ttyg/agent/get-agent-list-after-deleted.json +56 -0
  39. package/fixtures/ttyg/agent/get-agent-list-new-agent.json +22 -0
  40. package/fixtures/ttyg/agent/get-agent-list.json +77 -0
  41. package/fixtures/ttyg/agent/get-agent.json +25 -0
  42. package/fixtures/ttyg/chats/ask-question.json +25 -0
  43. package/fixtures/ttyg/chats/create/create-chat-response.json +16 -0
  44. package/fixtures/ttyg/chats/create/get-chats-after-create.json +12 -0
  45. package/fixtures/ttyg/chats/create/get-chats-before-create.json +7 -0
  46. package/fixtures/ttyg/chats/deleted-chat.json +3 -0
  47. package/fixtures/ttyg/chats/explain-response-1.json +59 -0
  48. package/fixtures/ttyg/chats/explain-response-2.json +59 -0
  49. package/fixtures/ttyg/chats/export-chat.json +34 -0
  50. package/fixtures/ttyg/chats/get-chat-list-0.json +1 -0
  51. package/fixtures/ttyg/chats/get-chat-list-with-deleted-chat.json +17 -0
  52. package/fixtures/ttyg/chats/get-chat-list-with-renamed-chat.json +22 -0
  53. package/fixtures/ttyg/chats/get-chat-list.json +22 -0
  54. package/fixtures/ttyg/chats/get-chat.json +199 -0
  55. package/fixtures/ttyg/chats/renamed-chat.json +4 -0
  56. package/integration/cluster/cluster-management.spec.js +0 -170
  57. package/integration/cluster/edit-cluster-nodes-modal.spec.js +425 -0
  58. package/integration/explore/graphs.overview.spec.js +4 -0
  59. package/integration/home/cookie-policy.spec.js +65 -0
  60. package/integration/home/create-repository.spec.js +35 -0
  61. package/integration/home/documentation-link.spec.js +60 -0
  62. package/integration/home/google-analytics.spec.js +60 -0
  63. package/integration/home/language-selector.spec.js +19 -0
  64. package/integration/home/rdf-resource-search.spec.js +192 -0
  65. package/integration/home/view-resource-autocomplete.spec.js +52 -0
  66. package/integration/home/workbench.home.spec.js +1 -277
  67. package/integration/import/import-user-data-file-upload.spec.js +13 -0
  68. package/integration/import/import-user-data.spec.js +8 -2
  69. package/integration/import/import-view.spec.js +6 -1
  70. package/integration/repository/attach-remote-location.spec.js +203 -0
  71. package/integration/repository/ontop-repository.spec.js +87 -1
  72. package/integration/repository/repositories.spec.js +4 -19
  73. package/integration/setup/my-settings.spec.js +2 -0
  74. package/integration/ttyg/agent-list.spec.js +76 -0
  75. package/integration/ttyg/agent-select-menu.spec.js +141 -0
  76. package/integration/ttyg/chat-list.spec.js +286 -0
  77. package/integration/ttyg/chat-panel.spec.js +175 -0
  78. package/integration/ttyg/clone-agent.spec.js +75 -0
  79. package/integration/ttyg/create-agent.spec.js +560 -0
  80. package/integration/ttyg/create-chat.spec.js +69 -0
  81. package/integration/ttyg/delete-agent.spec.js +51 -0
  82. package/integration/ttyg/edit-agent.spec.js +54 -0
  83. package/integration/ttyg/ttyg-permission.spec.js +66 -0
  84. package/integration/ttyg/ttyg-view.spec.js +75 -0
  85. package/npm-shrinkwrap.json +215 -220
  86. package/package.json +5 -6
  87. package/steps/alert-dialog-steps.js +25 -0
  88. package/steps/cluster/cluster-page-steps.js +8 -0
  89. package/steps/cluster/custer-nodes-configuration-steps.js +107 -0
  90. package/steps/home-steps.js +48 -5
  91. package/steps/import/import-steps.js +11 -11
  92. package/steps/modal-dialog-steps.js +8 -0
  93. package/steps/ontop-repository-steps.js +26 -0
  94. package/steps/repositories/attach-repository-steps.js +118 -0
  95. package/steps/repository-steps.js +53 -5
  96. package/steps/setup/settings-steps.js +17 -0
  97. package/steps/ttyg/chat-panel-steps.js +62 -0
  98. package/steps/ttyg/ttyg-agent-settings-modal.steps.js +462 -0
  99. package/steps/ttyg/ttyg-view-steps.js +333 -0
  100. package/steps/window-steps.js +5 -0
  101. package/stubs/cluster/cluster-stubs.js +127 -7
  102. package/stubs/cluster/remote-location-stubs.js +46 -0
  103. package/stubs/connector-stubs.js +39 -0
  104. package/stubs/environment-stubs.js +27 -0
  105. package/stubs/license-stubs.js +101 -0
  106. package/stubs/repositories/repositories-stubs.js +133 -0
  107. package/stubs/repositories-stub.js +15 -0
  108. package/stubs/security-stubs.js +7 -0
  109. package/stubs/similarity-index-stubs.js +32 -0
  110. package/stubs/stubs.js +4 -0
  111. package/stubs/ttyg/ttyg-stubs.js +166 -0
  112. package/support/commands.js +2 -0
  113. package/support/index.js +17 -0
  114. package/support/security-command.js +25 -0
  115. package/support/settings-commands.js +4 -5
  116. package/support/user-commands.js +31 -0
  117. package/steps/cluster/add-remote-location-dialog-steps.js +0 -11
  118. package/steps/cluster/create-cluster-dialog-steps.js +0 -39
  119. package/steps/cluster/replace-nodes-dialog-steps.js +0 -39
@@ -0,0 +1,51 @@
1
+ import {TTYGViewSteps} from "../../steps/ttyg/ttyg-view-steps";
2
+ import {TTYGStubs} from "../../stubs/ttyg/ttyg-stubs";
3
+ import {RepositoriesStubs} from "../../stubs/repositories/repositories-stubs";
4
+ import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
5
+ import {RepositoriesStub} from "../../stubs/repositories-stub";
6
+
7
+ describe('TTYG delete agent', () => {
8
+ const repositoryId = 'starwars';
9
+
10
+ beforeEach(() => {
11
+ RepositoriesStubs.stubRepositories(0, '/repositories/get-ttyg-repositories.json');
12
+ RepositoriesStub.stubBaseEndpoints(repositoryId);
13
+ cy.presetRepository(repositoryId);
14
+ });
15
+
16
+ it('Should be able to delete agent', () => {
17
+ TTYGStubs.stubChatsListGetNoResults();
18
+ TTYGStubs.stubAgentListGet();
19
+ // Given I have opened the ttyg page
20
+ TTYGViewSteps.visit();
21
+ TTYGViewSteps.expandAgentsSidebar();
22
+ TTYGViewSteps.getAgents().should('have.length', 2);
23
+ TTYGViewSteps.filterAgentsByRepository('All');
24
+ TTYGViewSteps.getAgents().should('have.length', 4);
25
+ // When I select the delete agent action
26
+ TTYGViewSteps.triggerDeleteAgentActionMenu(0);
27
+ // Then I should see the delete agent dialog
28
+ ModalDialogSteps.getDialog().should('be.visible');
29
+ ModalDialogSteps.getDialogBody().contains('Do you really want to delete the agent agent-1?');
30
+ // When I cancel the delete agent action
31
+ ModalDialogSteps.cancel();
32
+ // Then the modal dialog should be closed
33
+ ModalDialogSteps.getDialog().should('not.exist');
34
+ // When I select the delete agent action
35
+ TTYGStubs.stubAgentDelete(1000);
36
+ TTYGStubs.stubAgentListGet('/ttyg/agent/get-agent-list-after-deleted.json');
37
+ TTYGViewSteps.triggerDeleteAgentActionMenu(0);
38
+ // And I confirm the delete agent action
39
+ ModalDialogSteps.confirm();
40
+ // Then the modal dialog should be closed
41
+ ModalDialogSteps.getDialog().should('not.exist');
42
+ // And the agent should be deleted
43
+ TTYGViewSteps.getAgentDeletingLoader().should('be.visible');
44
+ TTYGViewSteps.getAgents().should('have.length', 3);
45
+ TTYGViewSteps.verifyAgentList([
46
+ {name: 'agent-2', repositoryId: 'Not existing repo', isRepositoryDeleted: true},
47
+ {name: 'Databricks-general-unbiased', repositoryId: 'starwars', isRepositoryDeleted: false},
48
+ {name: 'Databricks-biomarkers', repositoryId: 'biomarkers', isRepositoryDeleted: false}
49
+ ]);
50
+ });
51
+ });
@@ -0,0 +1,54 @@
1
+ import {RepositoriesStubs} from "../../stubs/repositories/repositories-stubs";
2
+ import {TTYGViewSteps} from "../../steps/ttyg/ttyg-view-steps";
3
+ import {TTYGStubs} from "../../stubs/ttyg/ttyg-stubs";
4
+ import {TtygAgentSettingsModalSteps} from "../../steps/ttyg/ttyg-agent-settings-modal.steps";
5
+ import {ToasterSteps} from "../../steps/toaster-steps";
6
+ import {RepositoriesStub} from "../../stubs/repositories-stub";
7
+
8
+ describe('TTYG edit an agent', () => {
9
+ const repositoryId = 'starwars';
10
+
11
+ beforeEach(() => {
12
+ RepositoriesStubs.stubRepositories(0, '/repositories/get-ttyg-repositories.json');
13
+ RepositoriesStub.stubBaseEndpoints(repositoryId);
14
+ cy.presetRepository(repositoryId);
15
+ TTYGStubs.stubAgentDefaultsGet();
16
+ });
17
+
18
+ it(' should be able to edit an agent.', {
19
+ retries: {
20
+ runMode: 1,
21
+ openMode: 0
22
+ }
23
+ }, () => {
24
+ TTYGStubs.stubChatsListGet();
25
+ TTYGStubs.stubAgentListGet();
26
+ TTYGStubs.stubChatGet();
27
+ // Given I have opened the ttyg page
28
+ TTYGViewSteps.visit();
29
+ cy.wait('@get-chat-list');
30
+ cy.wait('@get-agent-list');
31
+ cy.wait('@get-chat');
32
+ // When I select an agent that don't have activated additional extraction method
33
+ TTYGViewSteps.expandAgentsSidebar();
34
+ TTYGViewSteps.openAgentsMenu();
35
+ TTYGViewSteps.selectAgent(0);
36
+ TTYGViewSteps.editCurrentAgent();
37
+
38
+ // Then I expect that the iri discovery checkbox is not checked
39
+ TtygAgentSettingsModalSteps.getIriDiscoverySearchCheckbox().should('not.be.checked');
40
+
41
+ // When I check the iri discovery checkbox
42
+ TtygAgentSettingsModalSteps.checkIriDiscoverySearchCheckbox();
43
+
44
+ // and save the agent.
45
+ TTYGStubs.stubAgentEdit();
46
+ TtygAgentSettingsModalSteps.saveAgent();
47
+ cy.wait('@edit-agent');
48
+ // Then I expect the agent to be saved
49
+ ToasterSteps.verifySuccess('The agent \'agent-1\' was saved successfully.');
50
+ TTYGViewSteps.editCurrentAgent();
51
+ TtygAgentSettingsModalSteps.getIriDiscoverySearchCheckbox().should('be.checked');
52
+ });
53
+
54
+ });
@@ -0,0 +1,66 @@
1
+ import {RepositoriesStubs} from "../../stubs/repositories/repositories-stubs";
2
+ import {RepositoriesStub} from "../../stubs/repositories-stub";
3
+ import {UserAndAccessSteps} from "../../steps/setup/user-and-access-steps";
4
+ import {TTYGStubs} from "../../stubs/ttyg/ttyg-stubs";
5
+ import {TTYGViewSteps} from "../../steps/ttyg/ttyg-view-steps";
6
+
7
+ const USER_WITH_ROLE_USER = 'ttyg_user';
8
+ const USER_WITH_ROLE_REPO_MANAGER = 'ttyg_repo_manager';
9
+ const USER_ADMINISTRATOR = 'admin';
10
+ const PASSWORD = 'root';
11
+ const ENABLED = true;
12
+ const DISABLED = false;
13
+
14
+ describe('TTYG permissions', () => {
15
+
16
+
17
+ before(() => {
18
+ RepositoriesStubs.stubRepositories(0, '/repositories/get-ttyg-repositories.json');
19
+ RepositoriesStub.stubBaseEndpoints('starwars');
20
+ cy.presetRepository('starwars');
21
+ cy.createUser({username: USER_WITH_ROLE_USER, password: PASSWORD});
22
+ cy.createUser({
23
+ username: USER_WITH_ROLE_REPO_MANAGER,
24
+ password: PASSWORD,
25
+ grantedAuthorities: ["ROLE_REPO_MANAGER", "WRITE_REPO_*", "READ_REPO_*"]
26
+ });
27
+ UserAndAccessSteps.visit();
28
+ UserAndAccessSteps.toggleSecurity();
29
+ });
30
+
31
+ after(() => {
32
+ UserAndAccessSteps.visit();
33
+ UserAndAccessSteps.loginWithUser(USER_ADMINISTRATOR, PASSWORD);
34
+ UserAndAccessSteps.toggleSecurity();
35
+ cy.deleteUser(USER_WITH_ROLE_USER);
36
+ cy.deleteUser(USER_WITH_ROLE_REPO_MANAGER);
37
+ });
38
+
39
+ it('should disable all buttons that can modify the agent', () => {
40
+
41
+ // When I log in with a user who has the ROLE_USER role, I expect all buttons modifying the agent to be disabled.
42
+ verifyCanCreateAgentForFirstTime(USER_WITH_ROLE_USER, PASSWORD, DISABLED);
43
+
44
+ // When I log in with a user who has the ROLE_REPO_MANAGER role, I expect all buttons modifying the agent to be enabled.
45
+ verifyCanCreateAgentForFirstTime(USER_WITH_ROLE_REPO_MANAGER, PASSWORD, ENABLED);
46
+
47
+ // When I log in with a user who is administrator, I expect all buttons modifying the agent to be enabled.
48
+ verifyCanCreateAgentForFirstTime(USER_ADMINISTRATOR, PASSWORD, ENABLED);
49
+ });
50
+
51
+ function verifyCanCreateAgentForFirstTime(user, password, enable) {
52
+ const shouldBe = enable ? 'be.enabled' : 'be.disabled';
53
+ TTYGStubs.stubAgentListGet('/ttyg/agent/get-agent-list-0.json');
54
+ TTYGViewSteps.visit();
55
+ UserAndAccessSteps.loginWithUser(user, password);
56
+ TTYGViewSteps.getCreateFirstAgentButton().should(shouldBe);
57
+ TTYGStubs.stubChatsListGet();
58
+ TTYGStubs.stubAgentListGet();
59
+ TTYGStubs.stubChatGet();
60
+ TTYGViewSteps.visit();
61
+ TTYGViewSteps.getCreateAgentButton().should(shouldBe);
62
+ TTYGViewSteps.getEditCurrentAgentButton().should(shouldBe);
63
+ TTYGViewSteps.getToggleAgentsSidebarButton().should(shouldBe);
64
+ UserAndAccessSteps.logout();
65
+ }
66
+ });
@@ -0,0 +1,75 @@
1
+ import {TTYGViewSteps} from "../../steps/ttyg/ttyg-view-steps";
2
+ import {TTYGStubs} from "../../stubs/ttyg/ttyg-stubs";
3
+ import {RepositoriesStubs} from "../../stubs/repositories/repositories-stubs";
4
+ import {ApplicationSteps} from "../../steps/application-steps";
5
+ import {RepositoriesStub} from "../../stubs/repositories-stub";
6
+
7
+ describe('TTYG view', () => {
8
+
9
+ const repositoryId = 'starwars';
10
+
11
+ beforeEach(() => {
12
+ RepositoriesStubs.stubRepositories(0, '/repositories/get-ttyg-repositories.json');
13
+ RepositoriesStub.stubBaseEndpoints(repositoryId);
14
+ cy.presetRepository(repositoryId);
15
+ });
16
+
17
+ it('Should load ttyg page and render main components', () => {
18
+ TTYGStubs.stubChatsListGet();
19
+ TTYGStubs.stubAgentListGet();
20
+ TTYGStubs.stubChatGet();
21
+ // Given I have opened the ttyg page
22
+ TTYGViewSteps.visit();
23
+ cy.wait('@get-chat');
24
+ // When the ttyg page is loaded
25
+ // Then I should see the ttyg view
26
+ TTYGViewSteps.getTtygView().should('exist');
27
+ TTYGViewSteps.getTtygViewTitle().should('contain', 'Talk to Your Graph');
28
+ // Verify the chats sidebar
29
+ TTYGViewSteps.getChatsPanel().should('be.visible');
30
+ TTYGViewSteps.getToggleChatsSidebarButton().should('be.visible');
31
+ // The create chat button is visible when there are chats
32
+ TTYGViewSteps.getCreateChatButton().should('exist');
33
+ // Verify the agents sidebar
34
+ TTYGViewSteps.getAgentsPanel().should('not.be.visible');
35
+ TTYGViewSteps.getHelpButton().should('be.visible');
36
+ TTYGViewSteps.getCreateAgentButton().should('be.visible');
37
+ TTYGViewSteps.getToggleAgentsSidebarButton().should('be.visible');
38
+ // Verify the chat panel
39
+ TTYGViewSteps.getChat().should('be.visible');
40
+ TTYGViewSteps.getChatPanelToolbar().should('be.visible');
41
+
42
+ // When I select a chat whose last answer has a deleted agent.
43
+ TTYGViewSteps.selectChat(0, 2);
44
+ // the edit agent settings button should not be visible when there is not a selected agent
45
+ TTYGViewSteps.getEditCurrentAgentButton().should('not.exist');
46
+ });
47
+
48
+ it('Should render no agents view if no agent is created yet', () => {
49
+ TTYGStubs.stubChatsListGetNoResults();
50
+ TTYGStubs.stubAgentListGet('/ttyg/agent/get-agent-list-0.json');
51
+ // Given I have opened the ttyg page
52
+ TTYGViewSteps.visit();
53
+ // When the ttyg page is loaded
54
+ // Then I should see the ttyg view
55
+ TTYGViewSteps.getTtygView().should('exist');
56
+ // And the no agents view should be rendered
57
+ TTYGViewSteps.getNoAgentsView().should('be.visible');
58
+ // And the create agent button should be visible
59
+ TTYGViewSteps.getCreateFirstAgentButton().should('be.visible');
60
+ });
61
+
62
+ it('Should show error notification if agents loading fails', () => {
63
+ TTYGStubs.stubChatsListGet();
64
+ TTYGStubs.stubAgentListGetError();
65
+ TTYGStubs.stubChatGet();
66
+ // Given I have opened the ttyg page
67
+ TTYGViewSteps.visit();
68
+ // When the agents loading fails
69
+ // Then I should see an error notification
70
+ ApplicationSteps.getErrorNotifications().should('be.visible');
71
+ // And the no agents view should be rendered
72
+ TTYGViewSteps.getNoAgentsView().should('be.visible');
73
+ });
74
+ });
75
+