graphdb-workbench-tests 2.8.4 → 3.0.0-NEW-JENKINS-1

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 (76) hide show
  1. package/fixtures/graph/rdf.txt +130 -0
  2. package/fixtures/graphdb-import/ontology-and-shapes.ttl +562 -0
  3. package/fixtures/graphdb-import/swapi-dataset.ttl +4393 -0
  4. package/fixtures/graphql/endpoints/graphql-endpoints-info.json +49 -0
  5. package/fixtures/graphql/endpoints/no-graphql-endpoints-info.json +3 -0
  6. package/fixtures/graphql/soml/big-swapi-schema-broken.yaml +83167 -0
  7. package/fixtures/graphql/soml/swapi-schema-broken.yaml +880 -0
  8. package/fixtures/graphql/soml/swapi-schema-broken.zip +0 -0
  9. package/fixtures/graphql/soml/swapi-schema-film-restricted.yaml +335 -0
  10. package/fixtures/graphql/soml/swapi-schema-planets.yaml +51 -0
  11. package/fixtures/graphql/soml/swapi-schema-species.yaml +66 -0
  12. package/fixtures/graphql/soml/swapi-schema.yaml +857 -0
  13. package/fixtures/graphql/soml/swapi-schemas.zip +0 -0
  14. package/fixtures/locale-en.json +666 -37
  15. package/fixtures/ttyg/agent/get-agent-list-autocomplete-query.json +23 -0
  16. package/fixtures/ttyg/autocomplete-response.json +154 -0
  17. package/integration/explore/class.hierarchy.spec.js +131 -184
  18. package/integration/explore/graphs.overview.spec.js +18 -10
  19. package/integration/explore/visual-graph/graphs-config.spec.js +17 -1
  20. package/integration/explore/visual-graph/visual-graph-node-labels.spec.js +68 -0
  21. package/integration/graphql/activate-deactivate-graphql-endpoint.spec.js +40 -0
  22. package/integration/graphql/create-graphql-endpoint.spec.js +281 -0
  23. package/integration/graphql/delete-graphql-endpoint.spec.js +46 -0
  24. package/integration/graphql/edit-graphql-enpoint.spec.js +160 -0
  25. package/integration/graphql/export-graphql-endpoint-definition.spec.js +35 -0
  26. package/integration/graphql/filter-graphql-endpoints-on-management-view.spec.js +66 -0
  27. package/integration/graphql/graphql-endpoint-management-view.spec.js +142 -0
  28. package/integration/graphql/graphql-playground.spec.js +110 -0
  29. package/integration/graphql/import-graphql-endpoint-definitions.spec.js +269 -0
  30. package/integration/graphql/set-default-graphql-endpoint.spec.js +42 -0
  31. package/integration/import/import-server-files-batch-operations.spec.js +4 -3
  32. package/integration/import/import-server-files.spec.js +29 -7
  33. package/integration/import/import-user-data-url.spec.js +33 -0
  34. package/integration/import/import-view.spec.js +2 -1
  35. package/integration/repository/repositories.spec.js +9 -4
  36. package/integration/setup/user-and-access.spec.js +695 -117
  37. package/integration/sparql-editor/actions/show-saved-queries.spec.js +1 -1
  38. package/integration/sparql-editor/saved-query/readonly-query.spec.js +66 -0
  39. package/integration/ttyg/edit-agent.spec.js +45 -0
  40. package/integration-flaky/setup/users-and-access/security-and-free-access.spec.js +54 -0
  41. package/{integration → integration-flaky}/ttyg/ttyg-permission.spec.js +4 -3
  42. package/npm-shrinkwrap.json +931 -305
  43. package/package.json +3 -3
  44. package/steps/class-views-steps.js +139 -0
  45. package/steps/explore/graphs-overview-steps.js +12 -0
  46. package/steps/graphql/create-graphql-endpoint-steps.js +277 -0
  47. package/steps/graphql/edit-graphql-endpoint-steps.js +124 -0
  48. package/steps/graphql/generation-report-modal-steps.js +34 -0
  49. package/steps/graphql/graphiql-editor-tools-steps.js +10 -0
  50. package/steps/graphql/graphiql-playground-steps.js +6 -0
  51. package/steps/graphql/graphql-endpoint-management-steps.js +147 -0
  52. package/steps/graphql/graphql-playground-steps.js +90 -0
  53. package/steps/graphql/import-endpoint-definition-modal-steps.js +80 -0
  54. package/steps/home-steps.js +1 -1
  55. package/steps/import/import-settings-dialog-steps.js +12 -0
  56. package/steps/import/import-steps.js +9 -4
  57. package/steps/import/import-test-constants.js +1 -0
  58. package/steps/import/import-user-data-steps.js +8 -0
  59. package/steps/login-steps.js +20 -0
  60. package/steps/modal-dialog-steps.js +8 -0
  61. package/steps/repository-steps.js +4 -0
  62. package/steps/setup/user-and-access-steps.js +165 -11
  63. package/steps/ttyg/ttyg-agent-settings-modal.steps.js +44 -0
  64. package/steps/visual-graph-steps.js +14 -0
  65. package/steps/yasgui/saved-queries-dialog.js +19 -3
  66. package/stubs/global-operations-statuses-stub.js +2 -2
  67. package/stubs/graphql/graphql-stubs.js +146 -0
  68. package/stubs/repositories/repositories-stubs.js +4 -0
  69. package/stubs/ttyg/ttyg-stubs.js +7 -0
  70. package/stubs/yasgui/query-stubs.js +2 -2
  71. package/support/import-commands.js +28 -0
  72. package/support/repository-commands.js +10 -3
  73. package/support/security-command.js +49 -8
  74. package/support/user-commands.js +10 -2
  75. package/utils/html-util.js +21 -0
  76. /package/fixtures/{graphql-editor → queries}/default-query-response.json +0 -0
