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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "2.7.6",
3
+ "version": "2.8.0-RC1",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "scripts": {
6
6
  "prepack": "npm shrinkwrap",
@@ -10,7 +10,7 @@
10
10
  "test": "cypress run",
11
11
  "test:flaky": "cypress run --config-file cypress-flaky.config.js",
12
12
  "test:partial": "cypress run --spec \"integration/repository/**\"",
13
- "test:core": "cypress run --spec integration/repository/**,integration/import/**,integration/sparql-editor/**,integration/monitor/**,integration/cluster/**"
13
+ "test:core": "cypress run --spec integration/repository/**,integration/import/**,integration/sparql-editor/**,integration/monitor/**,integration/cluster/**,integration/ttyg/**"
14
14
  },
15
15
  "author": {
16
16
  "name": "\"Sirma AI\" JSC, trading as Ontotext",
@@ -25,16 +25,15 @@
25
25
  "type": "git",
26
26
  "url": "git+https://github.com/Ontotext-AD/graphdb-workbench.git"
27
27
  },
28
- "dependencies": {},
29
28
  "devDependencies": {
30
29
  "cypress": "^13.3.1",
31
30
  "cypress-failed-log": "^2.10.0",
32
31
  "cypress-file-upload": "^5.0.8",
33
- "cypress-localstorage-commands": "^1.4.4",
32
+ "cypress-localstorage-commands": "^2.2.6",
34
33
  "cypress-multi-reporters": "^1.6.3",
35
34
  "cypress-real-events": "^1.8.1",
36
- "cypress-terminal-report": "^5.2.0",
37
- "cypress-wait-until": "^1.7.1",
35
+ "cypress-terminal-report": "^7.0.3",
36
+ "cypress-wait-until": "^3.0.2",
38
37
  "del": "^6.1.1",
39
38
  "minimist": "^1.2.5",
40
39
  "mocha-junit-reporter": "^2.2.0"
@@ -0,0 +1,25 @@
1
+ export class AlertDialogSteps {
2
+ static getDialog(cssClass = '.modal-alert') {
3
+ return cy.get(cssClass);
4
+ }
5
+
6
+ static getDialogHeader() {
7
+ return AlertDialogSteps.getDialog().find('.modal-header');
8
+ }
9
+
10
+ static getCloseButton() {
11
+ return AlertDialogSteps.getDialogHeader().find('.close');
12
+ }
13
+
14
+ static closeAlert() {
15
+ AlertDialogSteps.getCloseButton().click();
16
+ }
17
+
18
+ static acceptAlert() {
19
+ AlertDialogSteps.getDialog().find('.modal-footer button').click();
20
+ }
21
+
22
+ static getDialogBody() {
23
+ return AlertDialogSteps.getDialog().find('.modal-body');
24
+ }
25
+ }
@@ -66,4 +66,12 @@ export class ClusterPageSteps {
66
66
  static getLegendLinkStates() {
67
67
  return this.getLegend().find('.link-state');
68
68
  }
69
+
70
+ static getUpdateClusterButton() {
71
+ return cy.get('.edit-cluster-nodes-modal-btn');
72
+ }
73
+
74
+ static updateCluster() {
75
+ this.getUpdateClusterButton().click();
76
+ }
69
77
  }
@@ -0,0 +1,107 @@
1
+ export class ClusterNodesConfigurationSteps {
2
+
3
+ static getClusterNodesConfigurationModal() {
4
+ return cy.get('cluster-nodes-configuration');
5
+ }
6
+
7
+ static clickAddNodeButton() {
8
+ return this.getAddNodeButton().click();
9
+ }
10
+
11
+ static getAddNodeButton() {
12
+ return this.getClusterNodesConfigurationModal().find('.add-node-btn');
13
+ }
14
+
15
+ static getAdvancedOptions() {
16
+ return this.getClusterNodesConfigurationModal().find('.advanced-options-btn');
17
+ }
18
+
19
+ static getSaveAlert() {
20
+ return cy.get('.alert-warning');
21
+ }
22
+
23
+ static getNodes() {
24
+ return cy.get('.cluster-group tbody tr.node');
25
+ }
26
+
27
+ static getNodeByIndex(index) {
28
+ return ClusterNodesConfigurationSteps.getNodes().eq(index);
29
+ }
30
+
31
+ static getNodeByEndpoint(endpoint) {
32
+ return ClusterNodesConfigurationSteps.getNodes().filter(`[data-endpoint="${endpoint}"]`);
33
+ }
34
+
35
+ static getNodeLocationByEndpoint(endpoint) {
36
+ return ClusterNodesConfigurationSteps.getNodeByEndpoint(endpoint).find('.location-cell');
37
+ }
38
+
39
+ static getNodeIndexByEndpoint(endpoint) {
40
+ return ClusterNodesConfigurationSteps.getNodeByEndpoint(endpoint).find('.index-cell');
41
+ }
42
+
43
+ static getNodeStatusByEndpoint(endpoint) {
44
+ return ClusterNodesConfigurationSteps.getNodeByEndpoint(endpoint).find('.status-cell').invoke('text').then((text) => text.trim());
45
+ }
46
+
47
+ static clickDeleteNodeButtonByEndpoint(endpoint) {
48
+ ClusterNodesConfigurationSteps.getNodeByEndpoint(endpoint)
49
+ .find('.delete-node-btn')
50
+ .click({force:true});
51
+ }
52
+
53
+ static clickReplaceNodeButtonByEndpoint(endpoint) {
54
+ ClusterNodesConfigurationSteps.getNodeByEndpoint(endpoint)
55
+ .find('.replace-node-btn')
56
+ .click();
57
+ }
58
+
59
+ static enterNodeEndpoint(endpoint) {
60
+ cy.get('.edit-node-row .location-cell textarea[name="location"]')
61
+ .clear()
62
+ .type(endpoint);
63
+ }
64
+
65
+ static clickSaveNodeButton() {
66
+ cy.get('.save-rule-btn').click();
67
+ }
68
+
69
+ static clickCancelNodeButton() {
70
+ cy.get('.edit-node-row .cancel-node-replace-btn').click();
71
+ }
72
+
73
+ static getEditNodeErrorMessages() {
74
+ return cy.get('.edit-node-row .error-message');
75
+ }
76
+
77
+ static getSuggestionsDropdown() {
78
+ return cy.get('.edit-node-row .autocomplete-dropdown');
79
+ }
80
+
81
+ static isDeleteNodeButtonEnabledByEndpoint(endpoint) {
82
+ return ClusterNodesConfigurationSteps.getNodeByEndpoint(endpoint)
83
+ .find('.delete-node-btn')
84
+ .then((button) => !button.is(':disabled'));
85
+ }
86
+
87
+ static getEditNodeRow() {
88
+ return cy.get('.cluster-group tbody tr.edit-node-row');
89
+ }
90
+
91
+ static getOkButton() {
92
+ return cy.get('#wb-edit-cluster-nodes-modal-submit');
93
+ }
94
+
95
+ static clickOkButton() {
96
+ return this.getOkButton().click();
97
+ }
98
+
99
+ static getAddNodeRow() {
100
+ return cy.get('.cluster-group tbody tr.add-node-row');
101
+ }
102
+ static enterNewNodeEndpoint(endpoint) {
103
+ return this.getAddNodeButton().find('textarea[name="location"]')
104
+ .clear()
105
+ .type(endpoint);
106
+ }
107
+ }
@@ -36,7 +36,7 @@ class HomeSteps {
36
36
  cy.get('.tutorial-container .decline-tutorial').click();
37
37
  }
38
38
 
39
- static selectSPARQLQueryToExecute(query) {
39
+ static selectSPARQLQueryToExecute(query) {
40
40
  cy.contains('ul.saved-queries li', query)
41
41
  .should('be.visible')
42
42
  .trigger('hover')
@@ -59,7 +59,7 @@ class HomeSteps {
59
59
  }
60
60
 
61
61
  static createRepo() {
62
- let repositoryId = 'home-repository-' + Date.now();
62
+ const repositoryId = 'home-repository-' + Date.now();
63
63
  cy.createRepository({id: repositoryId});
64
64
  return repositoryId;
65
65
  }
@@ -108,7 +108,7 @@ class HomeSteps {
108
108
  }
109
109
 
110
110
  static getAutocompleteInput() {
111
- let input = cy.get('.home-rdf-resource-search search-resource-input .view-res-input');
111
+ const input = cy.get('.home-rdf-resource-search search-resource-input .view-res-input');
112
112
  input.should('be.visible');
113
113
  return input;
114
114
  }
@@ -123,7 +123,7 @@ class HomeSteps {
123
123
  }
124
124
 
125
125
  static getAutocompleteResultElement(uri) {
126
- let element = cy.get("#auto-complete-results-wrapper p").contains(uri);
126
+ const element = cy.get("#auto-complete-results-wrapper p").contains(uri);
127
127
  element.trigger('mouseover');
128
128
  return element;
129
129
  }
@@ -158,7 +158,7 @@ class HomeSteps {
158
158
  static doNotOpenRdfSearchBoxButFocusResourceSearch() {
159
159
  cy.get('.search-rdf-btn').click();
160
160
  cy.get('.search-rdf-input').should('not.exist');
161
- cy.get('.search-rdf-input search-resource-input .view-res-input').should('not.exist')
161
+ cy.get('.search-rdf-input search-resource-input .view-res-input').should('not.exist');
162
162
  cy.get('#search-resource-input-home > #search-resource-box > input').should('be.visible')
163
163
  .and('be.focused');
164
164
  }
@@ -179,5 +179,48 @@ class HomeSteps {
179
179
  return cy.get('#license-label-home');
180
180
  }
181
181
 
182
+ static getCookieConsentPopup() {
183
+ return cy.get('.cookie-consent-modal');
184
+ }
185
+
186
+ static getAgreeButton() {
187
+ return HomeSteps.getCookieConsentPopup().find('button');
188
+ }
189
+
190
+ static clickAgreeButton() {
191
+ return HomeSteps.getAgreeButton().click();
192
+ }
193
+
194
+ static getCookiePolicyLink() {
195
+ return cy.get('.cookie-consent-content a');
196
+ }
197
+
198
+ static clickCookiePolicyLink() {
199
+ return HomeSteps.getCookiePolicyLink().click();
200
+ }
201
+
202
+ static getCookiePolicyModal() {
203
+ return cy.get('.cookie-policy-modal');
204
+ }
205
+
206
+ static getHelpMenu() {
207
+ return cy.get('.main-menu .menu-element-root').eq(7);
208
+ }
209
+
210
+ static clickHelpMenu() {
211
+ return HomeSteps.getHelpMenu().click();
212
+ }
213
+
214
+ static getDocumentationLink() {
215
+ return cy.get('[guide-selector="sub-menu-documentation"]');
216
+ }
217
+
218
+ static getTutorialsLink() {
219
+ return cy.get('[guide-selector="sub-menu-developer-hub"]');
220
+ }
221
+
222
+ static getSupportLink() {
223
+ return cy.get('[guide-selector="sub-menu-support"]');
224
+ }
182
225
  }
183
226
  export default HomeSteps;
@@ -34,13 +34,17 @@ class ImportSteps {
34
34
  }
35
35
 
36
36
  static showPageInfoPopover() {
37
- this.getPageInfoIcon().realHover();
37
+ return this.getPageInfoIcon().realHover();
38
38
  }
39
39
 
40
40
  static getPageInfoPopover() {
41
41
  return cy.get('.help-info');
42
42
  }
43
43
 
44
+ static hidePageInfoPopover() {
45
+ return cy.get('.menu-element-root').realHover();
46
+ }
47
+
44
48
  static visitUserImport(repository) {
45
49
  this.visitImport('user', repository);
46
50
  }
@@ -139,10 +143,6 @@ class ImportSteps {
139
143
  return this.getImportUserDataHelp().find('.copy-btn').click();
140
144
  }
141
145
 
142
- static getClipboardTextContent() {
143
- return cy.window().its('navigator.clipboard').invoke('readText').then((text) => text);
144
- }
145
-
146
146
  static toggleHelpMessage() {
147
147
  // For some reason the page info box opens unexpectedly and covers the help info icon.
148
148
  this.getView().find('.toggle-help-btn').click({force: true});
@@ -296,7 +296,7 @@ class ImportSteps {
296
296
  }
297
297
 
298
298
  static selectFile(files) {
299
- cy.get('input[type=file]').selectFile(files, {force: true});
299
+ cy.get('#wb-import-uploadFile label').selectFile(files);
300
300
  }
301
301
 
302
302
  static uploadFile(filePath) {
@@ -402,16 +402,16 @@ class ImportSteps {
402
402
  }
403
403
 
404
404
  static verifyImportStatusDetails(fileToSelect, details) {
405
- this.getServerFileElement(fileToSelect).find('.import-status .import-status-info').then(infoIconEl => {
405
+ this.getServerFileElement(fileToSelect).find('.import-status .import-status-info').then((infoIconEl) => {
406
406
  cy.wrap(infoIconEl).should('be.visible');
407
407
  cy.wrap(infoIconEl).trigger('mouseenter');
408
408
 
409
- cy.get('.popover-content').then(content => {
409
+ cy.get('.popover-content').then((content) => {
410
410
  cy.wrap(content).should('be.visible');
411
411
  if (details instanceof Array) {
412
- details.forEach(text => {
412
+ details.forEach((text) => {
413
413
  cy.wrap(content).should('contain', text);
414
- })
414
+ });
415
415
  } else {
416
416
  cy.wrap(content).should('contain', details);
417
417
  }
@@ -430,7 +430,7 @@ class ImportSteps {
430
430
  this
431
431
  .getServerFileElement(filename)
432
432
  .find('.import-status .import-status-message')
433
- .then(status => status && status.text().indexOf(message) > -1));
433
+ .then((status) => status && status.text().indexOf(message) > -1));
434
434
 
435
435
  return this;
436
436
  }
@@ -39,6 +39,10 @@ export class ModalDialogSteps {
39
39
  ModalDialogSteps.getConfirmButton().click();
40
40
  }
41
41
 
42
+ static confirm() {
43
+ ModalDialogSteps.getConfirmButton().click();
44
+ }
45
+
42
46
  static getCancelButton() {
43
47
  return ModalDialogSteps.getDialogFooter().find('.cancel-btn');
44
48
  }
@@ -47,6 +51,10 @@ export class ModalDialogSteps {
47
51
  ModalDialogSteps.getCancelButton().click();
48
52
  }
49
53
 
54
+ static cancel() {
55
+ ModalDialogSteps.getCancelButton().click();
56
+ }
57
+
50
58
  static verifyUrlChangedConfirmation(verifyConfirmationDialogOptions = new VerifyConfirmationDialogOptions()) {
51
59
  // and try to change the page
52
60
  verifyConfirmationDialogOptions.changePageFunction();
@@ -79,6 +79,10 @@ export class OntopRepositorySteps {
79
79
  return cy.get('#driverClass');
80
80
  }
81
81
 
82
+ static typeDriverClass(driverClass) {
83
+ OntopRepositorySteps.getDriverClassInput().type(driverClass);
84
+ }
85
+
82
86
  static getUrlInput() {
83
87
  return cy.get('#url');
84
88
  }
@@ -87,15 +91,37 @@ export class OntopRepositorySteps {
87
91
  return cy.get('#hostName');
88
92
  }
89
93
 
94
+ static typeHostName(host) {
95
+ OntopRepositorySteps.getHostNameInput().type(host);
96
+ }
97
+
90
98
  static getPortInput() {
91
99
  return cy.get('#port');
92
100
  }
93
101
 
102
+ static typePort(port) {
103
+ OntopRepositorySteps.getPortInput().type(port);
104
+ }
105
+
94
106
  static getDatabaseNameInput() {
95
107
  return cy.get('#databaseName');
96
108
  }
97
109
 
110
+ static typeDatabaseName(database) {
111
+ OntopRepositorySteps.getDatabaseNameInput().type(database);
112
+ }
113
+
98
114
  static getTestConnectionButton() {
99
115
  return cy.get('#testConnection');
100
116
  }
117
+
118
+ static clickObdaFileUploadButton() {
119
+ OntopRepositorySteps.getOBDAUploadButton().click();
120
+ }
121
+
122
+ static uploadObdaFile(file) {
123
+ // The label for the input has visibility: hidden, so force must be used
124
+ // eq() index 0 for location of OBDA field input
125
+ cy.get('input[type=file]').eq(0).selectFile(file, {force: true});
126
+ }
101
127
  }
@@ -0,0 +1,118 @@
1
+ export class AttachRepositorySteps {
2
+
3
+ static getAttachRemoteLocationBtn() {
4
+ return cy.get('#addAttachRemoteLocation');
5
+ }
6
+
7
+ static openAttachRemoteLocationDialog() {
8
+ AttachRepositorySteps.getAttachRemoteLocationBtn().click();
9
+ }
10
+
11
+ static getAttachBtn() {
12
+ return cy.get('.attach-location');
13
+ }
14
+
15
+ static attachRemoteLocation() {
16
+ AttachRepositorySteps.getAttachBtn().click();
17
+ }
18
+
19
+ static getCancelBtn() {
20
+ return cy.get('.cancel-attaching-location');
21
+ }
22
+
23
+ static cancelAttaching() {
24
+ AttachRepositorySteps.getCancelBtn().click();
25
+ }
26
+
27
+ static saveRemoteLocation() {
28
+ AttachRepositorySteps.getAttachBtn().click();
29
+ }
30
+
31
+ static getRemoteLocationDialog() {
32
+ return cy.get('#remoteLocationForm');
33
+ }
34
+
35
+ static getAuthenticationRadioBtn() {
36
+ return AttachRepositorySteps.getRemoteLocationDialog().find('.none-authentication');
37
+ }
38
+
39
+ static selectAuthenticationRadioBtn() {
40
+ AttachRepositorySteps.getAuthenticationRadioBtn().check();
41
+ }
42
+
43
+ static getBasicRadioBtn() {
44
+ return AttachRepositorySteps.getRemoteLocationDialog().find('.basic-authentication');
45
+ }
46
+
47
+ static selectBasicRadioBtn() {
48
+ AttachRepositorySteps.getBasicRadioBtn().check();
49
+ }
50
+
51
+ static getSignatureRadioBtn() {
52
+ return AttachRepositorySteps.getRemoteLocationDialog().find('.signature-authentication');
53
+ }
54
+
55
+ static selectSignatureRadioBtn() {
56
+ AttachRepositorySteps.getSignatureRadioBtn().check();
57
+ }
58
+
59
+ static getGraphDBRadioBtn() {
60
+ return AttachRepositorySteps.getRemoteLocationDialog().find('.graph-db-instance');
61
+ }
62
+
63
+ static selectGraphDBRadioBtn() {
64
+ AttachRepositorySteps.getGraphDBRadioBtn().check();
65
+ }
66
+
67
+ static getOntopicRadioBtn() {
68
+ return AttachRepositorySteps.getRemoteLocationDialog().find('.ontopic-instance');
69
+ }
70
+
71
+ static getSparqlEndpointRadioBtn() {
72
+ return AttachRepositorySteps.getRemoteLocationDialog().find('.graph-sparql-instance');
73
+ }
74
+
75
+ static selectOntopicRadioBtn() {
76
+ AttachRepositorySteps.getOntopicRadioBtn().check();
77
+ }
78
+
79
+ static selectSparqlEndpointRadioBtn() {
80
+ AttachRepositorySteps.getSparqlEndpointRadioBtn().check();
81
+ }
82
+
83
+ static getLocationURLInput() {
84
+ return AttachRepositorySteps.getRemoteLocationDialog().get('#location');
85
+ }
86
+
87
+ static clearURL() {
88
+ AttachRepositorySteps.getLocationURLInput().clear();
89
+ }
90
+
91
+ static enterURL(url) {
92
+ AttachRepositorySteps.getLocationURLInput().click().type(url);
93
+ }
94
+
95
+ static getUsernameInput() {
96
+ return AttachRepositorySteps.getRemoteLocationDialog().get('#username');
97
+ }
98
+
99
+ static enterUsername(text) {
100
+ AttachRepositorySteps.getUsernameInput().type(text);
101
+ }
102
+
103
+ static clearUsername() {
104
+ AttachRepositorySteps.getUsernameInput().clear();
105
+ }
106
+
107
+ static getPasswordInput() {
108
+ return AttachRepositorySteps.getRemoteLocationDialog().get('#password');
109
+ }
110
+
111
+ static enterPassword(text) {
112
+ AttachRepositorySteps.getPasswordInput().type(text);
113
+ }
114
+
115
+ static clearPassword() {
116
+ AttachRepositorySteps.getPasswordInput().clear();
117
+ }
118
+ }
@@ -3,7 +3,7 @@ import {REPOSITORIES_URL} from "../support/repository-commands";
3
3
  export class RepositorySteps {
4
4
 
5
5
  static visit() {
6
- cy.intercept('/rest/locations?filterClusterLocations=true').as('getLocations');
6
+ cy.intercept('/rest/locations').as('getLocations');
7
7
  cy.intercept(REPOSITORIES_URL + 'all').as('getRepositories');
8
8
  cy.visit('/repository');
9
9
  RepositorySteps.waitLoader();
@@ -55,6 +55,10 @@ export class RepositorySteps {
55
55
  return RepositorySteps.getRepositoryFromList(id).find('.icon-connection-off');
56
56
  }
57
57
 
58
+ static clickRepositoryConnectionOffBtn(id) {
59
+ RepositorySteps.getRepositoryConnectionOffBtn(id).click();
60
+ }
61
+
58
62
  static getRepositoryConnectionOnBtn(id) {
59
63
  return RepositorySteps.getRepositoryFromList(id).find('.icon-connection-on');
60
64
  }
@@ -121,6 +125,22 @@ export class RepositorySteps {
121
125
  return cy.get('.ot-edit-input');
122
126
  }
123
127
 
128
+ static getUsernameFieldEditRepo() {
129
+ return cy.get('.form-group #username');
130
+ }
131
+
132
+ static typeUsernameInEditRepo(username) {
133
+ this.getUsernameFieldEditRepo().type(username);
134
+ }
135
+
136
+ static clickSaveEditedRepo() {
137
+ cy.get('#addEditOntopRepository').click();
138
+ }
139
+
140
+ static typeURL(url) {
141
+ cy.get('#url').type(url);
142
+ }
143
+
124
144
  static editRepositoryId() {
125
145
  this.getRepositoryIdEditElement().click();
126
146
  }
@@ -207,26 +227,44 @@ export class RepositorySteps {
207
227
  .and('contain', 'Local');
208
228
  }
209
229
 
210
- static getOntopicTable() {
211
- return cy.get('#wb-repositories-ontopic-repositoryInGetRepositories');
230
+ static getSparqlOntopicTable() {
231
+ return cy.get('#wb-repositories-ontopic-sparql-repositoryInGetRepositories');
212
232
  }
213
233
 
214
234
  static getDeleteOntopicInstanceBtn(url) {
215
- return RepositorySteps.getOntopicTable().find('tr').contains(url).parent().find('.delete-ontopic-location');
235
+ return RepositorySteps.getSparqlOntopicTable().find('tr').contains(url).parent().parent().find('.delete-ontopic-location');
216
236
  }
217
237
 
218
238
  static deleteOntopicInstance(url) {
219
239
  RepositorySteps.getDeleteOntopicInstanceBtn(url).click();
220
240
  }
221
241
 
242
+ static getDeleteSparqlInstanceBtn(url) {
243
+ return RepositorySteps.getSparqlOntopicTable().find('tr').contains(url).parent().parent().find('.delete-sparql-location');
244
+ }
245
+
246
+ static deleteSparqlLocation(url) {
247
+ RepositorySteps.getDeleteSparqlInstanceBtn(url).click();
248
+ }
249
+
222
250
  static getEditOntopicInstanceBtn(url) {
223
- return RepositorySteps.getOntopicTable().find('tr').contains(url).parent().find('.edit-ontopic-location');
251
+ return RepositorySteps.getSparqlOntopicTable().find('tr').contains(url).parent().parent().find('.edit-ontopic-location');
224
252
  }
225
253
 
226
254
  static editOntopicInstance(url) {
227
255
  RepositorySteps.getEditOntopicInstanceBtn(url).click();
228
256
  }
229
257
 
258
+ static getEditSparqlInstanceBtn(row) {
259
+ return cy.get('#wb-repositories-ontopic-sparql-repositoryInGetRepositories tbody tr')
260
+ .eq(row)
261
+ .find('.edit-sparql-location');
262
+ }
263
+
264
+ static editSparqlInstance(row) {
265
+ RepositorySteps.getEditSparqlInstanceBtn(row).click();
266
+ }
267
+
230
268
  static getRemoteGraphDBTable() {
231
269
  return cy.get('#wb-locations-locationInGetRemoteLocations');
232
270
  }
@@ -242,4 +280,14 @@ export class RepositorySteps {
242
280
  static uploadRulesetFile(file) {
243
281
  cy.get('input[type=file]').eq(1).selectFile(file, {force: true});
244
282
  }
283
+
284
+ static getRepoIcon(type) {
285
+ return this.getLocalGraphDBTable().get(`.lead .icon-repo-${type}`);
286
+ }
287
+
288
+ static assertRepositoryStatus(repositoryId, status) {
289
+ RepositorySteps.getRepositoryFromList(repositoryId).as('repo');
290
+ cy.get('@repo').should('be.visible');
291
+ cy.get('@repo').find('.repository-status .text-secondary').contains(status);
292
+ }
245
293
  }
@@ -0,0 +1,17 @@
1
+ export class SettingsSteps {
2
+ static visit() {
3
+ cy.visit('/settings');
4
+ }
5
+
6
+ static getCookiePolicyLink() {
7
+ return cy.get('.cookie-policy-link a');
8
+ }
9
+
10
+ static clickCookiePolicyLink() {
11
+ return SettingsSteps.getCookiePolicyLink().click();
12
+ }
13
+
14
+ static getCookiePolicyModal() {
15
+ return cy.get('.cookie-policy-modal');
16
+ }
17
+ }