graphdb-workbench-tests 2.3.1 → 2.4.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.
- package/fixtures/locale-en.json +133 -11
- package/fixtures/monitoring/backup-and-restore.json +19 -0
- package/fixtures/monitoring/global-operation-statuses.json +30 -0
- package/fixtures/setup/aclmanagement/get-rules.json +44 -0
- package/integration/explore/similarity.spec.js +2 -2
- package/integration/import/import.user.data.spec.js +4 -4
- package/integration/monitor/global-operation-statuses-component.spec.js +106 -0
- package/integration/monitor/monitor.backup-and-restore.spec.js +25 -0
- package/integration/setup/aclmanagement/create-rule.spec.js +107 -0
- package/integration/setup/aclmanagement/delete-rule.spec.js +45 -0
- package/integration/setup/aclmanagement/edit-rule.spec.js +83 -0
- package/integration/setup/aclmanagement/render-rules.spec.js +48 -0
- package/integration/setup/aclmanagement/reorder-rules.spec.js +32 -0
- package/integration/setup/aclmanagement/revert-rules.spec.js +56 -0
- package/integration/setup/aclmanagement/update-rules.spec.js +75 -0
- package/integration/setup/my-settings.spec.js +1 -1
- package/integration/setup/sparql-templates.spec.js +1 -1
- package/integration/sparql/main.menu.spec.js +36 -0
- package/integration/sparql/sparql.menu.spec.js +1 -1
- package/integration-flaky/setup/sparql-templates.spec.js +1 -1
- package/package.json +1 -1
- package/steps/application-steps.js +22 -0
- package/steps/import-steps.js +6 -3
- package/steps/modal-dialog-steps.js +113 -0
- package/steps/monitoring/backup-and-restore-steps.js +14 -0
- package/steps/operations-statuses-component-steps.js +21 -0
- package/steps/setup/acl-management-steps.js +274 -0
- package/steps/sparql-steps.js +1 -1
- package/stubs/backup-and-restore-stubs.js +7 -0
- package/stubs/global-operations-statuses-stub.js +7 -0
- package/stubs/stubs.js +5 -0
- package/support/repository-commands.js +8 -3
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {AclManagementSteps} from "../../../steps/setup/acl-management-steps";
|
|
2
|
+
import {ACL} from "../../../steps/setup/acl-management-steps";
|
|
3
|
+
|
|
4
|
+
describe('ACL Management: create rule', () => {
|
|
5
|
+
|
|
6
|
+
let repositoryId;
|
|
7
|
+
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
cy.deleteRepository(repositoryId);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
repositoryId = 'acl-management-' + Date.now();
|
|
14
|
+
cy.createRepository({id: repositoryId});
|
|
15
|
+
cy.presetRepository(repositoryId);
|
|
16
|
+
cy.initializeRepository(repositoryId);
|
|
17
|
+
AclManagementSteps.importRules(repositoryId);
|
|
18
|
+
AclManagementSteps.visit();
|
|
19
|
+
// ensure rules are rendered
|
|
20
|
+
AclManagementSteps.getAclRules().should('have.length.gt', 0);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
it('Should add a new rule in the beginning of the list and cancel operation', () => {
|
|
25
|
+
AclManagementSteps.addRuleInBeginning();
|
|
26
|
+
AclManagementSteps.getAclRules().should('have.length', 6);
|
|
27
|
+
AclManagementSteps.cancelRuleEditing(0);
|
|
28
|
+
AclManagementSteps.getAclRules().should('have.length', 5);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('Should add a new rule in the list and cancel operation', () => {
|
|
32
|
+
AclManagementSteps.addRule(1);
|
|
33
|
+
AclManagementSteps.getAclRules().should('have.length', 6);
|
|
34
|
+
AclManagementSteps.cancelRuleEditing(2);
|
|
35
|
+
AclManagementSteps.getAclRules().should('have.length', 5);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('Should add a new rule in the list', () => {
|
|
39
|
+
// When I add a new rule
|
|
40
|
+
AclManagementSteps.addRule(1);
|
|
41
|
+
// Then I expect that the save rule button should be enabled because all fields have some default values
|
|
42
|
+
AclManagementSteps.checkIfRuleSavingIsAllowed(2);
|
|
43
|
+
// When I fill in the subject field
|
|
44
|
+
AclManagementSteps.getSubjectField(2).should('have.value', '*');
|
|
45
|
+
AclManagementSteps.fillSubject(2, '<urn:John>');
|
|
46
|
+
// Then I expect that the save rule button should still be enabled
|
|
47
|
+
AclManagementSteps.checkIfRuleSavingIsAllowed(2);
|
|
48
|
+
// When I fill in the predicate field
|
|
49
|
+
AclManagementSteps.getPredicateField(2).should('have.value', '*');
|
|
50
|
+
AclManagementSteps.fillPredicate(2, '*');
|
|
51
|
+
// Then I expect that the save rule button should still be enabled
|
|
52
|
+
AclManagementSteps.checkIfRuleSavingIsAllowed(2);
|
|
53
|
+
// When I fill in the object field
|
|
54
|
+
AclManagementSteps.getObjectField(2).should('have.value', '*');
|
|
55
|
+
AclManagementSteps.fillObject(2, '*');
|
|
56
|
+
// Then I expect that the save rule button should still be enabled
|
|
57
|
+
AclManagementSteps.checkIfRuleSavingIsAllowed(2);
|
|
58
|
+
// When I fill in the context field
|
|
59
|
+
AclManagementSteps.getContextField(2).should('have.value', '*');
|
|
60
|
+
AclManagementSteps.fillContext(2, '*');
|
|
61
|
+
// Then I expect that the save rule button should be enabled
|
|
62
|
+
AclManagementSteps.checkIfRuleSavingIsAllowed(2);
|
|
63
|
+
// When I fill in the role field
|
|
64
|
+
AclManagementSteps.getRoleField(2).should('have.value', 'CUSTOM_');
|
|
65
|
+
AclManagementSteps.fillRole(2, 'CUSTOM_ROLE1');
|
|
66
|
+
// Then I expect that the save rule button should be enabled
|
|
67
|
+
AclManagementSteps.checkIfRuleSavingIsAllowed(2);
|
|
68
|
+
// When I change the policy
|
|
69
|
+
AclManagementSteps.selectPolicy(2, 'deny');
|
|
70
|
+
// Then I expect that the save rule button should be enabled
|
|
71
|
+
AclManagementSteps.checkIfRuleSavingIsAllowed(2);
|
|
72
|
+
// When I save the rule
|
|
73
|
+
AclManagementSteps.saveRule(2);
|
|
74
|
+
// Then the rule should be saved
|
|
75
|
+
AclManagementSteps.getAclRules().should('have.length', 6);
|
|
76
|
+
const newRule = {
|
|
77
|
+
"subject": "<urn:John>",
|
|
78
|
+
"predicate": "*",
|
|
79
|
+
"object": "*",
|
|
80
|
+
"context": "*",
|
|
81
|
+
"role": "CUSTOM_ROLE1",
|
|
82
|
+
"policy": "deny",
|
|
83
|
+
"moveUp": true,
|
|
84
|
+
"moveDown": true
|
|
85
|
+
};
|
|
86
|
+
AclManagementSteps.checkRules([ACL[0], ACL[1], newRule, ACL[2], ACL[3], ACL[4]]);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('Should hide all unnecessary actions during rule creation', () => {
|
|
90
|
+
// When there is no rule opened for edit
|
|
91
|
+
// Then I expect that move up, move down, edit rule, create rule, delete rule buttons to be visible
|
|
92
|
+
AclManagementSteps.getMoveUpButtons().should('have.length', 4);
|
|
93
|
+
AclManagementSteps.getMoveDownButtons().should('have.length', 4);
|
|
94
|
+
AclManagementSteps.deleteRuleButtons().should('have.length', 5);
|
|
95
|
+
AclManagementSteps.editRuleButtons().should('have.length', 5);
|
|
96
|
+
AclManagementSteps.createRuleButtons().should('have.length', 6);
|
|
97
|
+
// When a rule is in edit mode
|
|
98
|
+
AclManagementSteps.addRule(1);
|
|
99
|
+
// Then I expect that move up, move down, edit rule, create rule, delete rule buttons to be hidden
|
|
100
|
+
AclManagementSteps.getMoveUpButtons().should('have.length', 0);
|
|
101
|
+
AclManagementSteps.getMoveDownButtons().should('have.length', 0);
|
|
102
|
+
AclManagementSteps.deleteRuleButtons().should('have.length', 0);
|
|
103
|
+
AclManagementSteps.editRuleButtons().should('have.length', 0);
|
|
104
|
+
AclManagementSteps.createRuleButtons().should('have.length', 0);
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {AclManagementSteps} from "../../../steps/setup/acl-management-steps";
|
|
2
|
+
import {ACL} from "../../../steps/setup/acl-management-steps";
|
|
3
|
+
import {ModalDialogSteps} from "../../../steps/modal-dialog-steps";
|
|
4
|
+
|
|
5
|
+
describe('ACL Management: delete rule', () => {
|
|
6
|
+
|
|
7
|
+
let repositoryId;
|
|
8
|
+
|
|
9
|
+
afterEach(() => {
|
|
10
|
+
cy.deleteRepository(repositoryId);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
repositoryId = 'acl-management-' + Date.now();
|
|
15
|
+
cy.createRepository({id: repositoryId});
|
|
16
|
+
cy.presetRepository(repositoryId);
|
|
17
|
+
cy.initializeRepository(repositoryId);
|
|
18
|
+
AclManagementSteps.importRules(repositoryId);
|
|
19
|
+
AclManagementSteps.visit();
|
|
20
|
+
// ensure rules are rendered
|
|
21
|
+
AclManagementSteps.getAclRules().should('have.length.gt', 0);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('Should be able to delete rule', () => {
|
|
25
|
+
// When I try to remove a rule
|
|
26
|
+
AclManagementSteps.getAclRules().should('have.length', 5);
|
|
27
|
+
AclManagementSteps.deleteRule(0);
|
|
28
|
+
// Then I expect a confirmation dialog
|
|
29
|
+
ModalDialogSteps.getDialog().should('be.visible');
|
|
30
|
+
ModalDialogSteps.getDialogBody().should('contain', 'Are you sure you want to delete the selected rule #0?');
|
|
31
|
+
// When I cancel operation
|
|
32
|
+
ModalDialogSteps.clickOnCancelButton();
|
|
33
|
+
// Then I expect the rule to remain in the list
|
|
34
|
+
ModalDialogSteps.getDialog().should('not.exist');
|
|
35
|
+
AclManagementSteps.getAclRules().should('have.length', 5);
|
|
36
|
+
// When I try remove it again and confirm the operation
|
|
37
|
+
AclManagementSteps.deleteRule(4);
|
|
38
|
+
ModalDialogSteps.getDialogBody().should('contain', 'Are you sure you want to delete the selected rule #4?');
|
|
39
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
40
|
+
// Then I expect the rule to be removed from the list
|
|
41
|
+
ModalDialogSteps.getDialog().should('not.exist');
|
|
42
|
+
AclManagementSteps.getAclRules().should('have.length', 4);
|
|
43
|
+
AclManagementSteps.checkRules([ACL[0], ACL[1], ACL[2], ACL[3]]);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import {AclManagementSteps} from "../../../steps/setup/acl-management-steps";
|
|
2
|
+
import {ACL} from "../../../steps/setup/acl-management-steps";
|
|
3
|
+
|
|
4
|
+
describe('ACL Management: edit rule', () => {
|
|
5
|
+
|
|
6
|
+
let repositoryId;
|
|
7
|
+
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
cy.deleteRepository(repositoryId);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
repositoryId = 'acl-management-' + Date.now();
|
|
14
|
+
cy.createRepository({id: repositoryId});
|
|
15
|
+
cy.presetRepository(repositoryId);
|
|
16
|
+
cy.initializeRepository(repositoryId);
|
|
17
|
+
AclManagementSteps.importRules(repositoryId);
|
|
18
|
+
AclManagementSteps.visit();
|
|
19
|
+
// ensure rules are rendered
|
|
20
|
+
AclManagementSteps.getAclRules().should('have.length.gt', 0);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('Should hide all unnecessary actions during rule editing', () => {
|
|
24
|
+
// When there is no rule opened for edit
|
|
25
|
+
// Then I expect that move up, move down, edit rule, create rule, delete rule buttons to be visible
|
|
26
|
+
AclManagementSteps.getMoveUpButtons().should('have.length', 4);
|
|
27
|
+
AclManagementSteps.getMoveDownButtons().should('have.length', 4);
|
|
28
|
+
AclManagementSteps.deleteRuleButtons().should('have.length', 5);
|
|
29
|
+
AclManagementSteps.editRuleButtons().should('have.length', 5);
|
|
30
|
+
AclManagementSteps.createRuleButtons().should('have.length', 6);
|
|
31
|
+
// When a rule is in edit mode
|
|
32
|
+
AclManagementSteps.editRule(1);
|
|
33
|
+
// Then I expect that move up, move down, edit rule, create rule, delete rule buttons to be hidden
|
|
34
|
+
AclManagementSteps.getMoveUpButtons().should('have.length', 0);
|
|
35
|
+
AclManagementSteps.getMoveDownButtons().should('have.length', 0);
|
|
36
|
+
AclManagementSteps.deleteRuleButtons().should('have.length', 0);
|
|
37
|
+
AclManagementSteps.editRuleButtons().should('have.length', 0);
|
|
38
|
+
AclManagementSteps.createRuleButtons().should('have.length', 0);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('Should be able to edit rule', () => {
|
|
42
|
+
// When I edit a rule
|
|
43
|
+
AclManagementSteps.getAclRules().should('have.length', 5);
|
|
44
|
+
AclManagementSteps.editRule(2);
|
|
45
|
+
// Then I expect rule edit form to be opened
|
|
46
|
+
AclManagementSteps.getAclRules().should('have.length', 5);
|
|
47
|
+
AclManagementSteps.checkRuleEditForm(2, {
|
|
48
|
+
subject: '<<<http://example.com/test> <http://www.w3.org/2000/01/rdf-schema#label> "test aber auf Deutsch"@de>>',
|
|
49
|
+
predicate: '*',
|
|
50
|
+
object: '"test aber auf Deutsch"@en',
|
|
51
|
+
context: '<http://example.com/graph1>',
|
|
52
|
+
role: 'CUSTOM_ROLE3',
|
|
53
|
+
policy: 'deny'
|
|
54
|
+
});
|
|
55
|
+
AclManagementSteps.checkIfRuleSavingIsAllowed(2);
|
|
56
|
+
// When I cancel the edit operation
|
|
57
|
+
AclManagementSteps.cancelRuleEditing(2);
|
|
58
|
+
// Then I expect that the rule will be opened in preview mode again with the same values
|
|
59
|
+
AclManagementSteps.getAclRules().should('have.length', 5);
|
|
60
|
+
AclManagementSteps.checkRules(ACL);
|
|
61
|
+
// When I edit the rule again
|
|
62
|
+
AclManagementSteps.editRule(2);
|
|
63
|
+
AclManagementSteps.fillSubject(2, '<urn:Me>');
|
|
64
|
+
AclManagementSteps.fillPredicate(2, 'rdf:type');
|
|
65
|
+
AclManagementSteps.fillObject(2, '*');
|
|
66
|
+
AclManagementSteps.fillContext(2, '*');
|
|
67
|
+
AclManagementSteps.fillRole(2, 'TEST');
|
|
68
|
+
AclManagementSteps.selectPolicy(2, 'allow');
|
|
69
|
+
// And I save the rule
|
|
70
|
+
AclManagementSteps.saveRule(2);
|
|
71
|
+
// Then I expect the rule to be saved with the new data
|
|
72
|
+
const editedRule = {
|
|
73
|
+
subject: '<urn:Me>',
|
|
74
|
+
predicate: 'rdf:type',
|
|
75
|
+
object: '*',
|
|
76
|
+
context: '*',
|
|
77
|
+
role: 'TEST',
|
|
78
|
+
policy: 'allow'
|
|
79
|
+
};
|
|
80
|
+
AclManagementSteps.checkRules([ACL[0], ACL[1], editedRule, ACL[3], ACL[4]]);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {AclManagementSteps} from "../../../steps/setup/acl-management-steps";
|
|
2
|
+
import {ACL} from "../../../steps/setup/acl-management-steps";
|
|
3
|
+
|
|
4
|
+
describe('ACL Management: render rules', () => {
|
|
5
|
+
|
|
6
|
+
let repositoryId;
|
|
7
|
+
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
cy.deleteRepository(repositoryId);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
context('When no ACL is loaded', () => {
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
repositoryId = 'acl-management-' + Date.now();
|
|
15
|
+
cy.createRepository({id: repositoryId});
|
|
16
|
+
cy.presetRepository(repositoryId);
|
|
17
|
+
cy.initializeRepository(repositoryId);
|
|
18
|
+
AclManagementSteps.visit();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('Should render empty ACL rules table', () => {
|
|
22
|
+
AclManagementSteps.getPageHeading().should('contain', 'ACL Management');
|
|
23
|
+
AclManagementSteps.getAclTable().should('be.visible');
|
|
24
|
+
AclManagementSteps.getAclRules().should('not.exist');
|
|
25
|
+
AclManagementSteps.getAddFirstRuleButton().should('be.visible');
|
|
26
|
+
AclManagementSteps.getNoDataMessage().should('be.visible');
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
context('When rules are loaded', () => {
|
|
31
|
+
beforeEach(() => {
|
|
32
|
+
repositoryId = 'acl-management-' + Date.now();
|
|
33
|
+
cy.createRepository({id: repositoryId});
|
|
34
|
+
cy.presetRepository(repositoryId);
|
|
35
|
+
cy.initializeRepository(repositoryId);
|
|
36
|
+
AclManagementSteps.importRules(repositoryId);
|
|
37
|
+
AclManagementSteps.visit();
|
|
38
|
+
// ensure rules are rendered
|
|
39
|
+
AclManagementSteps.getAclRules().should('have.length.gt', 0);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('Should render ACL rules in a table', () => {
|
|
43
|
+
AclManagementSteps.getAclRules().should('have.length', 5);
|
|
44
|
+
AclManagementSteps.getAddFirstRuleButton().should('be.visible');
|
|
45
|
+
AclManagementSteps.checkRules(ACL);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {AclManagementSteps} from "../../../steps/setup/acl-management-steps";
|
|
2
|
+
import {ACL} from "../../../steps/setup/acl-management-steps";
|
|
3
|
+
|
|
4
|
+
describe('ACL Management: reorder rules', () => {
|
|
5
|
+
|
|
6
|
+
let repositoryId;
|
|
7
|
+
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
cy.deleteRepository(repositoryId);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
repositoryId = 'acl-management-' + Date.now();
|
|
14
|
+
cy.createRepository({id: repositoryId});
|
|
15
|
+
cy.presetRepository(repositoryId);
|
|
16
|
+
cy.initializeRepository(repositoryId);
|
|
17
|
+
AclManagementSteps.importRules(repositoryId);
|
|
18
|
+
AclManagementSteps.visit();
|
|
19
|
+
// ensure rules are rendered
|
|
20
|
+
AclManagementSteps.getAclRules().should('have.length.gt', 0);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('Should move rule up', () => {
|
|
24
|
+
AclManagementSteps.moveRuleUp(1);
|
|
25
|
+
AclManagementSteps.checkRules([ACL[1], ACL[0], ACL[2], ACL[3], ACL[4]]);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('Should move rule down', () => {
|
|
29
|
+
AclManagementSteps.moveRuleDown(1);
|
|
30
|
+
AclManagementSteps.checkRules([ACL[0], ACL[2], ACL[1], ACL[3], ACL[4]]);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {ACL, AclManagementSteps} from "../../../steps/setup/acl-management-steps";
|
|
2
|
+
import {ApplicationSteps} from "../../../steps/application-steps";
|
|
3
|
+
import {ModalDialogSteps} from "../../../steps/modal-dialog-steps";
|
|
4
|
+
|
|
5
|
+
describe('ACL Management: revert rules', () => {
|
|
6
|
+
|
|
7
|
+
let repositoryId;
|
|
8
|
+
|
|
9
|
+
afterEach(() => {
|
|
10
|
+
cy.deleteRepository(repositoryId);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
repositoryId = 'acl-management-' + Date.now();
|
|
15
|
+
cy.createRepository({id: repositoryId});
|
|
16
|
+
cy.presetRepository(repositoryId);
|
|
17
|
+
cy.initializeRepository(repositoryId);
|
|
18
|
+
AclManagementSteps.importRules(repositoryId);
|
|
19
|
+
AclManagementSteps.visit();
|
|
20
|
+
// ensure rules are rendered
|
|
21
|
+
AclManagementSteps.getAclRules().should('have.length.gt', 0);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('Should be able to revert changes in the ACL', () => {
|
|
25
|
+
// Given I have opened ACL management page
|
|
26
|
+
AclManagementSteps.checkRules(ACL);
|
|
27
|
+
// When I add a new rule
|
|
28
|
+
AclManagementSteps.addRule(1);
|
|
29
|
+
AclManagementSteps.fillSubject(2, '<urn:John>');
|
|
30
|
+
AclManagementSteps.fillPredicate(2, '*');
|
|
31
|
+
AclManagementSteps.fillObject(2, '*');
|
|
32
|
+
AclManagementSteps.fillContext(2, '*');
|
|
33
|
+
AclManagementSteps.fillRole(2, 'ROLE1');
|
|
34
|
+
AclManagementSteps.selectPolicy(2, 'deny');
|
|
35
|
+
AclManagementSteps.saveRule(2);
|
|
36
|
+
// And I edit an existing rule
|
|
37
|
+
AclManagementSteps.editRule(1);
|
|
38
|
+
AclManagementSteps.fillSubject(1, '<urn:Me>');
|
|
39
|
+
AclManagementSteps.fillPredicate(1, '*');
|
|
40
|
+
AclManagementSteps.fillObject(1, '*');
|
|
41
|
+
AclManagementSteps.fillContext(1, '*');
|
|
42
|
+
AclManagementSteps.fillRole(1, 'TEST');
|
|
43
|
+
AclManagementSteps.selectPolicy(1, 'allow');
|
|
44
|
+
AclManagementSteps.saveRule(1);
|
|
45
|
+
// And I delete an existing rule
|
|
46
|
+
AclManagementSteps.deleteRule(5);
|
|
47
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
48
|
+
// And I click on cancel button (reverting the ACL list)
|
|
49
|
+
AclManagementSteps.cancelAclSaving();
|
|
50
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
51
|
+
// Then I expect that all changes in the ACL should be reverted
|
|
52
|
+
ApplicationSteps.getSuccessNotifications().should('be.visible');
|
|
53
|
+
AclManagementSteps.getAclRules().should('have.length', 5);
|
|
54
|
+
AclManagementSteps.checkRules(ACL);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {ACL, AclManagementSteps} from "../../../steps/setup/acl-management-steps";
|
|
2
|
+
import {ApplicationSteps} from "../../../steps/application-steps";
|
|
3
|
+
import {ModalDialogSteps} from "../../../steps/modal-dialog-steps";
|
|
4
|
+
|
|
5
|
+
describe('ACL Management: update rules', () => {
|
|
6
|
+
|
|
7
|
+
let repositoryId;
|
|
8
|
+
|
|
9
|
+
afterEach(() => {
|
|
10
|
+
cy.deleteRepository(repositoryId);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
repositoryId = 'acl-management-' + Date.now();
|
|
15
|
+
cy.createRepository({id: repositoryId});
|
|
16
|
+
cy.presetRepository(repositoryId);
|
|
17
|
+
cy.initializeRepository(repositoryId);
|
|
18
|
+
AclManagementSteps.importRules(repositoryId);
|
|
19
|
+
AclManagementSteps.visit();
|
|
20
|
+
// ensure rules are rendered
|
|
21
|
+
AclManagementSteps.getAclRules().should('have.length.gt', 0);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('Should be able to edit and save ACL', () => {
|
|
25
|
+
// Given I have opened ACL management page
|
|
26
|
+
AclManagementSteps.checkRules(ACL);
|
|
27
|
+
// When I add a new rule
|
|
28
|
+
AclManagementSteps.addRule(1);
|
|
29
|
+
AclManagementSteps.fillSubject(2, '<urn:John>');
|
|
30
|
+
AclManagementSteps.fillPredicate(2, '*');
|
|
31
|
+
AclManagementSteps.fillObject(2, '*');
|
|
32
|
+
AclManagementSteps.fillContext(2, '*');
|
|
33
|
+
AclManagementSteps.fillRole(2, 'CUSTOM_ROLE1');
|
|
34
|
+
AclManagementSteps.selectPolicy(2, 'deny');
|
|
35
|
+
AclManagementSteps.saveRule(2);
|
|
36
|
+
// And I edit an existing rule
|
|
37
|
+
AclManagementSteps.editRule(1);
|
|
38
|
+
AclManagementSteps.fillSubject(1, '<urn:Me>');
|
|
39
|
+
AclManagementSteps.fillPredicate(1, '*');
|
|
40
|
+
AclManagementSteps.fillObject(1, '*');
|
|
41
|
+
AclManagementSteps.fillContext(1, '*');
|
|
42
|
+
AclManagementSteps.fillRole(1, 'CUSTOM_TEST');
|
|
43
|
+
AclManagementSteps.selectPolicy(1, 'allow');
|
|
44
|
+
AclManagementSteps.saveRule(1);
|
|
45
|
+
// And I delete an existing rule
|
|
46
|
+
AclManagementSteps.deleteRule(5);
|
|
47
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
48
|
+
// And I save the ACL list
|
|
49
|
+
AclManagementSteps.saveAcl();
|
|
50
|
+
// Then I expect the ACL to be saved
|
|
51
|
+
ApplicationSteps.getSuccessNotifications().should('be.visible');
|
|
52
|
+
AclManagementSteps.getAclRules().should('have.length', 5);
|
|
53
|
+
const editedRule = {
|
|
54
|
+
"subject": "<urn:John>",
|
|
55
|
+
"predicate": "*",
|
|
56
|
+
"object": "*",
|
|
57
|
+
"context": "*",
|
|
58
|
+
"role": "CUSTOM_ROLE1",
|
|
59
|
+
"policy": "deny",
|
|
60
|
+
"moveUp": true,
|
|
61
|
+
"moveDown": true
|
|
62
|
+
};
|
|
63
|
+
const newRule = {
|
|
64
|
+
"subject": "<urn:Me>",
|
|
65
|
+
"predicate": "*",
|
|
66
|
+
"object": "*",
|
|
67
|
+
"context": "*",
|
|
68
|
+
"role": "CUSTOM_TEST",
|
|
69
|
+
"policy": "allow",
|
|
70
|
+
"moveUp": true,
|
|
71
|
+
"moveDown": true
|
|
72
|
+
};
|
|
73
|
+
AclManagementSteps.checkRules([ACL[0], newRule, editedRule, ACL[2], ACL[3]]);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
@@ -293,7 +293,7 @@ describe('My Settings', () => {
|
|
|
293
293
|
function visitSettingsView() {
|
|
294
294
|
cy.visit('/settings', {
|
|
295
295
|
onBeforeLoad: (win) => {
|
|
296
|
-
win.localStorage.setItem('
|
|
296
|
+
win.localStorage.setItem('ls.repository-id', repositoryId);
|
|
297
297
|
}
|
|
298
298
|
});
|
|
299
299
|
cy.window()
|
|
@@ -36,7 +36,7 @@ describe('SPARQL Templates', () => {
|
|
|
36
36
|
beforeEach(() => {
|
|
37
37
|
cy.visit('/sparql-templates', {
|
|
38
38
|
onBeforeLoad: (win) => {
|
|
39
|
-
win.localStorage.setItem('
|
|
39
|
+
win.localStorage.setItem('ls.repository-id', repositoryId);
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
cy.window()
|
|
@@ -63,6 +63,11 @@ describe('Main menu tests', function () {
|
|
|
63
63
|
visible: false,
|
|
64
64
|
redirect: '/queries'
|
|
65
65
|
},
|
|
66
|
+
{
|
|
67
|
+
name: 'Backup and Restore',
|
|
68
|
+
visible: false,
|
|
69
|
+
redirect: '/monitor/backup-and-restore'
|
|
70
|
+
},
|
|
66
71
|
{
|
|
67
72
|
name: 'System',
|
|
68
73
|
visible: false,
|
|
@@ -84,6 +89,11 @@ describe('Main menu tests', function () {
|
|
|
84
89
|
visible: false,
|
|
85
90
|
redirect: '/users'
|
|
86
91
|
},
|
|
92
|
+
{
|
|
93
|
+
name: 'ACL Management',
|
|
94
|
+
visible: false,
|
|
95
|
+
redirect: '/aclmanagement'
|
|
96
|
+
},
|
|
87
97
|
{
|
|
88
98
|
name: 'My Settings',
|
|
89
99
|
visible: false,
|
|
@@ -118,6 +128,32 @@ describe('Main menu tests', function () {
|
|
|
118
128
|
name: 'RDF Rank',
|
|
119
129
|
visible: false,
|
|
120
130
|
redirect: '/rdfrank'
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'JDBC',
|
|
134
|
+
visible: false,
|
|
135
|
+
redirect: '/jdbc'
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: 'SPARQL Templates',
|
|
139
|
+
visible: false,
|
|
140
|
+
redirect: '/sparql-templates'
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: 'License',
|
|
144
|
+
visible: false,
|
|
145
|
+
redirect: '/license'
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: 'Lab',
|
|
151
|
+
visible: true,
|
|
152
|
+
submenu: [
|
|
153
|
+
{
|
|
154
|
+
name: 'Talk to Your Graph',
|
|
155
|
+
visible: false,
|
|
156
|
+
redirect: '/chatgpt'
|
|
121
157
|
}
|
|
122
158
|
]
|
|
123
159
|
},
|
|
@@ -323,7 +323,7 @@ describe('SPARQL screen validation', () => {
|
|
|
323
323
|
openDownloadAsMenu();
|
|
324
324
|
|
|
325
325
|
getDownloadAsFormatButtons()
|
|
326
|
-
.should('have.length',
|
|
326
|
+
.should('have.length', 13)
|
|
327
327
|
.contains('JSON-LD')
|
|
328
328
|
.should('have.attr', 'data-accepts')
|
|
329
329
|
.and('include', 'application/ld+json')
|
|
@@ -36,7 +36,7 @@ describe('SPARQL Templates', () => {
|
|
|
36
36
|
beforeEach(() => {
|
|
37
37
|
cy.visit('/sparql-templates', {
|
|
38
38
|
onBeforeLoad: (win) => {
|
|
39
|
-
win.localStorage.setItem('
|
|
39
|
+
win.localStorage.setItem('ls.repository-id', repositoryId);
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
cy.window()
|
package/package.json
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export class ApplicationSteps {
|
|
2
|
+
// notifications
|
|
3
|
+
static getNotifications() {
|
|
4
|
+
return cy.get('#toast-container');
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
static getSuccessNotifications() {
|
|
8
|
+
return this.getNotifications().find('.toast-success');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
static getErrorNotifications() {
|
|
12
|
+
return this.getNotifications().find('.toast-error');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
static getInfoNotification() {
|
|
16
|
+
return this.getNotifications().find('.toast-info');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static getWarningNotification() {
|
|
20
|
+
return this.getNotifications().find('.toast-warning');
|
|
21
|
+
}
|
|
22
|
+
}
|
package/steps/import-steps.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {ModalDialogSteps} from "./modal-dialog-steps";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Reusable functions for interacting with the import page.
|
|
3
5
|
*/
|
|
@@ -30,7 +32,7 @@ class ImportSteps {
|
|
|
30
32
|
static openImportURLDialog(importURL) {
|
|
31
33
|
cy.get('#import-user .import-from-url-btn').click()
|
|
32
34
|
// Forces the popover to disappear as it covers the modal and Cypress refuses to continue
|
|
33
|
-
.trigger('
|
|
35
|
+
.trigger('mouseleave', {force: true});
|
|
34
36
|
ImportSteps.getModal()
|
|
35
37
|
.find('.url-import-form input[name="dataUrl"]')
|
|
36
38
|
.type(importURL)
|
|
@@ -42,7 +44,7 @@ class ImportSteps {
|
|
|
42
44
|
static openImportTextSnippetDialog() {
|
|
43
45
|
cy.get('#import-user .import-rdf-snippet-btn').click()
|
|
44
46
|
// Forces the popover to disappear as it covers the modal and Cypress refuses to continue
|
|
45
|
-
.trigger('
|
|
47
|
+
.trigger('mouseleave', {force: true});
|
|
46
48
|
ImportSteps.getModal().find('#wb-import-textarea').should('be.visible');
|
|
47
49
|
|
|
48
50
|
return ImportSteps;
|
|
@@ -84,8 +86,9 @@ class ImportSteps {
|
|
|
84
86
|
static removeUploadedFiles() {
|
|
85
87
|
ImportSteps.selectAllUserFiles();
|
|
86
88
|
cy.get('#wb-import-removeEntries').click();
|
|
89
|
+
ModalDialogSteps.getDialog().should('be.visible');
|
|
90
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
87
91
|
cy.get('#wb-import-fileInFiles').should('be.hidden');
|
|
88
|
-
|
|
89
92
|
return ImportSteps;
|
|
90
93
|
}
|
|
91
94
|
|