@@ -0,0 +1,147 @@
1
+ const VIEW_URL = '/graphql/endpoints';
2
+
3
+ export class GraphqlEndpointManagementSteps {
4
+
5
+ static visit() {
6
+ return cy.visit(VIEW_URL);
7
+ }
8
+
9
+ static getView() {
10
+ return cy.get('.graphql-endpoint-management-view');
11
+ }
12
+
13
+ static getEndpointFilterField() {
14
+ return this.getView().find('.endpoints-filter-field');
15
+ }
16
+
17
+ static getCreateEndpointButton() {
18
+ return this.getView().find('.create-endpoint-btn');
19
+ }
20
+
21
+ static getImportEndpointSchemaDefinitionButton() {
22
+ return this.getView().find('.import-schema-definition-btn');
23
+ }
24
+
25
+ static openImportModal() {
26
+ this.getImportEndpointSchemaDefinitionButton().click();
27
+ }
28
+
29
+ static getEndpointTable() {
30
+ return this.getView().find('.endpoints-info-table');
31
+ }
32
+
33
+ static getNoResultsRow() {
34
+ return this.getEndpointTable().find('tbody tr.no-results');
35
+ }
36
+
37
+ static getEndpointsInfo() {
38
+ return this.getEndpointTable().find('tbody tr');
39
+ }
40
+
41
+ static getEndpointLink(index) {
42
+ return this.getEndpointsInfo().eq(index).find('.endpoint-link');
43
+ }
44
+
45
+ static exploreEndpoint(index) {
46
+ this.getEndpointLink(index).click();
47
+ }
48
+
49
+ static toggleEndpointRow(index) {
50
+ return this.getEndpointsInfo().eq(index).find('.toggle-row a').click();
51
+ }
52
+
53
+ static openActionsMenu(index) {
54
+ this.getEndpointsInfo().eq(index).find('.open-endpoint-actions-btn').click();
55
+ }
56
+
57
+ static deleteEndpoint(index) {
58
+ this.openActionsMenu(index);
59
+ this.getEndpointsInfo().eq(index).find('.delete-endpoint-btn').click();
60
+ }
61
+
62
+ static exportEndpointDefinition(index) {
63
+ this.openActionsMenu(index);
64
+ this.getEndpointsInfo().eq(index).find('.export-schema-btn').click();
65
+ }
66
+
67
+ static filterEndpoints(term) {
68
+ this.getEndpointFilterField().type(term);
69
+ }
70
+
71
+ static clearFilter() {
72
+ this.getEndpointFilterField().clear();
73
+ }
74
+
75
+ static getNoResultsInTableBanner() {
76
+ return this.getEndpointTable().find('.no-results');
77
+ }
78
+
79
+ static getNoEndpointsInRepositoryBanner() {
80
+ return this.getView().find('.no-endpoints');
81
+ }
82
+
83
+ static createEndpoint() {
84
+ this.getView().find('.create-endpoint-btn').click();
85
+ }
86
+
87
+ static verifyEndpointInfo(data) {
88
+ this.getEndpointsInfo().each(($row, index) => {
89
+ const endpointInfo = data[index];
90
+ cy.wrap($row).within(() => {
91
+ const statusCheck = endpointInfo.status === 'deleted' ? 'not.exist' : 'be.visible';
92
+ cy.get('td').eq(1).find('.endpoint-link').should(statusCheck);
93
+ cy.get('td').eq(2).should('contain', endpointInfo.id);
94
+ cy.get('td').eq(3).should('contain', endpointInfo.label);
95
+ const isDefaultCheck = endpointInfo.default ? 'be.checked' : 'not.be.checked'
96
+ cy.get('td').eq(4).find('.endpoint-default-state input[type="radio"]').should(isDefaultCheck);
97
+ const isActiveCheck = endpointInfo.active ? 'be.checked' : 'not.be.checked'
98
+ cy.get('td').eq(5).find('.toggle-active-state input[type="checkbox"]').should(isActiveCheck);
99
+ cy.get('td').eq(6).should('contain', endpointInfo.modified);
100
+ cy.get('td').eq(7).should('contain', endpointInfo.types);
101
+ cy.get('td').eq(8).should('contain', endpointInfo.properties);
102
+ cy.get('td').eq(9).find('button').should('have.length', 4);
103
+ });
104
+ // expand the row and check the description outside the wrapper
105
+ this.toggleEndpointRow(index).closest('tr').next('tr')
106
+ .find('.endpoint-description').should('contain', endpointInfo.description);
107
+ this.toggleEndpointRow(index);
108
+ });
109
+ }
110
+
111
+ static getEndpointInfo(index) {
112
+ return this.getEndpointsInfo().eq(index);
113
+ }
114
+
115
+ static getEndpointActionsButton(index) {
116
+ return this.getEndpointInfo(index).realHover().find('.open-endpoint-actions-btn');
117
+ }
118
+
119
+ static openEndpointActionMenu(index) {
120
+ return this.getEndpointActionsButton(index).click();
121
+ }
122
+
123
+ static editEndpointConfiguration(index) {
124
+ this.openEndpointActionMenu(index);
125
+ return cy.get('.configure-endpoint-btn').eq(index).click();
126
+ }
127
+
128
+ static getEndpointDefaultStatusRadio(index) {
129
+ return this.getEndpointInfo(index).find('.endpoint-default-state input[type="radio"]');
130
+ }
131
+
132
+ static setEndpointAsDefault(index) {
133
+ this.getEndpointDefaultStatusRadio(index).check();
134
+ }
135
+
136
+ static getEndpointActiveStateToggle(index) {
137
+ return this.getEndpointsInfo().eq(index).find('.toggle-active-state');
138
+ }
139
+
140
+ static getEndpointActiveStateToggleCheckbox(index) {
141
+ return this.getEndpointActiveStateToggle(index).find('input[type="checkbox"]');
142
+ }
143
+
144
+ static toggleEndpointActiveState(index) {
145
+ this.getEndpointActiveStateToggle(index).click();
146
+ }
147
+ }
@@ -0,0 +1,90 @@
1
+ const VIEW_URL = '/graphql/playground';
2
+
3
+ export class GraphqlPlaygroundSteps {
4
+
5
+ static visit() {
6
+ return cy.visit(VIEW_URL);
7
+ }
8
+
9
+ static getView() {
10
+ return cy.get('.graphql-playground-view');
11
+ }
12
+
13
+ static getNoSchemasAlert() {
14
+ return this.getView().find('.no-endpoints-view');
15
+ }
16
+
17
+ static getPlayground() {
18
+ return this.getView().find('.graphiql-query-editor textarea');
19
+ }
20
+
21
+ static getEndpointsSelectMenu() {
22
+ return this.getView().find('.graphql-endpoint-selector');
23
+ }
24
+
25
+ static getEndpointsSelectMenuOptions() {
26
+ return this.getEndpointsSelectMenu().find('option');
27
+ }
28
+
29
+ static getSelectedEndpoint() {
30
+ return this.getEndpointsSelectMenu().find('option:selected');
31
+ }
32
+
33
+ static selectEndpoint(endpoint) {
34
+ return this.getEndpointsSelectMenu().select(endpoint);
35
+ }
36
+
37
+ static getQueryEditor() {
38
+ return this.getView().find('.graphiql-query-editor textarea');
39
+ }
40
+
41
+ static setInEditor(text) {
42
+ return cy.window()
43
+ .then((win) => {
44
+ // @ts-ignore CodeMirror is undefined
45
+ const codeMirrorInstance = win.document.querySelector('.CodeMirror').CodeMirror;
46
+ codeMirrorInstance.setValue(text);
47
+ });
48
+ }
49
+
50
+ static clear() {
51
+ this.setInEditor('');
52
+ }
53
+
54
+ static getEditorContent() {
55
+ return cy.window().then((win) => {
56
+ // @ts-ignore CodeMirror is undefined
57
+ const codeMirrorInstance = win.document.querySelector('.CodeMirror').CodeMirror;
58
+ return codeMirrorInstance.getValue();
59
+ });
60
+ }
61
+
62
+ static getExecuteButton() {
63
+ return this.getView().find('.graphiql-execute-button');
64
+ }
65
+
66
+ static executeQuery(delay = 150) {
67
+ cy.wait(delay);
68
+ return this.getExecuteButton().click();
69
+ }
70
+
71
+ static getResponse() {
72
+ return this.getView().find('.graphiql-response');
73
+ }
74
+
75
+ static getAddTabButton() {
76
+ return cy.get('.graphiql-tab-add');
77
+ }
78
+
79
+ static addTab() {
80
+ this.getAddTabButton().click();
81
+ }
82
+
83
+ static getTabsContainer() {
84
+ return cy.get('.graphiql-tabs');
85
+ }
86
+
87
+ static getTabs() {
88
+ return this.getTabsContainer().find('.graphiql-tab');
89
+ }
90
+ }
@@ -0,0 +1,80 @@
1
+ import {ModalDialogSteps} from "../modal-dialog-steps";
2
+
3
+ export class ImportEndpointDefinitionModalSteps extends ModalDialogSteps {
4
+
5
+ static getFileselectorButton() {
6
+ return this.getDialogBody().find('.file-selector-btn');
7
+ }
8
+
9
+ static getUploadButton() {
10
+ return this.getDialogBody().find('.upload-btn');
11
+ }
12
+
13
+ static upload() {
14
+ this.getUploadButton().click();
15
+ }
16
+
17
+ static getAbortButton() {
18
+ return this.getDialogBody().find('.abort-upload-btn');
19
+ }
20
+
21
+ static selectFile(filePaths) {
22
+ if (Array.isArray(filePaths)) {
23
+ cy.get('input[type="file"]').attachFile(filePaths);
24
+ } else {
25
+ cy.get('input[type="file"]').attachFile(filePaths);
26
+ }
27
+ }
28
+
29
+ static getSelectedFiles() {
30
+ return this.getDialogBody().find('.file-list .file-item');
31
+ }
32
+
33
+ static getFileItem(index) {
34
+ return this.getSelectedFiles().eq(index);
35
+ }
36
+
37
+ static getSelectedFileName(index) {
38
+ return this.getFileItem(index).find('.file-name');
39
+ }
40
+
41
+ static getSelectedFileSize(index) {
42
+ return this.getFileItem(index).find('.file-size');
43
+ }
44
+
45
+ static getImportStatus(index) {
46
+ return this.getFileItem(index).find('.import-status .status');
47
+ }
48
+
49
+ static getGeneratedEndpointLink(index) {
50
+ return this.getFileItem(index).find('.endpoint-link');
51
+ }
52
+
53
+ static getReportLink(index) {
54
+ return this.getFileItem(index).find('.report-link');
55
+ }
56
+
57
+ static openReport(index) {
58
+ this.getReportLink(index).click();
59
+ }
60
+
61
+ static getRemoveSelectedFileButton(index) {
62
+ return this.getFileItem(index).find('.remove-file-btn');
63
+ }
64
+
65
+ static removeSelectedFile(index) {
66
+ this.getRemoveSelectedFileButton(index).click();
67
+ }
68
+
69
+ static getProgressBar() {
70
+ return this.getDialogBody().find('.progress-bar');
71
+ }
72
+
73
+ static getValidationErrors() {
74
+ return this.getDialogBody().find('.validation-errors');
75
+ }
76
+
77
+ static getValidationError(index) {
78
+ return this.getValidationErrors().find('.error').eq(index);
79
+ }
80
+ }
@@ -204,7 +204,7 @@ class HomeSteps {
204
204
  }
