graphdb-workbench-tests 3.5.0-MANAGE-REPO-TR1 → 3.5.0-RC2
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.
- package/e2e-legacy/guides/ttyg/configure-agent/configure-agent-guide.spec.js +2 -1
- package/e2e-legacy/guides/welcome/welcome-guide.spec.js +1 -1
- package/e2e-legacy/home/solr-banner/solr-banner.spec.js +137 -0
- package/e2e-legacy/repository/ontop-repository.spec.js +132 -0
- package/e2e-legacy/setup/settings/my-settings-initial-state.spec.js +2 -6
- package/e2e-legacy/setup/settings/my-settings.spec.js +1 -1
- package/e2e-legacy/setup/users-and-access/user-and-access.spec.js +227 -62
- package/e2e-legacy/sparql-editor/saved-query/readonly-query.spec.js +1 -1
- package/e2e-legacy/ttyg/agent-select-menu.spec.js +7 -1
- package/e2e-legacy/ttyg/chat-list.spec.js +1 -1
- package/e2e-legacy/ttyg/create-chat.spec.js +1 -1
- package/e2e-legacy/ttyg/edit-agent.spec.js +2 -2
- package/e2e-legacy/ttyg/ttyg-permission.spec.js +2 -1
- package/fixtures/ontop/university-complete_edited.obda +106 -0
- package/npm-shrinkwrap.json +448 -278
- package/package.json +4 -5
- package/steps/deprecation-banner/deprecation-banner-steps.js +13 -0
- package/steps/deprecation-steps.js +13 -0
- package/steps/ontop-repository-steps.js +20 -0
- package/steps/repository-steps.js +44 -3
- package/steps/setup/settings-steps.js +3 -3
- package/steps/setup/user-and-access-steps.js +59 -16
- package/steps/ttyg/ttyg-view-steps.js +15 -1
- package/stubs/repositories/repositories-stubs.js +4 -0
- package/support/security-command.js +43 -0
- package/cypress-guides.config.js +0 -45
|
@@ -9,7 +9,8 @@ import {GuidesStubs} from "../../../../stubs/guides/guides-stubs.js";
|
|
|
9
9
|
import {TTYGStubs} from "../../../../stubs/ttyg/ttyg-stubs.js";
|
|
10
10
|
import {RepositoriesStubs} from "../../../../stubs/repositories/repositories-stubs.js";
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
// TODO: there is some issue with the context side field focus that breaks the test. Should be fixed soon
|
|
13
|
+
describe.skip('ttyg configure agent guide', () => {
|
|
13
14
|
let repositoryId;
|
|
14
15
|
|
|
15
16
|
beforeEach(() => {
|
|
@@ -21,7 +21,7 @@ describe('Welcome', () => {
|
|
|
21
21
|
cy.deleteRepository(repositoryId);
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
it
|
|
24
|
+
it('Should shows welcome steps', () => {
|
|
25
25
|
GuideDialogSteps.assertDialogWithTitleIsVisible('Welcome to Welcome — 1/2');
|
|
26
26
|
GuideDialogSteps.assertDialogWithContentIsVisible('Throughout the guide you will see boxes like this one that will provide instructions on what to do.');
|
|
27
27
|
GuideDialogSteps.clickOnNextButton();
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import HomeSteps from '../../../steps/home-steps.js';
|
|
2
|
+
import {DeprecationSteps} from '../../../steps/deprecation-steps.js';
|
|
3
|
+
import {LoginSteps} from '../../../steps/login-steps.js';
|
|
4
|
+
import {GuidesStubs} from '../../../stubs/guides/guides-stubs.js';
|
|
5
|
+
import {GuideSteps} from '../../../steps/guides/guide-steps.js';
|
|
6
|
+
import {GuideDialogSteps} from '../../../steps/guides/guide-dialog-steps.js';
|
|
7
|
+
|
|
8
|
+
describe('Solr deprecation banner', () => {
|
|
9
|
+
context('Security disabled', () => {
|
|
10
|
+
it('should keep the Solr deprecation banner hidden after the anonymous user dismisses it', () => {
|
|
11
|
+
// GIVEN: I have opened the application with security disabled.
|
|
12
|
+
HomeSteps.visit();
|
|
13
|
+
|
|
14
|
+
// THEN: I expect the Solr deprecation banner to be visible.
|
|
15
|
+
DeprecationSteps.getDeprecationBanner()
|
|
16
|
+
.should('be.visible')
|
|
17
|
+
.should('contain.text', 'The Solr connector is deprecated and will be removed in GraphDB 12');
|
|
18
|
+
|
|
19
|
+
// WHEN: I dismiss the Solr deprecation banner.
|
|
20
|
+
DeprecationSteps.closeBanner();
|
|
21
|
+
// THEN: I expect the Solr deprecation banner to be hidden.
|
|
22
|
+
DeprecationSteps.getDeprecationBanner().should('not.exist');
|
|
23
|
+
|
|
24
|
+
// WHEN: I reload the application.
|
|
25
|
+
HomeSteps.visit();
|
|
26
|
+
// THEN: I expect the Solr deprecation banner to remain hidden.
|
|
27
|
+
DeprecationSteps.getDeprecationBanner().should('not.exist');
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
context('Security enabled', () => {
|
|
32
|
+
const PASSWORD = 'root';
|
|
33
|
+
const USER_USERNAME = 'username';
|
|
34
|
+
|
|
35
|
+
beforeEach(() => {
|
|
36
|
+
cy.createUser({
|
|
37
|
+
username: USER_USERNAME,
|
|
38
|
+
password: PASSWORD
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
cy.switchOnSecurity()
|
|
42
|
+
.then(() => cy.loginAsAdmin())
|
|
43
|
+
.then(() => cy.switchOnFreeAccess(true));
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
afterEach(() => {
|
|
47
|
+
cy.loginAsAdmin()
|
|
48
|
+
.then(() => {
|
|
49
|
+
cy.deleteUser(USER_USERNAME, true);
|
|
50
|
+
cy.switchOffFreeAccess(true);
|
|
51
|
+
cy.switchOffSecurity(true);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('should persist separate Solr banner states for anonymous and logged-in users', () => {
|
|
56
|
+
// GIVEN: Security and free access are enabled, and no user is logged in.
|
|
57
|
+
HomeSteps.visit();
|
|
58
|
+
|
|
59
|
+
// THEN: I expect the Solr deprecation banner to be visible for the anonymous user.
|
|
60
|
+
DeprecationSteps.getDeprecationBanner()
|
|
61
|
+
.should('be.visible')
|
|
62
|
+
.should('contain.text', 'The Solr connector is deprecated and will be removed in GraphDB 12');
|
|
63
|
+
|
|
64
|
+
// WHEN: The anonymous user dismisses the banner.
|
|
65
|
+
DeprecationSteps.closeBanner();
|
|
66
|
+
// THEN: I expect the banner to be hidden for the anonymous user.
|
|
67
|
+
DeprecationSteps.getDeprecationBanner().should('not.exist');
|
|
68
|
+
|
|
69
|
+
// WHEN: I log in as a user who has not dismissed the banner.
|
|
70
|
+
cy.loginAs(USER_USERNAME, PASSWORD);
|
|
71
|
+
HomeSteps.visit();
|
|
72
|
+
|
|
73
|
+
// THEN: I expect the banner to be visible for the logged-in user.
|
|
74
|
+
DeprecationSteps.getDeprecationBanner()
|
|
75
|
+
.should('be.visible')
|
|
76
|
+
.should('contain.text', 'The Solr connector is deprecated and will be removed in GraphDB 12');
|
|
77
|
+
|
|
78
|
+
// WHEN: The logged-in user dismisses the banner.
|
|
79
|
+
DeprecationSteps.closeBanner();
|
|
80
|
+
// THEN: I expect the banner to be hidden for the logged-in user.
|
|
81
|
+
DeprecationSteps.getDeprecationBanner().should('not.exist');
|
|
82
|
+
|
|
83
|
+
// WHEN: The user logs out.
|
|
84
|
+
LoginSteps.logout();
|
|
85
|
+
// THEN: I expect the banner to remain hidden because the anonymous user has already dismissed it.
|
|
86
|
+
DeprecationSteps.getDeprecationBanner().should('not.exist');
|
|
87
|
+
|
|
88
|
+
// WHEN: I log in as the administrator, who has not dismissed the banner.
|
|
89
|
+
cy.loginAs('admin', 'root');
|
|
90
|
+
HomeSteps.visit();
|
|
91
|
+
// THEN: I expect the banner to be visible for the administrator.
|
|
92
|
+
DeprecationSteps.getDeprecationBanner()
|
|
93
|
+
.should('be.visible')
|
|
94
|
+
.should('contain.text', 'The Solr connector is deprecated and will be removed in GraphDB 12');
|
|
95
|
+
|
|
96
|
+
// WHEN: The administrator logs out.
|
|
97
|
+
LoginSteps.logout();
|
|
98
|
+
// THEN: I expect the banner to remain hidden because the anonymous user has already dismissed it.
|
|
99
|
+
DeprecationSteps.getDeprecationBanner().should('not.exist');
|
|
100
|
+
|
|
101
|
+
// WHEN: I log in again as the user who previously dismissed the banner.
|
|
102
|
+
cy.loginAs(USER_USERNAME, PASSWORD);
|
|
103
|
+
HomeSteps.visit();
|
|
104
|
+
// THEN: I expect the banner to remain hidden for the logged-in user.
|
|
105
|
+
DeprecationSteps.getDeprecationBanner().should('not.exist');
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
context('User guides', () => {
|
|
110
|
+
it('should hide the Solr deprecation banner while a guide is running', () => {
|
|
111
|
+
// GIVEN: The guides are loaded and ready to be started.
|
|
112
|
+
GuidesStubs.stubMainMenuGuide();
|
|
113
|
+
GuideSteps.visit();
|
|
114
|
+
GuideSteps.verifyGuidesListExists();
|
|
115
|
+
cy.wait('@getGuides');
|
|
116
|
+
|
|
117
|
+
// WHEN: I am on an application page, and the Solr deprecation banner has not been dismissed by the current user.
|
|
118
|
+
// THEN: I expect the Solr deprecation banner to be visible because it has not been dismissed by the current user.
|
|
119
|
+
DeprecationSteps.getDeprecationBanner()
|
|
120
|
+
.should('be.visible')
|
|
121
|
+
.should('contain.text', 'The Solr connector is deprecated and will be removed in GraphDB 12');
|
|
122
|
+
|
|
123
|
+
// WHEN: I start a guide.
|
|
124
|
+
GuideSteps.runFirstGuide();
|
|
125
|
+
// THEN: I expect the Solr deprecation banner to be hidden while the guide is running.
|
|
126
|
+
DeprecationSteps.getDeprecationBanner().should('not.exist');
|
|
127
|
+
|
|
128
|
+
// WHEN: I cancel the guide.
|
|
129
|
+
GuideDialogSteps.clickOnCancelButton();
|
|
130
|
+
GuideDialogSteps.clickConfirmCancelDialogExitButton();
|
|
131
|
+
// THEN: I expect the Solr deprecation banner to be visible again.
|
|
132
|
+
DeprecationSteps.getDeprecationBanner()
|
|
133
|
+
.should('be.visible')
|
|
134
|
+
.should('contain.text', 'The Solr connector is deprecated and will be removed in GraphDB 12');
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
});
|
|
@@ -241,4 +241,136 @@ describe('Ontop repositories', () => {
|
|
|
241
241
|
// Then I expect url to be calculated properly
|
|
242
242
|
OntopRepositorySteps.getUrlInput().should('have.value', 'jdbc:snowflake://someHostName.snowflakecomputing.com:1234/?warehouse=test_database');
|
|
243
243
|
});
|
|
244
|
+
|
|
245
|
+
context('Repository maintenance permission', () => {
|
|
246
|
+
|
|
247
|
+
const PASSWORD = 'root';
|
|
248
|
+
const REPOSITORY_MAINTAINER_USERNAME = 'repoMaintainer';
|
|
249
|
+
const REPOSITORY_MANAGER_USERNAME = 'repoManager';
|
|
250
|
+
|
|
251
|
+
beforeEach(() => {
|
|
252
|
+
cy.createUser({
|
|
253
|
+
username: REPOSITORY_MAINTAINER_USERNAME,
|
|
254
|
+
password: PASSWORD,
|
|
255
|
+
grantedAuthorities: [
|
|
256
|
+
`READ_REPO_${repositoryId}`,
|
|
257
|
+
`MAINTAIN_REPO_${repositoryId}`,
|
|
258
|
+
`WRITE_REPO_${repositoryId}`
|
|
259
|
+
]
|
|
260
|
+
});
|
|
261
|
+
cy.createUser({
|
|
262
|
+
username: REPOSITORY_MANAGER_USERNAME,
|
|
263
|
+
password: PASSWORD,
|
|
264
|
+
grantedAuthorities: [
|
|
265
|
+
'ROLE_USER',
|
|
266
|
+
'ROLE_MONITORING',
|
|
267
|
+
'ROLE_REPO_MANAGER'
|
|
268
|
+
]
|
|
269
|
+
});
|
|
270
|
+
cy.switchOnSecurity();
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
afterEach(() => {
|
|
274
|
+
cy.loginAsAdmin()
|
|
275
|
+
.then(() => {
|
|
276
|
+
cy.deleteUser(REPOSITORY_MAINTAINER_USERNAME, true);
|
|
277
|
+
cy.deleteUser(REPOSITORY_MANAGER_USERNAME, true);
|
|
278
|
+
cy.switchOffSecurity(true);
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
it('should allow a repository maintainer to edit an Ontop repository', () => {
|
|
282
|
+
RepositoryStubs.spyGetJDBCProperties();
|
|
283
|
+
// GIVEN: An Ontop repository exists
|
|
284
|
+
cy.loginAs(REPOSITORY_MANAGER_USERNAME, PASSWORD);
|
|
285
|
+
OntopRepositorySteps.visitCreate();
|
|
286
|
+
createOntopRepository(repositoryId);
|
|
287
|
+
|
|
288
|
+
// WHEN: I log in as a user with maintenance permission
|
|
289
|
+
cy.loginAs(REPOSITORY_MAINTAINER_USERNAME, PASSWORD);
|
|
290
|
+
RepositorySteps.visit(false);
|
|
291
|
+
|
|
292
|
+
// THEN: The repository is visible because the user can maintain it
|
|
293
|
+
RepositorySteps.getRepositoryFromList(repositoryId).should('exist');
|
|
294
|
+
|
|
295
|
+
// WHEN: I edit the repository
|
|
296
|
+
RepositorySteps.editRepository(repositoryId);
|
|
297
|
+
cy.wait('@getJDBCProperties');
|
|
298
|
+
RepositorySteps.getUsernameFieldEditRepo()
|
|
299
|
+
.should('have.value', '')
|
|
300
|
+
.type('username');
|
|
301
|
+
|
|
302
|
+
// Uploading an OBDA file verifies that the repository maintainer can access rest/repositories/file/upload
|
|
303
|
+
OntopRepositorySteps.clickObdaFileUploadButton();
|
|
304
|
+
OntopRepositorySteps.uploadObdaFile('fixtures/ontop/university-complete_edited.obda');
|
|
305
|
+
|
|
306
|
+
// Saving the form verifies that the repository maintainer can access rest/repositories/ontop/jdbc-properties
|
|
307
|
+
OntopRepositorySteps.getAdditionalJDBCProperties()
|
|
308
|
+
.should('have.value', '')
|
|
309
|
+
.type('ontop.cardinalityMode=LOOSE');
|
|
310
|
+
|
|
311
|
+
RepositorySteps.clickSaveEditedRepo();
|
|
312
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
313
|
+
|
|
314
|
+
// THEN: The changes are persisted
|
|
315
|
+
RepositorySteps.visit(false);
|
|
316
|
+
RepositorySteps.getRepositoryFromList(repositoryId).should('exist');
|
|
317
|
+
RepositorySteps.editRepository(repositoryId);
|
|
318
|
+
cy.wait('@getJDBCProperties');
|
|
319
|
+
|
|
320
|
+
OntopRepositorySteps.getOntopSaveButton().should('be.visible');
|
|
321
|
+
RepositorySteps.getUsernameFieldEditRepo()
|
|
322
|
+
.should('have.value', 'username');
|
|
323
|
+
|
|
324
|
+
// Loading the saved properties verifies GET access to rest/repositories/ontop/jdbc-properties
|
|
325
|
+
OntopRepositorySteps.getAdditionalJDBCProperties()
|
|
326
|
+
.should('contain.value', 'ontop.cardinalityMode=LOOSE');
|
|
327
|
+
// Saving of the OBDA file verifies that the repository maintainer can access rest/repositories/file/upload
|
|
328
|
+
OntopRepositorySteps.editOBDAFile();
|
|
329
|
+
ModalDialogSteps.getDialogBody()
|
|
330
|
+
.find('textarea')
|
|
331
|
+
.invoke('val')
|
|
332
|
+
.should('include', 'edited ODBA file');
|
|
333
|
+
ModalDialogSteps.close();
|
|
334
|
+
|
|
335
|
+
// WHEN: I edit and save the OBDA file
|
|
336
|
+
// Opening the editor verifies access to rest/repositories/file,
|
|
337
|
+
// while saving verifies access to rest/repositories/file/update.
|
|
338
|
+
OntopRepositorySteps.editOBDAFile();
|
|
339
|
+
ModalDialogSteps.getDialogHeader()
|
|
340
|
+
.should('contain', 'Edit "OBDA or R2RML file" contents');
|
|
341
|
+
|
|
342
|
+
ModalDialogSteps.getDialogBody()
|
|
343
|
+
.find('textarea')
|
|
344
|
+
.type('{moveToStart}Add commentary for testing purpose');
|
|
345
|
+
|
|
346
|
+
ModalDialogSteps.clickOKButton();
|
|
347
|
+
RepositorySteps.clickSaveEditedRepo();
|
|
348
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
349
|
+
|
|
350
|
+
// THEN: The OBDA file changes are persisted
|
|
351
|
+
RepositorySteps.visit(false);
|
|
352
|
+
RepositorySteps.getRepositoryFromList(repositoryId).should('exist');
|
|
353
|
+
RepositorySteps.editRepository(repositoryId);
|
|
354
|
+
cy.wait('@getJDBCProperties');
|
|
355
|
+
OntopRepositorySteps.editOBDAFile();
|
|
356
|
+
|
|
357
|
+
ModalDialogSteps.getDialogBody()
|
|
358
|
+
.find('textarea')
|
|
359
|
+
.invoke('val')
|
|
360
|
+
.should('include', 'Add commentary for testing purpose');
|
|
361
|
+
});
|
|
362
|
+
});
|
|
244
363
|
});
|
|
364
|
+
|
|
365
|
+
const createOntopRepository = (repositoryId) => {
|
|
366
|
+
RepositorySteps.typeRepositoryId(repositoryId);
|
|
367
|
+
OntopRepositorySteps.selectOracleDatabase();
|
|
368
|
+
OntopRepositorySteps.typeHostName('localhost');
|
|
369
|
+
OntopRepositorySteps.typePort(5423);
|
|
370
|
+
OntopRepositorySteps.typeDatabaseName('database-name');
|
|
371
|
+
OntopRepositorySteps.clickObdaFileUploadButton();
|
|
372
|
+
OntopRepositorySteps.uploadObdaFile('fixtures/ontop/university-complete.obda');
|
|
373
|
+
// Wait edit OBDA edit button be visible to ensure that file is uploaded.
|
|
374
|
+
OntopRepositorySteps.getOBDAFileFieldEditButton().should('be.visible');
|
|
375
|
+
OntopRepositorySteps.clickOnCreateRepositoryButton();
|
|
376
|
+
};
|
|
@@ -20,14 +20,10 @@ function verifyInitialState(repositoryId) {
|
|
|
20
20
|
SettingsSteps.getSparqlEditorPanel().should('be.visible');
|
|
21
21
|
SettingsSteps.getSameAsToggle().should('be.checked');
|
|
22
22
|
SettingsSteps.getSameAsLabel().should('be.visible')
|
|
23
|
-
.and('contain', 'Expand results over owl:SameAs
|
|
24
|
-
.find('.tag').should('be.visible')
|
|
25
|
-
.and('contain', 'ON');
|
|
23
|
+
.and('contain', 'Expand results over owl:SameAs');
|
|
26
24
|
SettingsSteps.getInferenceToggle().should('be.checked');
|
|
27
25
|
SettingsSteps.getInferenceLabel().should('be.visible')
|
|
28
|
-
.and('contain', '
|
|
29
|
-
.find('.tag').should('be.visible')
|
|
30
|
-
.and('contain', 'ON');
|
|
26
|
+
.and('contain', 'Enable inference');
|
|
31
27
|
SettingsSteps.getCountCheckbox().should('be.checked');
|
|
32
28
|
SettingsSteps.getIgnoreSharedCheckbox().should('not.be.checked');
|
|
33
29
|
|
|
@@ -188,7 +188,7 @@ describe('My Settings', () => {
|
|
|
188
188
|
cy.get('.login-credentials').should('be.visible');
|
|
189
189
|
cy.get('#wb-user-username').should('be.visible')
|
|
190
190
|
.and('have.value', 'admin')
|
|
191
|
-
.and('
|
|
191
|
+
.and('be.disabled');
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
function clickLabelBtn(btnId) {
|