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
@@ -1,12 +1,8 @@
1
1
  import {ClusterPageSteps} from "../../steps/cluster/cluster-page-steps";
2
2
  import {GlobalOperationsStatusesStub} from "../../stubs/global-operations-statuses-stub";
3
3
  import {ClusterStubs} from "../../stubs/cluster/cluster-stubs";
4
- import {CreateClusterDialogSteps} from "../../steps/cluster/create-cluster-dialog-steps";
5
- import {AddRemoteLocationDialogSteps} from "../../steps/cluster/add-remote-location-dialog-steps";
6
4
  import {RemoteLocationStubs} from "../../stubs/cluster/remote-location-stubs";
7
5
  import {DeleteClusterDialogSteps} from "../../steps/cluster/delete-cluster-dialog-steps";
8
- import {ReplaceNodesDialogSteps} from "../../steps/cluster/replace-nodes-dialog-steps";
9
- import {ApplicationSteps} from "../../steps/application-steps";
10
6
  import {ClusterConfigurationSteps} from "../../steps/cluster/cluster-configuration-steps";
11
7
 
12
8
  describe('Cluster management', () => {
@@ -18,91 +14,6 @@ describe('Cluster management', () => {
18
14
  GlobalOperationsStatusesStub.stubNoOperationsResponse(repositoryId);
19
15
  });
20
16
 
21
- it('Should be able to open a create cluster dialog', () => {
22
- // Given I have opened the cluster management page
23
- ClusterPageSteps.visit();
24
-
25
- ClusterStubs.stubNoClusterGroupStatus();
26
- ClusterStubs.stubNoClusterNodeStatus();
27
- ClusterStubs.stubNoClusterConfig();
28
- RemoteLocationStubs.stubAddRemoteLocation();
29
- RemoteLocationStubs.stubGetRemoteLocations(0);
30
-
31
- // Then I expect that the page should be loaded
32
- ClusterPageSteps.getClusterPage().should('be.visible');
33
- // And the create cluster button to be visible
34
- ClusterPageSteps.getCreateClusterButton().should('be.visible').and('have.class', 'no-cluster');
35
- // When I click on the create cluster button
36
- ClusterPageSteps.createCluster();
37
- // Then I expect create cluster dialog to become visible
38
- CreateClusterDialogSteps.getDialog().should('be.visible');
39
- CreateClusterDialogSteps.getDialogHeader().should('contain.text', 'Create cluster');
40
- // And I expect to see a single node in the cluster nodes list
41
- CreateClusterDialogSteps.getClusterNodesList().should('have.length', 1);
42
- // And I expect to see no remote locations in the locations list
43
- CreateClusterDialogSteps.getRemoteLocationsList().should('have.length', 0);
44
- // And I expect that the create cluster button should be disabled
45
- CreateClusterDialogSteps.getNoSelectedNodesWarning().should('be.visible');
46
- // And I expect that the create cluster button should be disabled
47
- CreateClusterDialogSteps.getSaveClusterConfigButton().should('be.disabled');
48
- // When I click on the cancel button
49
- CreateClusterDialogSteps.clickOnCancelButton();
50
- // Then I expect that the create cluster dialog should be closed
51
- CreateClusterDialogSteps.getDialog().should('not.exist');
52
- });
53
-
54
- it('Should be able to create a cluster', () => {
55
- // Given I have opened the cluster management page
56
- ClusterPageSteps.visit();
57
-
58
- // When there is no cluster configured yet
59
- ClusterStubs.stubNoClusterGroupStatus();
60
- ClusterStubs.stubNoClusterNodeStatus();
61
- ClusterStubs.stubNoClusterConfig();
62
- RemoteLocationStubs.stubAddRemoteLocation();
63
- RemoteLocationStubs.stubGetRemoteLocations(0);
64
-
65
- // When I open the create cluster dialog
66
- ClusterPageSteps.getClusterPage().should('be.visible');
67
- ClusterPageSteps.createCluster();
68
- CreateClusterDialogSteps.getDialog().should('be.visible');
69
- // And I add a remote location
70
- RemoteLocationStubs.stubRemoteLocationCheck();
71
- addRemoteLocation('http://localhost:7201', 1);
72
- CreateClusterDialogSteps.getRemoteLocationsList().should('have.length', 1);
73
- // When I select the added remote location
74
- CreateClusterDialogSteps.selectRemoteLocation(0);
75
- // Then I expect that the remote location will be added to the cluster nodes list
76
- CreateClusterDialogSteps.getRemoteLocationsList().should('have.length', 0);
77
- CreateClusterDialogSteps.getClusterNodesList().should('have.length', 2);
78
- // And the no selected nodes warning should disappear
79
- CreateClusterDialogSteps.getNoSelectedNodesWarning().should('not.exist');
80
- // When I add another remote location
81
- addRemoteLocation('http://localhost:7202', 2);
82
- // Then I expect it to be added to the cluster nodes list
83
- CreateClusterDialogSteps.getRemoteLocationsList().should('have.length', 1);
84
- CreateClusterDialogSteps.selectRemoteLocation(0);
85
- CreateClusterDialogSteps.getRemoteLocationsList().should('have.length', 0);
86
- CreateClusterDialogSteps.getClusterNodesList().should('have.length', 3);
87
- // When I click on create cluster button
88
- ClusterStubs.stubCreateCluster();
89
- CreateClusterDialogSteps.saveClusterConfig();
90
- // Then I expect that the create cluster dialog should be closed
91
- CreateClusterDialogSteps.getDialog().should('not.exist');
92
- // And cluster should be created
93
- ClusterStubs.stubClusterConfig();
94
- ClusterStubs.stubClusterGroupStatus();
95
- ClusterStubs.stubClusterNodeStatus();
96
- RemoteLocationStubs.stubRemoteLocationFilter();
97
- RemoteLocationStubs.stubRemoteLocationStatusInCluster();
98
- // And cluster management actions should be accessible
99
- ClusterPageSteps.getRemoveNodesButton().should('be.visible');
100
- ClusterPageSteps.getAddNodesButton().should('be.visible');
101
- ClusterPageSteps.getReplaceNodesButton().should('be.visible');
102
- ClusterPageSteps.getPreviewClusterConfigButton().should('be.visible');
103
- ClusterPageSteps.getCreateClusterButton().should('not.have.class', 'no-cluster');
104
- });
105
-
106
17
  it('Should be able to delete cluster', () => {
107
18
  // Given I have opened the cluster management page
108
19
  ClusterPageSteps.visit();
@@ -136,85 +47,4 @@ describe('Cluster management', () => {
136
47
  ClusterPageSteps.getPreviewClusterConfigButton().should('not.exist');
137
48
  ClusterPageSteps.getCreateClusterButton().should('have.class', 'no-cluster');
138
49
  });
139
-
140
- it('Should be able to replace nodes in cluster', () => {
141
- // Given I have opened the cluster management page
142
- RemoteLocationStubs.stubGetRemoteLocations();
143
- ClusterPageSteps.visit();
144
-
145
- // Given there is an existing cluster created
146
- ClusterStubs.stubClusterConfig();
147
- ClusterStubs.stubClusterGroupStatus();
148
- ClusterStubs.stubClusterNodeStatus();
149
- RemoteLocationStubs.stubRemoteLocationFilter();
150
- RemoteLocationStubs.stubRemoteLocationStatusInCluster();
151
- ClusterPageSteps.getClusterPage().should('be.visible');
152
- ClusterPageSteps.getCreateClusterButton().should('not.have.class', 'no-cluster');
153
- // When I click on replace nodes button
154
- ClusterPageSteps.replaceNodes();
155
- // Then I expect a replace nodes dialog to appear
156
- ReplaceNodesDialogSteps.getDialog().should('be.visible');
157
- ReplaceNodesDialogSteps.getClusterNodes().should('have.length', 3);
158
- ReplaceNodesDialogSteps.getRemoteLocations().should('have.length', 0);
159
- ReplaceNodesDialogSteps.getReplaceNodesButton().should('be.disabled');
160
- // When I add a new remote location
161
- RemoteLocationStubs.stubAddRemoteLocation();
162
- RemoteLocationStubs.stubRemoteLocationCheck();
163
- addRemoteLocation('http://localhost:7203', 3);
164
- ClusterPageSteps.getClusterPage().should('be.visible');
165
- ClusterPageSteps.getCreateClusterButton().should('not.have.class', 'no-cluster');
166
- // And I select the new location as replacement node
167
- ReplaceNodesDialogSteps.selectRemoteLocation(0);
168
- ReplaceNodesDialogSteps.getSelectedRemoteLocations().should('have.length', 1);
169
- // And I select a node from the cluster to be replaced
170
- ReplaceNodesDialogSteps.selectClusterNode(2);
171
- // Then I expect the replace nodes button to become enabled
172
- ReplaceNodesDialogSteps.getReplaceNodesButton().should('not.be.disabled');
173
- // When I click on replace nodes button
174
- ClusterStubs.stubReplaceNodes();
175
- ReplaceNodesDialogSteps.replaceNodes();
176
- // Then I expect nodes to be replaced
177
- cy.wait('@replace-nodes').then((interception) => {
178
- expect(interception.request.body).to.deep.equal({
179
- "addNodes": [
180
- "pc-desktop:7301\n"
181
- ],
182
- "removeNodes": [
183
- "pc-desktop:7302"
184
- ]
185
- });
186
- });
187
- ReplaceNodesDialogSteps.getDialog().should('not.exist');
188
- ApplicationSteps.getSuccessNotifications().should('be.visible');
189
- });
190
-
191
- it('Should not see "Authentication type" while attaching remote GDB node in cluster view', () => {
192
- // Given I have opened the cluster management page
193
- ClusterPageSteps.visit();
194
-
195
- // When there is no cluster configured yet
196
- ClusterStubs.stubNoClusterGroupStatus();
197
- ClusterStubs.stubNoClusterNodeStatus();
198
- ClusterStubs.stubNoClusterConfig();
199
- RemoteLocationStubs.stubAddRemoteLocation();
200
- RemoteLocationStubs.stubGetRemoteLocations(0);
201
-
202
- // When I open the create cluster dialog
203
- ClusterPageSteps.getClusterPage().should('be.visible');
204
- ClusterPageSteps.createCluster();
205
- CreateClusterDialogSteps.getDialog().should('be.visible');
206
- // And I add a remote location
207
- RemoteLocationStubs.stubRemoteLocationCheck();
208
- CreateClusterDialogSteps.openAddRemoteLocationDialog();
209
- AddRemoteLocationDialogSteps.getDialog().should('be.visible');
210
- AddRemoteLocationDialogSteps.verifyDialogBody("The token secret must be the same on all GraphDB instances. For more information on configuring the token secret, please refer to ");
211
- });
212
50
  });
213
-
214
- function addRemoteLocation(location, locationsCount) {
215
- CreateClusterDialogSteps.openAddRemoteLocationDialog();
216
- AddRemoteLocationDialogSteps.getDialog().should('be.visible');
217
- AddRemoteLocationDialogSteps.typeLocation(location);
218
- RemoteLocationStubs.stubGetRemoteLocations(locationsCount);
219
- AddRemoteLocationDialogSteps.addLocation();
220
- }
@@ -0,0 +1,425 @@
1
+ import {GlobalOperationsStatusesStub} from "../../stubs/global-operations-statuses-stub";
2
+ import {ClusterPageSteps} from "../../steps/cluster/cluster-page-steps";
3
+ import {ClusterStubs} from "../../stubs/cluster/cluster-stubs";
4
+ import {RemoteLocationStubs} from "../../stubs/cluster/remote-location-stubs";
5
+ import {ClusterNodesConfigurationSteps} from "../../steps/cluster/custer-nodes-configuration-steps";
6
+ import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
7
+ import {ApplicationSteps} from "../../steps/application-steps";
8
+
9
+
10
+ describe('Cluster management', () => {
11
+
12
+ let repositoryId;
13
+
14
+ beforeEach(() => {
15
+ repositoryId = 'cluster-repo' + Date.now();
16
+ GlobalOperationsStatusesStub.stubNoOperationsResponse(repositoryId);
17
+ });
18
+
19
+ it('Should be able to add', () => {
20
+ const clusterLocations = ['http://pc-desktop:7200', 'http://pc-desktop:7201', 'http://pc-desktop:7202'];
21
+ const nodesToAdd = ['http://pc-desktop:7203'];
22
+ const urisToAdd = ['http://pc-desktop:7203'];
23
+ ClusterStubs.stubClusterConfigByList(clusterLocations);
24
+ ClusterStubs.stubClusterGroupStatus();
25
+ ClusterStubs.stubClusterNodeStatus();
26
+ RemoteLocationStubs.stubRemoteLocationFilter();
27
+
28
+ // Given I have opened the cluster management page
29
+ ClusterPageSteps.visit();
30
+ ClusterPageSteps.getClusterPage().should('be.visible');
31
+ ClusterPageSteps.getCreateClusterButton().should('not.have.class', 'no-cluster');
32
+
33
+ // When I click on update cluster
34
+ ClusterPageSteps.updateCluster();
35
+ ClusterNodesConfigurationSteps.getClusterNodesConfigurationModal().should('be.visible');
36
+
37
+ // Then I should see the 3 nodes in the cluster
38
+ clusterLocations.forEach((node) => {
39
+ ClusterNodesConfigurationSteps.getNodeByEndpoint(node).should('exist');
40
+ });
41
+
42
+ // When I add node
43
+ ClusterNodesConfigurationSteps.clickAddNodeButton();
44
+
45
+ // Then I should see the edit node row
46
+ ClusterNodesConfigurationSteps.getEditNodeRow().should('be.visible');
47
+
48
+ // When I enter a new endpoint
49
+ ClusterNodesConfigurationSteps.enterNodeEndpoint(urisToAdd[0]);
50
+
51
+ // And I save the node
52
+ RemoteLocationStubs.stubAddRemoteLocation();
53
+ RemoteLocationStubs.stubGetRemoteLocationsByList(urisToAdd);
54
+ ClusterNodesConfigurationSteps.clickSaveNodeButton();
55
+
56
+ // Then I should see the new node in the list
57
+ ClusterNodesConfigurationSteps.getNodeByEndpoint(urisToAdd[0]).should('exist');
58
+
59
+ //And when I confirm changes
60
+ ClusterStubs.stubAddNodesByList(nodesToAdd);
61
+ ClusterStubs.stubClusterGroupStatusAfterAdd();
62
+ ClusterNodesConfigurationSteps.clickOkButton();
63
+ cy.wait('@response-add-nodes').then((interception) => {
64
+ expect(interception.request.body).to.deep.equal({
65
+ "addNodes": nodesToAdd,
66
+ "removeNodes": []
67
+ });
68
+ });
69
+ // And expect success message to be displayed.
70
+ ApplicationSteps.getSuccessNotifications().contains('Cluster updated successfully');
71
+ });
72
+
73
+ it('Should be able to delete', () => {
74
+ const clusterLocations = ['http://pc-desktop:7200', 'http://pc-desktop:7201', 'http://pc-desktop:7202'];
75
+ const nodesToDelete = ['http://pc-desktop:7201'];
76
+ ClusterStubs.stubClusterConfigByList(clusterLocations);
77
+ ClusterStubs.stubClusterGroupStatus();
78
+ ClusterStubs.stubClusterNodeStatus();
79
+
80
+ // Given I have opened the cluster management page
81
+ ClusterPageSteps.visit();
82
+ ClusterPageSteps.getClusterPage().should('be.visible');
83
+ ClusterPageSteps.getCreateClusterButton().should('not.have.class', 'no-cluster');
84
+
85
+ // When I click on update cluster
86
+ ClusterPageSteps.updateCluster();
87
+ ClusterNodesConfigurationSteps.getClusterNodesConfigurationModal().should('be.visible');
88
+
89
+ // I see tree nodes in the list
90
+ ClusterNodesConfigurationSteps.getNodeIndexByEndpoint('http://pc-desktop:7200').should('have.text', '1');
91
+ ClusterNodesConfigurationSteps.getNodeIndexByEndpoint('http://pc-desktop:7201').should('have.text', '2');
92
+ ClusterNodesConfigurationSteps.getNodeIndexByEndpoint('http://pc-desktop:7202').should('have.text', '3');
93
+ ClusterNodesConfigurationSteps.getNodeStatusByEndpoint('http://pc-desktop:7200').should('eq', '');
94
+ ClusterNodesConfigurationSteps.getNodeStatusByEndpoint('http://pc-desktop:7201').should('eq', '');
95
+ ClusterNodesConfigurationSteps.getNodeStatusByEndpoint('http://pc-desktop:7202').should('eq', '');
96
+
97
+ // When I delete the second node
98
+ ClusterNodesConfigurationSteps.clickDeleteNodeButtonByEndpoint('http://pc-desktop:7201');
99
+
100
+ // I expect to see deleting confirmation dialog.
101
+ ModalDialogSteps.getDialogBody().should('contain', 'Are you sure you want to detach the location \'http://pc-desktop:7201\'?');
102
+
103
+ // When I confirm
104
+ ModalDialogSteps.getConfirmButton().click();
105
+
106
+ // Then the node should be decorated with deleting class
107
+ ClusterNodesConfigurationSteps.getNodeLocationByEndpoint('http://pc-desktop:7201').should('have.class', 'deleting');
108
+
109
+ // And the node has no index number
110
+ ClusterNodesConfigurationSteps.getNodeIndexByEndpoint('http://pc-desktop:7200').should('have.text', '1');
111
+ ClusterNodesConfigurationSteps.getNodeIndexByEndpoint('http://pc-desktop:7201').should('have.text', '');
112
+ ClusterNodesConfigurationSteps.getNodeIndexByEndpoint('http://pc-desktop:7202').should('have.text', '2');
113
+
114
+ // And deleted node should have new status
115
+ ClusterNodesConfigurationSteps.getNodeStatusByEndpoint('http://pc-desktop:7200').should('eq', '');
116
+ ClusterNodesConfigurationSteps.getNodeStatusByEndpoint('http://pc-desktop:7201').should('eq', 'Node will be removed');
117
+ ClusterNodesConfigurationSteps.getNodeStatusByEndpoint('http://pc-desktop:7202').should('eq', '');
118
+
119
+ // And the delete button should be disabled if minimum nodes required
120
+ ClusterNodesConfigurationSteps.isDeleteNodeButtonEnabledByEndpoint('http://pc-desktop:7202')
121
+ .should('be.false');
122
+
123
+ //And when I confirm changes
124
+ ClusterStubs.stubDeleteNodesByList(nodesToDelete);
125
+ ClusterStubs.stubClusterGroupStatusAfterDelete();
126
+ ClusterNodesConfigurationSteps.clickOkButton();
127
+ cy.wait('@response-delete-nodes').then((interception) => {
128
+ expect(interception.request.body).to.deep.equal({
129
+ "addNodes": [],
130
+ "removeNodes": nodesToDelete
131
+ });
132
+ });
133
+ // And expect success message to be displayed.
134
+ ApplicationSteps.getSuccessNotifications().contains('Cluster updated successfully');
135
+ });
136
+
137
+ it('Should be able to add 1 and delete 2 nodes', () => {
138
+ ClusterStubs.stubClusterConfig();
139
+ ClusterStubs.stubClusterGroupStatus();
140
+ ClusterStubs.stubClusterNodeStatus();
141
+ RemoteLocationStubs.stubRemoteLocationFilter();
142
+ RemoteLocationStubs.stubRemoteLocationStatusInCluster();
143
+ RemoteLocationStubs.stubGetRemoteLocationsByList(['http://pc-desktop:7203']);
144
+ RemoteLocationStubs.stubRemoteLocationCheckByAddress([{uri: 'pc-desktop:7203', rpc: 'pc-desktop:7303'}]);
145
+
146
+ // Given I have opened the cluster management page
147
+ ClusterPageSteps.visit();
148
+ ClusterPageSteps.getClusterPage().should('be.visible');
149
+ ClusterPageSteps.getCreateClusterButton().should('not.have.class', 'no-cluster');
150
+
151
+ // When I click on update cluster
152
+ ClusterPageSteps.updateCluster();
153
+ ClusterNodesConfigurationSteps.getClusterNodesConfigurationModal().should('be.visible');
154
+
155
+ // When I delete the second node
156
+ ClusterNodesConfigurationSteps.clickDeleteNodeButtonByEndpoint('http://pc-desktop:7201');
157
+
158
+ // I expect to see deleting confirmation dialog.
159
+ ModalDialogSteps.getDialogBody().should('contain', 'Are you sure you want to detach the location \'http://pc-desktop:7201\'?');
160
+
161
+ // When I confirm
162
+ ModalDialogSteps.getConfirmButton().click();
163
+
164
+ // Then the node should be decorated with deleting class
165
+ ClusterNodesConfigurationSteps.getNodeLocationByEndpoint('http://pc-desktop:7201').should('have.class', 'deleting');
166
+
167
+ // When I add node
168
+ ClusterNodesConfigurationSteps.clickAddNodeButton();
169
+
170
+ // Then I should see the edit node row
171
+ ClusterNodesConfigurationSteps.getEditNodeRow().should('be.visible');
172
+
173
+ // When I enter a new endpoint
174
+ ClusterNodesConfigurationSteps.enterNodeEndpoint('http://pc-desktop:7203');
175
+
176
+ // And I save the node
177
+ RemoteLocationStubs.stubAddRemoteLocation();
178
+ ClusterNodesConfigurationSteps.clickSaveNodeButton();
179
+
180
+ // When I delete the second node
181
+ ClusterNodesConfigurationSteps.clickDeleteNodeButtonByEndpoint('http://pc-desktop:7202');
182
+
183
+ // I expect to see deleting confirmation dialog.
184
+ ModalDialogSteps.getDialogBody().should('contain', 'Are you sure you want to detach the location \'http://pc-desktop:7202\'?');
185
+
186
+ // When I confirm
187
+ ModalDialogSteps.getConfirmButton().click();
188
+
189
+ // Then the node should be decorated with deleting class
190
+ ClusterNodesConfigurationSteps.getNodeLocationByEndpoint('http://pc-desktop:7202').should('have.class', 'deleting');
191
+
192
+ // Then I should see the new node in the list
193
+ ClusterNodesConfigurationSteps.getNodeByEndpoint('http://pc-desktop:7203').should('exist');
194
+
195
+ // And all changed nodes should have new status and index numbers
196
+ ClusterNodesConfigurationSteps.getNodeStatusByEndpoint('http://pc-desktop:7200').should('eq', '');
197
+ ClusterNodesConfigurationSteps.getNodeStatusByEndpoint('http://pc-desktop:7201').should('eq', 'Node will be removed');
198
+ ClusterNodesConfigurationSteps.getNodeStatusByEndpoint('http://pc-desktop:7202').should('eq', 'Node will be removed');
199
+ ClusterNodesConfigurationSteps.getNodeStatusByEndpoint('http://pc-desktop:7203').should('eq', 'Node will be added');
200
+ // And the node has no index number
201
+ ClusterNodesConfigurationSteps.getNodeIndexByEndpoint('http://pc-desktop:7200').should('have.text', '1');
202
+ ClusterNodesConfigurationSteps.getNodeIndexByEndpoint('http://pc-desktop:7201').should('have.text', '');
203
+ ClusterNodesConfigurationSteps.getNodeIndexByEndpoint('http://pc-desktop:7202').should('have.text', '');
204
+ ClusterNodesConfigurationSteps.getNodeIndexByEndpoint('http://pc-desktop:7203').should('have.text', '2');
205
+
206
+
207
+ //And when I confirm changes
208
+ ClusterStubs.stubAddNodesByList(['http://pc-desktop:7203']);
209
+ ClusterStubs.stubDeleteNodesByList(['http://pc-desktop:7201', 'http://pc-desktop:7202']);
210
+ ClusterStubs.stubReplaceNodesByList(['http://pc-desktop:7203'], ['http://pc-desktop:7201']);
211
+ ClusterStubs.stubClusterGroupStatusAfterReplace();
212
+
213
+ ClusterNodesConfigurationSteps.clickOkButton();
214
+ cy.wait('@response-replace-nodes').then((interception) => {
215
+ expect(interception.request.body).to.deep.equal({
216
+ "addNodes": [
217
+ "http://pc-desktop:7203"
218
+ ],
219
+ "removeNodes": [
220
+ "http://pc-desktop:7201",
221
+ "http://pc-desktop:7202"
222
+ ]
223
+ });
224
+ });
225
+
226
+ // And expect success message to be displayed.
227
+ ApplicationSteps.getSuccessNotifications().contains('Cluster updated successfully');
228
+ });
229
+
230
+ it('Should only replace in cluster when I delete 1, add 1 and replace 1 node', () => {
231
+ const clusterLocations = ['http://pc-desktop:7200', 'http://pc-desktop:7201', 'http://pc-desktop:7202'];
232
+ ClusterStubs.stubClusterConfigByList(clusterLocations);
233
+ ClusterStubs.stubClusterGroupStatus();
234
+ ClusterStubs.stubClusterNodeStatus();
235
+ RemoteLocationStubs.stubGetRemoteLocations(4);
236
+ RemoteLocationStubs.stubRemoteLocationFilter();
237
+ RemoteLocationStubs.stubRemoteLocationStatusInCluster();
238
+ RemoteLocationStubs.stubRemoteLocationCheckByAddress([
239
+ {uri: 'pc-desktop:7203', rpc: 'pc-desktop:7303'},
240
+ {uri: 'pc-desktop:7202', rpc: 'pc-desktop:7302'},
241
+ {uri: 'pc-desktop:7233', rpc: 'pc-desktop:7333'}
242
+ ]);
243
+
244
+ // Given I have opened the cluster management page
245
+ ClusterPageSteps.visit();
246
+ ClusterPageSteps.getClusterPage().should('be.visible');
247
+ ClusterPageSteps.getCreateClusterButton().should('not.have.class', 'no-cluster');
248
+
249
+ // When I click on update cluster
250
+ ClusterPageSteps.updateCluster();
251
+ ClusterNodesConfigurationSteps.getClusterNodesConfigurationModal().should('be.visible');
252
+
253
+ // Then I should see the 3 nodes in the cluster
254
+ const nodes = ['http://pc-desktop:7200', 'http://pc-desktop:7201', 'http://pc-desktop:7202'];
255
+ nodes.forEach((node) => {
256
+ ClusterNodesConfigurationSteps.getNodeByEndpoint(node).should('exist');
257
+ });
258
+
259
+ // When I delete the second node
260
+ ClusterNodesConfigurationSteps.clickDeleteNodeButtonByEndpoint('http://pc-desktop:7201');
261
+
262
+ // I expect to see deleting confirmation dialog.
263
+ ModalDialogSteps.getDialogBody().should('contain', 'Are you sure you want to detach the location \'http://pc-desktop:7201\'?');
264
+
265
+ // When I confirm
266
+ ModalDialogSteps.getConfirmButton().click();
267
+
268
+ // Then the node should be decorated with deleting class
269
+ ClusterNodesConfigurationSteps.getNodeLocationByEndpoint('http://pc-desktop:7201').should('have.class', 'deleting');
270
+
271
+ // And deleted node should have new status
272
+ ClusterNodesConfigurationSteps.getNodeStatusByEndpoint('http://pc-desktop:7201').should('eq', 'Node will be removed');
273
+
274
+ // And the delete button should be disabled if minimum nodes required
275
+ ClusterNodesConfigurationSteps.isDeleteNodeButtonEnabledByEndpoint('http://pc-desktop:7202').should('be.false');
276
+
277
+ // When I add a new node
278
+ ClusterNodesConfigurationSteps.clickAddNodeButton();
279
+
280
+ // Then I should see the edit node row
281
+ ClusterNodesConfigurationSteps.getEditNodeRow().should('be.visible');
282
+
283
+ // When I enter a new endpoint
284
+ const newNodeEndpoint = 'http://pc-desktop:7233';
285
+ ClusterNodesConfigurationSteps.enterNodeEndpoint(newNodeEndpoint);
286
+
287
+ // And I save the node
288
+ RemoteLocationStubs.stubAddRemoteLocation();
289
+ ClusterNodesConfigurationSteps.clickSaveNodeButton();
290
+
291
+ // Then I should see the new node in the list
292
+ ClusterNodesConfigurationSteps.getNodeByEndpoint(newNodeEndpoint).should('exist');
293
+
294
+ // With new status
295
+ ClusterNodesConfigurationSteps.getNodeStatusByEndpoint(newNodeEndpoint).should('eq', 'Node will be added');
296
+
297
+ // And the edit node row should not be visible
298
+ ClusterNodesConfigurationSteps.getEditNodeRow().should('not.exist');
299
+
300
+ // When I replace the first node
301
+ ClusterNodesConfigurationSteps.clickReplaceNodeButtonByEndpoint('http://pc-desktop:7200');
302
+
303
+ // I expect to see replacing confirmation dialog.
304
+ ModalDialogSteps.getDialogBody().should('contain', 'Are you sure you want to change the location?');
305
+
306
+ // When I confirm
307
+ ModalDialogSteps.getConfirmButton().click();
308
+
309
+ // Then I should see the edit node row
310
+ ClusterNodesConfigurationSteps.getEditNodeRow().should('be.visible');
311
+
312
+ // When I enter a new endpoint for replacement
313
+ const replacementNodeEndpoint = 'http://pc-desktop:7203';
314
+ ClusterNodesConfigurationSteps.enterNodeEndpoint(replacementNodeEndpoint);
315
+
316
+ // And I save the replacement
317
+ ClusterNodesConfigurationSteps.clickSaveNodeButton();
318
+
319
+ // Then I should see the replacement node in the list
320
+ ClusterNodesConfigurationSteps.getNodeByEndpoint(replacementNodeEndpoint).should('exist');
321
+ ClusterNodesConfigurationSteps.getNodeStatusByEndpoint(replacementNodeEndpoint).should('eq', 'Node will be added');
322
+
323
+ // And the old node should have new class and status
324
+ ClusterNodesConfigurationSteps.getNodeStatusByEndpoint('http://pc-desktop:7200').should('eq', 'Node will be removed');
325
+
326
+ // And all changed nodes should have new status and index numbers
327
+ ClusterNodesConfigurationSteps.getNodeStatusByEndpoint('http://pc-desktop:7200').should('eq', 'Node will be removed');
328
+ ClusterNodesConfigurationSteps.getNodeStatusByEndpoint('http://pc-desktop:7201').should('eq', 'Node will be removed');
329
+ ClusterNodesConfigurationSteps.getNodeStatusByEndpoint('http://pc-desktop:7202').should('eq', '');
330
+ ClusterNodesConfigurationSteps.getNodeStatusByEndpoint('http://pc-desktop:7233').should('eq', 'Node will be added');
331
+ ClusterNodesConfigurationSteps.getNodeStatusByEndpoint('http://pc-desktop:7203').should('eq', 'Node will be added');
332
+ // And the node has no index number
333
+ ClusterNodesConfigurationSteps.getNodeIndexByEndpoint('http://pc-desktop:7200').should('have.text', '');
334
+ ClusterNodesConfigurationSteps.getNodeIndexByEndpoint('http://pc-desktop:7201').should('have.text', '');
335
+ ClusterNodesConfigurationSteps.getNodeIndexByEndpoint('http://pc-desktop:7202').should('have.text', '1');
336
+ ClusterNodesConfigurationSteps.getNodeIndexByEndpoint('http://pc-desktop:7233').should('have.text', '2');
337
+ ClusterNodesConfigurationSteps.getNodeIndexByEndpoint('http://pc-desktop:7203').should('have.text', '3');
338
+
339
+ //And when I confirm changes
340
+ const nodesToAdd = ['http://pc-desktop:7233', 'http://pc-desktop:7203'];
341
+ const nodesToRemove = ['http://pc-desktop:7201', 'http://pc-desktop:7200'];
342
+ ClusterStubs.stubReplaceNodesByList(nodesToAdd, nodesToRemove);
343
+ ClusterStubs.stubClusterGroupStatusAfterReplaceAndDelete();
344
+ ClusterNodesConfigurationSteps.clickOkButton();
345
+ cy.wait('@response-replace-nodes').then((interception) => {
346
+ expect(interception.request.body).to.deep.equal({
347
+ "addNodes": [
348
+ "http://pc-desktop:7233",
349
+ "http://pc-desktop:7203"
350
+ ],
351
+ "removeNodes": [
352
+ "http://pc-desktop:7201",
353
+ "http://pc-desktop:7200"
354
+ ]
355
+ });
356
+ });
357
+ // And expect success message to be displayed.
358
+ ApplicationSteps.getSuccessNotifications().contains('Cluster updated successfully');
359
+ });
360
+
361
+ it('Should be able to open a create cluster dialog', () => {
362
+ ClusterStubs.stubNoClusterNodeStatus();
363
+ ClusterStubs.stubNoClusterGroupStatus();
364
+ ClusterStubs.stubNoClusterConfig();
365
+ RemoteLocationStubs.stubAddRemoteLocation();
366
+ RemoteLocationStubs.stubGetRemoteLocations(0);
367
+
368
+ // Given I have opened the cluster management page
369
+ ClusterPageSteps.visit();
370
+
371
+ // Then I expect that the page should be loaded
372
+ ClusterPageSteps.getClusterPage().should('be.visible');
373
+ // And the create cluster button to be visible
374
+ ClusterPageSteps.getCreateClusterButton().should('be.visible').and('have.class', 'no-cluster');
375
+ // When I click on the create cluster button
376
+ ClusterPageSteps.createCluster();
377
+
378
+ // Then I should see create cluster modal
379
+ ClusterNodesConfigurationSteps.getClusterNodesConfigurationModal().should('be.visible');
380
+ // I should see the local node
381
+ ClusterNodesConfigurationSteps.getNodeByEndpoint('http://pc-desktop:7200').should('exist');
382
+ // I should see buttons, warnings and advanced options
383
+ ClusterNodesConfigurationSteps.getAddNodeButton().should('be.visible').and('be.enabled');
384
+ ClusterNodesConfigurationSteps.getOkButton().should('be.visible').and('be.disabled');
385
+ ClusterNodesConfigurationSteps.getAdvancedOptions().should('be.visible').and('be.enabled');
386
+ ClusterNodesConfigurationSteps.getSaveAlert().should('be.visible');
387
+
388
+
389
+ const urisToAdd = ['http://pc-desktop:7203'];
390
+ RemoteLocationStubs.stubGetRemoteLocationsByList(urisToAdd);
391
+ RemoteLocationStubs.stubRemoteLocationCheckByAddress([{uri: 'pc-desktop:7203', rpc: 'pc-desktop:7303'}]);
392
+
393
+ // When I add node
394
+ ClusterNodesConfigurationSteps.clickAddNodeButton();
395
+ // Then I should see the edit node row
396
+ ClusterNodesConfigurationSteps.getEditNodeRow().should('be.visible');
397
+ // When I enter a new endpoint
398
+ ClusterNodesConfigurationSteps.enterNodeEndpoint('http://pc-desktop:7203');
399
+ // And I save the node
400
+ RemoteLocationStubs.stubAddRemoteLocation();
401
+ ClusterNodesConfigurationSteps.clickSaveNodeButton();
402
+ // Then I should see the new node in the list
403
+ ClusterNodesConfigurationSteps.getNodeByEndpoint('http://pc-desktop:7203').should('exist');
404
+
405
+
406
+ //And when I confirm changes
407
+ ClusterStubs.stubCreateClusterByList(['http://pc-desktop:7200', 'http://pc-desktop:7203']);
408
+ ClusterNodesConfigurationSteps.clickOkButton();
409
+ cy.wait('@2-nodes-cluster-created').then((interception) => {
410
+ console.log(interception.request.body);
411
+ expect(interception.request.body).to.deep.equal({
412
+ "electionMinTimeout": 8000,
413
+ "electionRangeTimeout": 6000,
414
+ "heartbeatInterval": 2000,
415
+ "messageSizeKB": 64,
416
+ "verificationTimeout": 1500,
417
+ "transactionLogMaximumSizeGB": 50.0,
418
+ "batchUpdateInterval": 5000,
419
+ "nodes": ['http://pc-desktop:7200', 'http://pc-desktop:7203']
420
+ });
421
+ });
422
+ // And expect success message to be displayed.
423
+ ApplicationSteps.getSuccessNotifications().contains('Cluster created successfully');
424
+ });
425
+ });
@@ -74,6 +74,10 @@ describe('Graphs overview screen validation', () => {
74
74
  });
75
75
 
76
76
  it('Should switch pages', () => {
77
+ // Makes this less flaky - is it possible the page elements don't have an event attached
78
+ // yet when this fails? It looks like the click has never happened
79
+ cy.wait(100);
80
+
77
81
  // Switch through pages and verify that the respective pager button is active.
78
82
  selectPage(2).should('contain', '2')
79
83
  .closest('li').should('have.class', 'active');