205
205
 
206
206
  static getHelpMenu() {
207
- return cy.get('.main-menu .menu-element-root').eq(7);
207
+ return cy.get('.main-menu .menu-element-root').eq(8);
208
208
  }
209
209
 
210
210
  static clickHelpMenu() {
@@ -68,6 +68,10 @@ export class ImportSettingsDialogSteps extends ModalDialogSteps {
68
68
  this.getSettingsForm().find('input[name="contextLink"]').type(contextLink).should('have.value', contextLink);
69
69
  }
70
70
 
71
+ static getJSONLDContextInput() {
72
+ return this.getSettingsForm().find('.contextLinkRow .form-control');
73
+ }
74
+
71
75
  static setContextLinkToBeVisible() {
72
76
  this.getSettingsForm().within(() => {
73
77
  cy.get('.contextLinkRow').invoke('attr', 'style', 'display: block !important');
@@ -77,4 +81,12 @@ export class ImportSettingsDialogSteps extends ModalDialogSteps {
77
81
  static getReplaceExistingDataCheckbox() {
78
82
  return this.getSettingsForm().find('input.existing-data-replacement');
79
83
  }
84
+
85
+ static getErrors() {
86
+ return cy.get('.alert-danger');
87
+ }
88
+
89
+ static getError(index = 0) {
90
+ return this.getErrors().eq(index);
91
+ }
80
92
  }
@@ -312,14 +312,19 @@ class ImportSteps {
312
312
  cy.get('#import-user .import-from-url-btn').click();
313
313
  // Forces the popover to disappear as it covers the modal and Cypress refuses to continue
314
314
  this.closePopover();
315
- this.getImportUrlInput().type(importURL).should('have.value', importURL);
316
- this.closePopover();
315
+ if (importURL) {
316
+ this.getImportUrlInput().type(importURL).should('have.value', importURL);
317
+ this.closePopover();
318
+ }
317
319
  return this;
318
320
  }
319
321
 
320
- static clickImportUrlButton() {
321
- cy.get('#wb-import-importUrl').click();
322
+ static getImportUrlButton() {
323
+ return cy.get('#wb-import-importUrl');
324
+ }
322
325
 
326
+ static clickImportUrlButton() {
327
+ this.getImportUrlButton().click();
323
328
  return this;
324
329
  }
325
330
 
@@ -0,0 +1 @@
1
+ export const SERVER_FILES_COUNT = 20;
@@ -44,6 +44,14 @@ export class ImportUserDataSteps extends ImportSteps {
44
44
  cy.intercept('POST', `/rest/repositories/${repositoryId}/import/upload/url`).as('postJsonldUrl');
45
45
  }
46
46
 
47
+ static getErrors() {
48
+ return cy.get('.text-danger');
49
+ }
50
+
51
+ static getError(index = 0) {
52
+ return this.getErrors().eq(index);
53
+ }
54
+
47
55
  // ==========================================================================
48
56
  // utilities from text snippet tests
49
57
  // ==========================================================================
@@ -0,0 +1,20 @@
1
+ export class LoginSteps {
2
+ static visitLoginPage() {
3
+ cy.visit('/login');
4
+ }
5
+
6
+ static loginWithUser(username, password) {
7
+ cy.get('#wb-login-username').type(username);
8
+ cy.get('#wb-login-password').type(password);
9
+ cy.get('#wb-login-submitLogin').click();
10
+ }
11
+
12
+ static logout() {
13
+ cy.get('#btnGroupDrop2').click();
14
+ cy.get('.dropdown-item')
15
+ .contains('Logout')
16
+ .closest('a')
17
+ // Force the click because Cypress sometimes determines that the item has 0x0 dimensions
18
+ .click({force: true});
19
+ }
20
+ }
@@ -39,6 +39,14 @@ export class ModalDialogSteps {
39
39
  ModalDialogSteps.getConfirmButton().click();
40
40
  }
41
41
 
42
+ static getOKButton() {
43
+ return ModalDialogSteps.getDialogFooter().find('.btn-primary');
44
+ }
45
+
46
+ static clickOKButton() {
47
+ ModalDialogSteps.getOKButton().click();
48
+ }
49
+
42
50
  static confirm() {
43
51
  ModalDialogSteps.getConfirmButton().click();
44
52
  }
@@ -304,4 +304,8 @@ export class RepositorySteps {
304
304
  cy.get('@repo').should('be.visible');
305
305
  cy.get('@repo').find('.repository-status .text-secondary').contains(status);
306
306
  }
307
+
308
+ static getEntityIndexSize() {
309
+ return RepositorySteps.getRepositoryCreateForm().find('#entityIndexSize');
310
+ }
307
311
  }
@@ -23,10 +23,25 @@ export class UserAndAccessSteps {
23
23
  return cy.get('#toggle-security span.switch');
24
24
  }
25
25
 
26
+ static getToggleSecurityCheckbox() {
27
+ return cy.get('#toggle-security input[type="checkbox"]');
28
+ }
26
29
  static toggleSecurity() {
27
30
  this.getToggleSecuritySwitch().click();
28
31
  }
29
32
 
33
+ static getFreeAccessSwitchInput() {
34
+ return cy.get('#toggle-freeaccess .switch input');
35
+ }
36
+
37
+ static getFreeAccessSwitch() {
38
+ return cy.get('#toggle-freeaccess span.switch');
39
+ }
40
+
41
+ static toggleFreeAccess() {
42
+ this.getFreeAccessSwitch().click();
43
+ }
44
+
30
45
  static getSecuritySwitchLabel() {
31
46
  return cy.get('#toggle-security').find('.security-switch-label');
32
47
  }
@@ -176,18 +191,157 @@ export class UserAndAccessSteps {
176
191
  });
177
192
  }
178
193
 
179
- static loginWithUser(username, password) {
180
- cy.get('#wb-login-username').type(username);
181
- cy.get('#wb-login-password').type(password);
182
- cy.get('#wb-login-submitLogin').click();
194
+ static clickGraphqlAccessAny() {
195
+ cy.get('#user-repos')
196
+ .contains('Any data repository')
197
+ .parent('tr')
198
+ .find('.graphql')
199
+ .realClick();
200
+ }
201
+
202
+ static clickGraphqlAccessRepo(repoName) {
203
+ cy.get('#user-repos')
204
+ .contains(repoName)
205
+ .parent('tr')
206
+ .find('.graphql')
207
+ .realClick();
208
+ }
209
+
210
+ static clickReadAccessAny() {
211
+ cy.get('#user-repos')
212
+ .contains('Any data repository')
213
+ .parent('tr')
214
+ .find('.read')
215
+ .realClick();
216
+ }
217
+
218
+ static clickReadAccessRepo(repoName) {
219
+ cy.get('#user-repos')
220
+ .contains(repoName)
221
+ .parent('tr')
222
+ .find('.read')
223
+ .realClick();
224
+ }
225
+
226
+ static clickWriteAccessAny() {
227
+ cy.get('#user-repos')
228
+ .contains('Any data repository')
229
+ .parent('tr')
230
+ .find('.write')
231
+ .realClick();
232
+ }
233
+
234
+ static clickWriteAccessRepo(repoName) {
235
+ cy.get('#user-repos')
236
+ .contains(repoName)
237
+ .parent('tr')
238
+ .find('.write')
239
+ .realClick();
240
+ }
241
+
242
+ static findUserRowAlias(username, aliasName = 'userRow') {
243
+ this.findUserInTable(username);
244
+ cy.get('@user').as(aliasName);
245
+ return cy.get('@' + aliasName);
246
+ }
247
+
248
+ static findRepoLineAlias(userRowAlias, matchText, repoLineAlias = 'repoLine') {
249
+ return this.getRepoLine(userRowAlias, matchText).as(repoLineAlias);
250
+ }
251
+
252
+ static getRepoLine(userRowAlias, matchText) {
253
+ return cy.get(userRowAlias)
254
+ .find('.repository-rights > div')
255
+ .filter(`:contains("${matchText}")`)
256
+ }
257
+
258
+ static findReadIconAlias(repoLineAlias) {
259
+ return cy.get(repoLineAlias).find('.icon-eye');
260
+ }
261
+
262
+ static findWriteIconAlias(repoLineAlias) {
263
+ return cy.get(repoLineAlias).find('.icon-edit');
183
264
  }
184
265
 
185
- static logout() {
186
- cy.get('#btnGroupDrop2').click();
187
- cy.get('.dropdown-item')
188
- .contains('Logout')
189
- .closest('a')
190
- // Force the click because Cypress sometimes determines that the item has 0x0 dimensions
191
- .click({force: true});
266
+ static findGraphqlIconAlias(repoLineAlias) {
267
+ return cy.get(repoLineAlias).find('.fa-gdb-graphql');
192
268
  }
269
+
270
+ static openEditUserPage(username) {
271
+ this.findUserInTable(username); // sets @user
272
+ cy.get('@user').find('.edit-user-btn').click();
273
+ }
274
+
275
+ static confirmUserEdit() {
276
+ cy.get('#wb-user-submit').click();
277
+ }
278
+
279
+ static getReadAccessForRepo(repoName) {
280
+ const matchText = (repoName === '*') ? 'Any data repository' : repoName;
281
+ return cy.get('#user-repos')
282
+ .contains(matchText)
283
+ .parent('tr')
284
+ .find('.read')
285
+ }
286
+
287
+ static toggleReadAccessForRepo(repoName) {
288
+ return this.getReadAccessForRepo(repoName).realClick();
289
+ }
290
+
291
+ static getWriteAccessForRepo(repoName) {
292
+ const matchText = (repoName === '*') ? 'Any data repository' : repoName;
293
+ return cy.get('#user-repos')
294
+ .contains(matchText)
295
+ .parent('tr')
296
+ .find('.write')
297
+ }
298
+
299
+ static toggleWriteAccessForRepo(repoName) {
300
+ return this.getWriteAccessForRepo(repoName).realClick();
301
+ }
302
+
303
+ static getGraphqlAccessForRepo(repoName) {
304
+ const matchText = (repoName === '*') ? 'Any data repository' : repoName;
305
+ return cy.get('#user-repos')
306
+ .contains(matchText)
307
+ .parent('tr')
308
+ .find('.graphql')
309
+ }
310
+
311
+ static toggleGraphqlAccessForRepo(repoName) {
312
+ return this.getGraphqlAccessForRepo(repoName).realClick();
313
+ }
314
+
315
+ static clickMenuItem(label) {
316
+ return cy.get('.main-menu').contains(label).click({force: true});
317
+ }
318
+
319
+ static clickSubmenuItem(label) {
320
+ return cy.get('.sub-menu').contains(label).click({force: true});
321
+ }
322
+
323
+ static clickFreeReadAccessRepo(repoName) {
324
+ cy.get('.repo-fields')
325
+ .contains(repoName)
326
+ .parent('.row')
327
+ .find('.read')
328
+ .realClick();
329
+ }
330
+
331
+ static clickFreeWriteAccessRepo(repoName) {
332
+ cy.get('.repo-fields')
333
+ .contains(repoName)
334
+ .parent('.row')
335
+ .find('.write')
336
+ .realClick();
337
+ }
338
+
339
+ static clickFreeGraphqlAccessRepo(repoName) {
340
+ cy.get('.repo-fields')
341
+ .contains(repoName)
342
+ .parent('.row')
343
+ .find('.graphql')
344
+ .realClick();
345
+ }
346
+
193
347
  }
@@ -412,6 +412,50 @@ export class TtygAgentSettingsModalSteps extends ModalDialogSteps {
412
412
  this.getIriDiscoverySearchCheckbox().uncheck({force: true});
413
413
  }
414
414
 
415
+ static getAutocompleteSearchCheckbox() {
416
+ return cy.get('#autocomplete_iri_discovery_search_checkbox');
417
+ }
418
+
419
+ static checkAutocompleteSearchCheckbox() {
420
+ this.getAutocompleteSearchCheckbox().check({force: true});
421
+ }
422
+
423
+ static uncheckAutocompleteSearchCheckbox() {
424
+ this.getAutocompleteSearchCheckbox().uncheck({force: true});
425
+ }
426
+
427
+ static getAutocompleteMaxResults() {
428
+ return cy.get('#autocomplete_iri_discovery_search_maxNumberOfResultsPerCall');
429
+ }
430
+
431
+ static setAutocompleteMaxResults(number) {
432
+ this.getAutocompleteMaxResults().type(number);
433
+ }
434
+
435
+ static getSearchPredicateInput() {
436
+ return cy.get('#autocompletePredicateField');
437
+ }
438
+
439
+ static enterSearchPredicate(text) {
440
+ this.getSearchPredicateInput().type(text);
441
+ }
442
+
443
+ static getSearchPredicateTags() {
444
+ return this.getSearchPredicateInput().find('.tag-item');
445
+ }
446
+
447
+ static toggleAutocompleteSearchPanel() {
448
+ cy.get('.extraction-method-toggle .panel-toggle-link .toggle-icon').click();
449
+ }
450
+
451
+ static getSuggestionsList() {
452
+ return cy.get('ul.suggestion-list li.suggestion-item');
453
+ }
454
+
455
+ static selectAutocompleteOption(index) {
456
+ this.getSuggestionsList().eq(index).click();
457
+ }
458
+
415
459
  // System instructions
416
460
 
417
461
  static getSystemInstructionsFormGroup() {