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,113 @@
|
|
|
1
|
+
export class ModalDialogSteps {
|
|
2
|
+
static getDialog() {
|
|
3
|
+
return cy.get('.modal-dialog');
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
static getDialogHeader() {
|
|
7
|
+
return ModalDialogSteps.getDialog().find('.modal-header');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
static getCloseButton() {
|
|
11
|
+
return ModalDialogSteps.getDialogHeader().find('.close');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
static clickOnCloseButton() {
|
|
15
|
+
ModalDialogSteps.getCloseButton().click();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static getDialogBody() {
|
|
19
|
+
return ModalDialogSteps.getDialog().find('.modal-body');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static verifyDialogBody(message) {
|
|
23
|
+
ModalDialogSteps.getDialogBody().contains(message);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static getDialogFooter() {
|
|
27
|
+
return ModalDialogSteps.getDialog().find('.modal-footer');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static getConfirmButton() {
|
|
31
|
+
return ModalDialogSteps.getDialogFooter().find('.confirm-btn');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static clickOnConfirmButton() {
|
|
35
|
+
ModalDialogSteps.getConfirmButton().click();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static getCancelButton() {
|
|
39
|
+
return ModalDialogSteps.getDialogFooter().find('.cancel-btn');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static clickOnCancelButton() {
|
|
43
|
+
ModalDialogSteps.getCancelButton().click();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static verifyUrlChangedConfirmation(verifyConfirmationDialogOptions = new VerifyConfirmationDialogOptions()) {
|
|
47
|
+
// and try to change the page
|
|
48
|
+
verifyConfirmationDialogOptions.changePageFunction();
|
|
49
|
+
|
|
50
|
+
// Then I expect to be asked to confirm the leaving tha page.
|
|
51
|
+
ModalDialogSteps.verifyDialogBody(verifyConfirmationDialogOptions.confirmationMessage);
|
|
52
|
+
|
|
53
|
+
// When I click on close dialog button.
|
|
54
|
+
ModalDialogSteps.clickOnCloseButton();
|
|
55
|
+
|
|
56
|
+
// Then I expect to stay on same page.
|
|
57
|
+
verifyConfirmationDialogOptions.verifyCurrentUrl();
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
// When I try to change the page again.
|
|
61
|
+
verifyConfirmationDialogOptions.changePageFunction();
|
|
62
|
+
|
|
63
|
+
// Then I expect to be asked to confirm the leaving tha page.
|
|
64
|
+
ModalDialogSteps.verifyDialogBody(verifyConfirmationDialogOptions.confirmationMessage);
|
|
65
|
+
|
|
66
|
+
// When I click on cancel dialog button.
|
|
67
|
+
ModalDialogSteps.clickOnCancelButton();
|
|
68
|
+
|
|
69
|
+
// Then I expect to stay on same page.
|
|
70
|
+
verifyConfirmationDialogOptions.verifyCurrentUrl();
|
|
71
|
+
|
|
72
|
+
// When I try to change the page again.
|
|
73
|
+
verifyConfirmationDialogOptions.changePageFunction();
|
|
74
|
+
|
|
75
|
+
// Then I expect to be asked to confirm the leaving tha page.
|
|
76
|
+
ModalDialogSteps.verifyDialogBody(verifyConfirmationDialogOptions.confirmationMessage);
|
|
77
|
+
|
|
78
|
+
// When I click on confirm dialog button.
|
|
79
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
80
|
+
|
|
81
|
+
// Then I expect to be redirected.
|
|
82
|
+
verifyConfirmationDialogOptions.verifyRedirectedUrl();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export class VerifyConfirmationDialogOptions {
|
|
87
|
+
constructor() {
|
|
88
|
+
this.changePageFunction = () => {};
|
|
89
|
+
this.confirmationMessage = "";
|
|
90
|
+
this.verifyCurrentUrl = () => {};
|
|
91
|
+
this.verifyRedirectedUrl = () => {};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
setChangePageFunction(changePageFunction) {
|
|
95
|
+
this.changePageFunction = changePageFunction;
|
|
96
|
+
return this;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
setConfirmationMessage(confirmationMessage) {
|
|
100
|
+
this.confirmationMessage = confirmationMessage;
|
|
101
|
+
return this;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
setVerifyCurrentUrl(verifyCurrentUrl) {
|
|
105
|
+
this.verifyCurrentUrl = verifyCurrentUrl;
|
|
106
|
+
return this;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
setVerifyRedirectedUrl(verifyRedirectedUrl) {
|
|
110
|
+
this.verifyRedirectedUrl = verifyRedirectedUrl;
|
|
111
|
+
return this;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class BackupAndRestoreSteps {
|
|
2
|
+
|
|
3
|
+
static visit() {
|
|
4
|
+
cy.visit('/monitor/backup-and-restore');
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
static getInfoMessageElement() {
|
|
8
|
+
return cy.get('.no-running-backup-and-restore-alert');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
static getBackupAndRestoreResults() {
|
|
12
|
+
return cy.get('.backup-and-restore table tbody tr');
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export class OperationsStatusesComponentSteps {
|
|
2
|
+
|
|
3
|
+
static getOperationsStatusesComponent() {
|
|
4
|
+
return cy.get('.operations-statuses');
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
static getOperationStatuses() {
|
|
8
|
+
return cy.get('.operation-status-content');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
static openOperationStatusesDialog() {
|
|
12
|
+
OperationsStatusesComponentSteps.getOperationsStatusesComponent().click();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
static checkOperationElementUrl(expectedUrl, operationIndex = 0) {
|
|
16
|
+
OperationsStatusesComponentSteps.getOperationStatuses().eq(operationIndex).then(($operationElement) => {
|
|
17
|
+
expect($operationElement).to.have.attr('target', '_blank');
|
|
18
|
+
expect($operationElement).to.have.attr('href', expectedUrl);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
export class AclManagementSteps {
|
|
2
|
+
static visit() {
|
|
3
|
+
cy.visit('/aclmanagement');
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
static getPage() {
|
|
7
|
+
return cy.get('.acl-management-view');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
static getPageHeading() {
|
|
11
|
+
return this.getPage().find('#acl-management-view-title');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
static getAclTable() {
|
|
15
|
+
return this.getPage().find('.acl-rules');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static getAclRules() {
|
|
19
|
+
return this.getAclTable().find('tbody tr.acl-rule');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static getAddFirstRuleButton() {
|
|
23
|
+
return this.getAclTable().find('.toolbar .add-rule-btn').scrollIntoView();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static getRule(index) {
|
|
27
|
+
return this.getAclRules().eq(index);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static importRules(repositoryId) {
|
|
31
|
+
return cy.request({
|
|
32
|
+
method: 'POST',
|
|
33
|
+
url: `/rest/repositories/${repositoryId}/acl`,
|
|
34
|
+
body: ACL
|
|
35
|
+
}).then((response) => {
|
|
36
|
+
cy.waitUntil(() => response && response.status === 201);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static getMoveUpButton(index) {
|
|
41
|
+
return this.getAclRules().eq(index).find('td:nth-child(2) .move-up-btn');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static moveRuleUp(index) {
|
|
45
|
+
this.getMoveUpButton(index).click();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
static getMoveDownButton(index) {
|
|
49
|
+
return this.getAclRules().eq(index).find('td:nth-child(2) .move-down-btn');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static moveRuleDown(index) {
|
|
53
|
+
this.getMoveDownButton(index).click();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
static getNoDataMessage() {
|
|
57
|
+
return this.getAclTable().find('.no-data');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
static addRuleInBeginning() {
|
|
61
|
+
this.getAddFirstRuleButton().click();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
static getAddRuleButton(index) {
|
|
65
|
+
return this.getRule(index).find('.add-rule-btn');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
static addRule(index) {
|
|
69
|
+
this.getAddRuleButton(index).click();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
static getEditRuleButton(index) {
|
|
73
|
+
return this.getRule(index).find('.edit-rule-btn');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
static editRule(index) {
|
|
77
|
+
this.getEditRuleButton(index).click();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
static getDeleteRuleButton(index) {
|
|
81
|
+
return this.getRule(index).find('.delete-rule-btn');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
static deleteRule(index) {
|
|
85
|
+
this.getDeleteRuleButton(index).click();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
static getCancelRuleEditingButton(index) {
|
|
89
|
+
return this.getAclRules().eq(index).find('.cancel-rule-editing-btn');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
static cancelRuleEditing(index) {
|
|
93
|
+
this.getCancelRuleEditingButton(index).click();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
static getSaveRuleButton(index) {
|
|
97
|
+
return this.getRule(index).find('.save-rule-btn');
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
static getSaveRuleDisabledButton(index) {
|
|
101
|
+
return this.getRule(index).find('.save-rule-disabled-btn');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
static saveRule(index) {
|
|
105
|
+
this.getSaveRuleButton(index).click();
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
static getSubjectField(index) {
|
|
109
|
+
return this.getRule(index).find('.subject-cell input');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
static fillSubject(index, value) {
|
|
113
|
+
this.getSubjectField(index).clear().type(value);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
static getPredicateField(index) {
|
|
117
|
+
return this.getRule(index).find('.predicate-cell input');
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
static fillPredicate(index, value) {
|
|
121
|
+
this.getPredicateField(index).clear().type(value);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
static getObjectField(index) {
|
|
125
|
+
return this.getRule(index).find('.object-cell input');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
static fillObject(index, value) {
|
|
129
|
+
this.getObjectField(index).clear().type(value);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
static getContextField(index) {
|
|
133
|
+
return this.getRule(index).find('.context-cell input');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
static fillContext(index, value) {
|
|
137
|
+
this.getContextField(index).clear().type(value);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
static getRoleField(index) {
|
|
141
|
+
return this.getRule(index).find('.role-cell input');
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
static fillRole(index, value) {
|
|
145
|
+
this.getRoleField(index).clear().type(value);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
static getPolicySelectorField(index) {
|
|
149
|
+
return this.getRule(index).find('.policy-cell select');
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
static selectPolicy(index, value) {
|
|
153
|
+
this.getPolicySelectorField(index).select(value);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
static getMoveUpButtons() {
|
|
157
|
+
return this.getAclTable().find('.move-up-btn');
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
static getMoveDownButtons() {
|
|
161
|
+
return this.getAclTable().find('.move-down-btn');
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
static deleteRuleButtons() {
|
|
165
|
+
return this.getAclTable().find('.delete-rule-btn');
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
static editRuleButtons() {
|
|
169
|
+
return this.getAclTable().find('.edit-rule-btn');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
static createRuleButtons() {
|
|
173
|
+
return this.getAclTable().find('.add-rule-btn');
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
static getSaveAclButton() {
|
|
177
|
+
return this.getPage().find('.save-acl-btn');
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
static saveAcl() {
|
|
181
|
+
this.getSaveAclButton().click();
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
static getCancelAclSavingButton() {
|
|
185
|
+
return this.getPage().find('.cancel-acl-save-btn');
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
static cancelAclSaving() {
|
|
189
|
+
this.getCancelAclSavingButton().click();
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
static checkRules(rules = []) {
|
|
193
|
+
rules.forEach((rule, index) => {
|
|
194
|
+
AclManagementSteps.getRule(index).within(() => {
|
|
195
|
+
cy.get('td:nth-child(1)').should('contain.text', index);
|
|
196
|
+
const moveUpVisibilityCommand = index > 0 ? 'be.visible' : 'not.exist';
|
|
197
|
+
cy.get('td:nth-child(2)').scrollIntoView().find('.move-up-btn').should(moveUpVisibilityCommand);
|
|
198
|
+
const moveDownVisibilityCommand = index < rules.length - 1 ? 'be.visible' : 'not.exist';
|
|
199
|
+
cy.get('td:nth-child(2)').scrollIntoView().find('.move-down-btn').should(moveDownVisibilityCommand);
|
|
200
|
+
cy.get('td:nth-child(3)').should('contain.text', rule.subject);
|
|
201
|
+
cy.get('td:nth-child(4)').should('contain.text', rule.predicate);
|
|
202
|
+
cy.get('td:nth-child(5)').should('contain.text', rule.object);
|
|
203
|
+
cy.get('td:nth-child(6)').should('contain.text', rule.context);
|
|
204
|
+
cy.get('td:nth-child(7)').should('contain.text', rule.role);
|
|
205
|
+
cy.get('td:nth-child(8)').should('contain.text', rule.policy);
|
|
206
|
+
cy.get('td:nth-child(9)').scrollIntoView().find('.delete-rule-btn').should('be.visible');
|
|
207
|
+
cy.get('td:nth-child(9)').scrollIntoView().find('.edit-rule-btn').should('be.visible');
|
|
208
|
+
cy.get('td:nth-child(9)').scrollIntoView().find('.add-rule-btn').should('be.visible');
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
static checkRuleEditForm(index, ruleData) {
|
|
214
|
+
AclManagementSteps.getSubjectField(index).should('have.value', ruleData.subject);
|
|
215
|
+
AclManagementSteps.getPredicateField(index).should('have.value', ruleData.predicate);
|
|
216
|
+
AclManagementSteps.getObjectField(index).should('have.value', ruleData.object);
|
|
217
|
+
AclManagementSteps.getContextField(index).should('have.value', ruleData.context);
|
|
218
|
+
AclManagementSteps.getRoleField(index).should('have.value', ruleData.role);
|
|
219
|
+
AclManagementSteps.getPolicySelectorField(index).should('have.value', ruleData.policy);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
static checkIfRuleSavingIsForbidden(index) {
|
|
223
|
+
AclManagementSteps.getSaveRuleButton(index).should('not.exist');
|
|
224
|
+
AclManagementSteps.getSaveRuleDisabledButton(index).should('be.visible');
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
static checkIfRuleSavingIsAllowed(index) {
|
|
228
|
+
AclManagementSteps.getSaveRuleButton(index).should('be.visible');
|
|
229
|
+
AclManagementSteps.getSaveRuleDisabledButton(index).should('not.exist');
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export const ACL = [
|
|
234
|
+
{
|
|
235
|
+
"subject": "<urn:Mary>",
|
|
236
|
+
"predicate": "*",
|
|
237
|
+
"object": "*",
|
|
238
|
+
"context": "*",
|
|
239
|
+
"role": "!CUSTOM_ROLE2",
|
|
240
|
+
"policy": "allow"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"subject": "*",
|
|
244
|
+
"predicate": "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>",
|
|
245
|
+
"object": "*",
|
|
246
|
+
"context": "*",
|
|
247
|
+
"role": "CUSTOM_ROLE1",
|
|
248
|
+
"policy": "deny"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"subject": "<<<http://example.com/test> <http://www.w3.org/2000/01/rdf-schema#label> \"test aber auf Deutsch\"@de>>",
|
|
252
|
+
"predicate": "*",
|
|
253
|
+
"object": "\"test aber auf Deutsch\"@en",
|
|
254
|
+
"context": "<http://example.com/graph1>",
|
|
255
|
+
"role": "CUSTOM_ROLE3",
|
|
256
|
+
"policy": "deny"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"subject": "*",
|
|
260
|
+
"predicate": "*",
|
|
261
|
+
"object": "\"15\"^^<http://www.w3.org/2001/XMLSchema#int>",
|
|
262
|
+
"context": "*",
|
|
263
|
+
"role": "CUSTOM_ROLE3",
|
|
264
|
+
"policy": "allow"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"subject": "<urn:Cat>",
|
|
268
|
+
"predicate": "*",
|
|
269
|
+
"object": "<<<http://example.com/test> <http://www.w3.org/2000/01/rdf-schema#label> \"test aber auf Deutsch\"@de>>",
|
|
270
|
+
"context": "*",
|
|
271
|
+
"role": "CUSTOM_ROLE4",
|
|
272
|
+
"policy": "deny"
|
|
273
|
+
}
|
|
274
|
+
];
|
package/steps/sparql-steps.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {Stubs} from "./stubs";
|
|
2
|
+
|
|
3
|
+
export class BackupAndRestoreStubs extends Stubs {
|
|
4
|
+
static stubBackupAndRestoreResponse(withDelay = 0) {
|
|
5
|
+
BackupAndRestoreStubs.stubQueryResponse('/rest/monitor/backup', '/monitoring/backup-and-restore.json', 'backup-and-restore-response', withDelay);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {Stubs} from "./stubs";
|
|
2
|
+
|
|
3
|
+
export class GlobalOperationsStatusesStub extends Stubs {
|
|
4
|
+
static stubGlobalOperationsStatusesResponse(repositoryId, withDelay = 0) {
|
|
5
|
+
GlobalOperationsStatusesStub.stubQueryResponse(`/rest/monitor/${repositoryId}/operations`, '/monitoring/global-operation-statuses.json', 'backup-and-restore-response', withDelay);
|
|
6
|
+
}
|
|
7
|
+
}
|
package/stubs/stubs.js
ADDED
|
@@ -3,7 +3,7 @@ import repoTemplate from '../fixtures/repo-template.json';
|
|
|
3
3
|
export const REPOSITORIES_URL = '/rest/repositories/';
|
|
4
4
|
const AUTOCOMPLETE_URL = '/rest/autocomplete/';
|
|
5
5
|
|
|
6
|
-
const PRESET_REPO = '
|
|
6
|
+
const PRESET_REPO = 'ls.repository-id';
|
|
7
7
|
|
|
8
8
|
Cypress.Commands.add('createRepository', (options = {}) => {
|
|
9
9
|
cy.request({
|
|
@@ -21,14 +21,19 @@ Cypress.Commands.add('createRepository', (options = {}) => {
|
|
|
21
21
|
Cypress.Commands.add('deleteRepository', (id) => {
|
|
22
22
|
// Note: Going through /rest/repositories because it would not fail if the repo is missing
|
|
23
23
|
const url = REPOSITORIES_URL + id;
|
|
24
|
-
cy.request(
|
|
24
|
+
cy.request({
|
|
25
|
+
method: 'DELETE',
|
|
26
|
+
url: url,
|
|
27
|
+
// Prevent Cypress from failing the test on non-2xx status codes
|
|
28
|
+
failOnStatusCode: false
|
|
29
|
+
})
|
|
25
30
|
.then((response) => {
|
|
26
31
|
cy.waitUntil(() => response && response.status === 200);
|
|
27
32
|
});
|
|
28
33
|
});
|
|
29
34
|
|
|
30
35
|
Cypress.Commands.add('presetRepository', (id) => {
|
|
31
|
-
cy.setLocalStorage('
|
|
36
|
+
cy.setLocalStorage('ls.repository-id', id);
|
|
32
37
|
cy.waitUntil(() =>
|
|
33
38
|
cy.getLocalStorage(PRESET_REPO)
|
|
34
39
|
.then((preset) => preset && preset === id));
|