@digital-ai/devops-page-object-release 0.0.11 → 0.0.13
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/CHANGELOG.md +19 -0
- package/dist/main.js +2108 -1472
- package/dist/main.js.map +1 -1
- package/dist/module.js +959 -323
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +261 -138
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/module.js
CHANGED
|
@@ -15,141 +15,6 @@ import $hOLA6$lodashtoPairs from "lodash/toPairs";
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
const $f86fbaaa8b4e8c61$export$45f0aca2596a2bb3 = function() {
|
|
20
|
-
const RELEASE_TYPE = "xlrelease.Release";
|
|
21
|
-
const PHASE_TYPE = "xlrelease.Phase";
|
|
22
|
-
const TEAM_TYPE = "xlrelease.Team";
|
|
23
|
-
const TASK_TYPE = "xlrelease.Task";
|
|
24
|
-
const COMMENT_TYPE = "xlrelease.Comment";
|
|
25
|
-
const CONDITION_TYPE = "xlrelease.GateCondition";
|
|
26
|
-
const DEPENDENCY_TYPE = "xlrelease.Dependency";
|
|
27
|
-
const LINK_TYPE = "xlrelease.Link";
|
|
28
|
-
const ATTACHMENT_TYPE = "xlrelease.Attachment";
|
|
29
|
-
const DASHBOARD_TYPE = "xlrelease.Dashboard";
|
|
30
|
-
const _TRIGGER_TYPE = "xlrelease.ReleaseTrigger";
|
|
31
|
-
const JIRA_TYPE = "jira.CreateIssue";
|
|
32
|
-
const DEFAULT_TASK_OWNER = "Itchy";
|
|
33
|
-
const processTasks = (task, container, index)=>{
|
|
34
|
-
if ((0, $hOLA6$lodashisUndefined)(task.type)) task.type = TASK_TYPE;
|
|
35
|
-
task.id = task.id || `${container.id}/Task${index}`;
|
|
36
|
-
if ((0, $hOLA6$lodashisUndefined)(task.owner) && task.type !== JIRA_TYPE) task.owner = DEFAULT_TASK_OWNER;
|
|
37
|
-
if (task.owner === null) delete task.owner;
|
|
38
|
-
(0, $hOLA6$lodasheach)(task.conditions, function(condition, idx) {
|
|
39
|
-
condition.type = CONDITION_TYPE;
|
|
40
|
-
condition.id = `${task.id}/GateCondition${idx}`;
|
|
41
|
-
});
|
|
42
|
-
(0, $hOLA6$lodasheach)(task.dependencies, function(dependency, idx) {
|
|
43
|
-
dependency.type = DEPENDENCY_TYPE;
|
|
44
|
-
dependency.id = `${task.id}/Dependency${idx}`;
|
|
45
|
-
});
|
|
46
|
-
(0, $hOLA6$lodasheach)(task.links, function(link, idx) {
|
|
47
|
-
link.type = LINK_TYPE;
|
|
48
|
-
link.id = `${task.id}/Link${idx}`;
|
|
49
|
-
});
|
|
50
|
-
(0, $hOLA6$lodasheach)(task.comments, function(comment, idx) {
|
|
51
|
-
comment.type = COMMENT_TYPE;
|
|
52
|
-
comment.id = `${task.id}/Comment${idx}`;
|
|
53
|
-
});
|
|
54
|
-
(0, $hOLA6$lodasheach)(task.tasks, function(subTask, idx) {
|
|
55
|
-
processTasks(subTask, task, idx);
|
|
56
|
-
});
|
|
57
|
-
(0, $hOLA6$lodasheach)(task.templateVariables, function(variable, idx) {
|
|
58
|
-
(0, $hOLA6$lodashdefaults)(variable, getVariableEntity(variable.value, variable.key, task.id, idx));
|
|
59
|
-
});
|
|
60
|
-
(0, $hOLA6$lodasheach)(task.attachments, function(attachment, idx) {
|
|
61
|
-
attachment.type = ATTACHMENT_TYPE;
|
|
62
|
-
attachment.id = `${task.id}/Attachment${idx}`;
|
|
63
|
-
});
|
|
64
|
-
if (task.pythonScript) {
|
|
65
|
-
const pythonScript = task.pythonScript;
|
|
66
|
-
pythonScript.id = `${task.id}/PythonScript`;
|
|
67
|
-
pythonScript.customScriptTask = task.id;
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
const processPhases = (phase, release, index)=>{
|
|
71
|
-
phase.type = PHASE_TYPE;
|
|
72
|
-
phase.id = `${release.id}/Phase${index}`;
|
|
73
|
-
(0, $hOLA6$lodashforEach)(phase.tasks, (task, idx)=>{
|
|
74
|
-
processTasks(task, phase, idx);
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
const getVariableEntity = (value, key, containerId, index, password)=>{
|
|
78
|
-
const keyNoSyntax = key.replace("${", "").replace("}", "");
|
|
79
|
-
return {
|
|
80
|
-
id: `${containerId}/Variable${index}`,
|
|
81
|
-
key: keyNoSyntax,
|
|
82
|
-
requiresValue: true,
|
|
83
|
-
showOnReleaseStart: true,
|
|
84
|
-
type: password ? "xlrelease.PasswordStringVariable" : "xlrelease.StringVariable",
|
|
85
|
-
value: value
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
const getValueProviderConfigurationEntity = function(containerId) {
|
|
89
|
-
return {
|
|
90
|
-
id: `${containerId}/valueProvider`,
|
|
91
|
-
variable: containerId
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
const getDashboardExtension = (dashboard, releaseId)=>{
|
|
95
|
-
const dashboardExtension = {
|
|
96
|
-
id: `${releaseId}/summary`,
|
|
97
|
-
type: DASHBOARD_TYPE,
|
|
98
|
-
tiles: []
|
|
99
|
-
};
|
|
100
|
-
if (dashboard.tiles) (0, $hOLA6$lodashforEach)(dashboard.tiles, function(tile, index) {
|
|
101
|
-
dashboardExtension.tiles.push(getTileEntity(tile, `${releaseId}/summary`, index));
|
|
102
|
-
});
|
|
103
|
-
return dashboardExtension;
|
|
104
|
-
};
|
|
105
|
-
function getTileEntity(tile, containerId, index) {
|
|
106
|
-
tile.id = tile.id || `${containerId}/Tile${index}`;
|
|
107
|
-
return tile;
|
|
108
|
-
}
|
|
109
|
-
return function(release) {
|
|
110
|
-
release.type = RELEASE_TYPE;
|
|
111
|
-
if (release.id.indexOf("Applications/") === -1) release.id = `Applications/${release.id}`;
|
|
112
|
-
if (release.startDate) release.queryableStartDate = release.startDate;
|
|
113
|
-
else if (release.scheduledStartDate) release.queryableStartDate = release.scheduledStartDate;
|
|
114
|
-
if (release.endDate) release.queryableEndDate = release.endDate;
|
|
115
|
-
else if (release.dueDate) release.queryableEndDate = release.dueDate;
|
|
116
|
-
if ((0, $hOLA6$lodashisUndefined)(release.owner)) release.owner = "Itchy"; // default release manager
|
|
117
|
-
(0, $hOLA6$lodashforEach)(release.phases, function(phase, index) {
|
|
118
|
-
processPhases(phase, release, index);
|
|
119
|
-
});
|
|
120
|
-
(0, $hOLA6$lodashforEach)(release.teams, function(team, index) {
|
|
121
|
-
team.type = TEAM_TYPE;
|
|
122
|
-
team.id = `${release.id}/Team${index}`;
|
|
123
|
-
});
|
|
124
|
-
(0, $hOLA6$lodashforEach)(release.attachments, function(attachment, index) {
|
|
125
|
-
attachment.type = ATTACHMENT_TYPE;
|
|
126
|
-
attachment.id = `${release.id}/Attachment${index}`;
|
|
127
|
-
});
|
|
128
|
-
(0, $hOLA6$lodashforEach)(release.variables, function(variable, index) {
|
|
129
|
-
(0, $hOLA6$lodashdefaults)(variable, getVariableEntity(variable.value, variable.key, release.id, index));
|
|
130
|
-
if (variable.valueProvider) (0, $hOLA6$lodashdefaults)(variable.valueProvider, getValueProviderConfigurationEntity(variable.id));
|
|
131
|
-
});
|
|
132
|
-
(0, $hOLA6$lodashforEach)((0, $hOLA6$lodashtoPairs)(release.variableValues), function(keyValue, index) {
|
|
133
|
-
if (!release.variables) release.variables = [];
|
|
134
|
-
release.variables.push(getVariableEntity(keyValue[1], keyValue[0], release.id, 1000 + index));
|
|
135
|
-
release.variableValues = undefined;
|
|
136
|
-
});
|
|
137
|
-
(0, $hOLA6$lodashforEach)((0, $hOLA6$lodashtoPairs)(release.passwordVariableValues), function(keyValue, index) {
|
|
138
|
-
if (!release.variables) release.variables = [];
|
|
139
|
-
release.variables.push(getVariableEntity(keyValue[1], keyValue[0], release.id, 1500 + index, true));
|
|
140
|
-
release.passwordVariableValues = undefined;
|
|
141
|
-
});
|
|
142
|
-
if (release.summary) {
|
|
143
|
-
release.extensions = [
|
|
144
|
-
getDashboardExtension(release.summary, release.id)
|
|
145
|
-
];
|
|
146
|
-
release.summary = undefined;
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
}();
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
18
|
class $9626bc9256ce31f7$export$2b65d1d97338f32b {
|
|
154
19
|
constructor(page){
|
|
155
20
|
this.page = page;
|
|
@@ -157,60 +22,12 @@ class $9626bc9256ce31f7$export$2b65d1d97338f32b {
|
|
|
157
22
|
}
|
|
158
23
|
|
|
159
24
|
|
|
160
|
-
class $
|
|
161
|
-
/**
|
|
162
|
-
* Login with username and password
|
|
163
|
-
* @param userName
|
|
164
|
-
* @param password
|
|
165
|
-
*/ async login(userName, password) {
|
|
166
|
-
await this.page.goto("./#/login");
|
|
167
|
-
await this.page.waitForTimeout(1000);
|
|
168
|
-
await (0, $hOLA6$expect)(this.page).toHaveTitle("Digital.ai Release");
|
|
169
|
-
await this.page.getByPlaceholder("User").fill(userName, {
|
|
170
|
-
timeout: 1000
|
|
171
|
-
});
|
|
172
|
-
await this.page.getByPlaceholder("Password").fill(password, {
|
|
173
|
-
timeout: 10000
|
|
174
|
-
});
|
|
175
|
-
await this.page.getByRole("button", {
|
|
176
|
-
name: "Log in"
|
|
177
|
-
}).click({
|
|
178
|
-
timeout: 10000
|
|
179
|
-
});
|
|
180
|
-
await (0, $hOLA6$expect)(this.page).toHaveTitle("Home - Digital.ai Release");
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Logout as authenticated user
|
|
184
|
-
*/ async logout() {
|
|
185
|
-
await this.page.locator("button.dot-avatar").click();
|
|
186
|
-
await this.page.getByText("Log out", {
|
|
187
|
-
exact: true
|
|
188
|
-
}).click();
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Expect login to be restricted for a user
|
|
192
|
-
*/ async expectLoginDisallowed() {
|
|
193
|
-
const val = await this.page.textContent('.error-content span[ng-show="loginInfo.failedStatus == 403"]');
|
|
194
|
-
(0, $hOLA6$expect)(val).toContain("You do not have 'login' permission.");
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Expect the respective user is logged In
|
|
198
|
-
* @param username
|
|
199
|
-
*/ async expectToBeLogged(username) {
|
|
200
|
-
const val = await this.page.locator("top-toolbar .avatar-wrapper span.dot-tooltip").getAttribute("aria-label");
|
|
201
|
-
(0, $hOLA6$expect)(val).toContain(username);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
class $d2ac4753e13169c7$export$a678525e79c4ccc4 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
|
|
25
|
+
class $5359280e98d97ff9$export$a678525e79c4ccc4 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
|
|
212
26
|
async expectNumberOfReleases(releaseTitle, amount) {
|
|
213
|
-
|
|
27
|
+
await this.filterReleaseByTitle(releaseTitle);
|
|
28
|
+
if (amount === 1) await (0, $hOLA6$expect)(this.page.locator(".release").getByText(releaseTitle)).toBeVisible({
|
|
29
|
+
timeout: 5000
|
|
30
|
+
});
|
|
214
31
|
else await (0, $hOLA6$expect)(this.page.locator(".release").getByText(releaseTitle).count()).toBe(amount);
|
|
215
32
|
}
|
|
216
33
|
async openReleaseByName(releaseTitle) {
|
|
@@ -219,6 +36,12 @@ class $d2ac4753e13169c7$export$a678525e79c4ccc4 extends (0, $9626bc9256ce31f7$ex
|
|
|
219
36
|
}).click();
|
|
220
37
|
return new (0, $43cbcdfccb6c2a76$export$f43492e8ac3c566)(this.page);
|
|
221
38
|
}
|
|
39
|
+
async filterReleaseByTitle(releaseTitle) {
|
|
40
|
+
await this.page.locator(".toggle-search-filter").click();
|
|
41
|
+
await this.page.locator(".searchFilter").fill(releaseTitle);
|
|
42
|
+
await this.page.locator(".searchFilter").press("Enter");
|
|
43
|
+
await (0, $hOLA6$expect)(this.page.locator(".release").getByText(releaseTitle)).toBeVisible();
|
|
44
|
+
}
|
|
222
45
|
}
|
|
223
46
|
|
|
224
47
|
|
|
@@ -229,7 +52,7 @@ class $862f65268e488e83$export$fb932093f944abe4 extends (0, $9626bc9256ce31f7$ex
|
|
|
229
52
|
await this.page.locator(".popover-content xlr-context-menu a", {
|
|
230
53
|
hasText: "View releases"
|
|
231
54
|
}).click();
|
|
232
|
-
return new (0, $
|
|
55
|
+
return new (0, $5359280e98d97ff9$export$a678525e79c4ccc4)(this.page);
|
|
233
56
|
}
|
|
234
57
|
async openContextMenu(title) {
|
|
235
58
|
await (0, $hOLA6$expect)(async ()=>{
|
|
@@ -394,63 +217,416 @@ class $3fa741329d8067d5$export$d4865631ba74f3e2 extends (0, $9626bc9256ce31f7$ex
|
|
|
394
217
|
}
|
|
395
218
|
|
|
396
219
|
|
|
397
|
-
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
class $90bb70a7e909e500$export$519356f6c50361f7 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
|
|
398
223
|
constructor(page){
|
|
399
224
|
super(page);
|
|
400
|
-
this.
|
|
401
|
-
this.
|
|
402
|
-
name: "Retry"
|
|
403
|
-
});
|
|
404
|
-
this.cancelButton = this.page.getByTestId("task-action-cancel");
|
|
405
|
-
this.commentBox = this.page.getByTestId("task-action-comment");
|
|
406
|
-
this.confirm = this.page.getByTestId("task-action-confirm");
|
|
407
|
-
this.config = new (0, $e44e9af564fb00f7$export$64c93bc7fb9ca44e)(page);
|
|
408
|
-
this.condition = new (0, $3fa741329d8067d5$export$d4865631ba74f3e2)(page);
|
|
409
|
-
this.skipMenu = this.page.getByRole("menuitem", {
|
|
410
|
-
name: "Skip"
|
|
411
|
-
});
|
|
412
|
-
}
|
|
413
|
-
async openOverviewRail() {
|
|
414
|
-
await this.openRail("Overview");
|
|
225
|
+
this.railLocator = this.page.locator("task-drawer .dot-drawer .task-drawer-content");
|
|
226
|
+
this.dependency = new $90bb70a7e909e500$export$fbbf45eff21470e3(page);
|
|
415
227
|
}
|
|
416
|
-
async
|
|
417
|
-
await this.
|
|
228
|
+
async openInputProperties() {
|
|
229
|
+
await this.railLocator.locator(".task-config-header").getByText("Input properties").click();
|
|
418
230
|
}
|
|
419
|
-
async
|
|
420
|
-
await this.
|
|
231
|
+
async openOutputProperties() {
|
|
232
|
+
await this.railLocator.locator(".task-config-header").getByText("Output properties").click();
|
|
421
233
|
}
|
|
422
|
-
async
|
|
423
|
-
|
|
234
|
+
async getValueFromCi(propertyName) {
|
|
235
|
+
return this.railLocator.locator(`input[id="${propertyName}"]`).inputValue();
|
|
424
236
|
}
|
|
425
|
-
async
|
|
426
|
-
await this.
|
|
237
|
+
async getAllOptionsFromCi(propertyName) {
|
|
238
|
+
await this.railLocator.locator(`input[id="${propertyName}"]`).click();
|
|
239
|
+
return this.railLocator.locator(`.dot-popper ul li`).allInnerTexts();
|
|
427
240
|
}
|
|
428
|
-
async
|
|
429
|
-
await this.
|
|
241
|
+
async setValueFromCi(propertyName, value) {
|
|
242
|
+
await this.railLocator.locator(`input[id="${propertyName}"]`).clear();
|
|
243
|
+
await this.railLocator.locator(`input[id="${propertyName}"]`).click();
|
|
244
|
+
await this.railLocator.locator(`.dot-popper ul li`, {
|
|
245
|
+
hasText: value
|
|
246
|
+
}).click();
|
|
430
247
|
}
|
|
431
|
-
async
|
|
432
|
-
await this.
|
|
248
|
+
async getValueFromString(propertyName) {
|
|
249
|
+
await this.railLocator.locator(`.input-scalar-fake-input[id="${propertyName}"]`).focus();
|
|
250
|
+
return this.railLocator.locator(`input[id="${propertyName}"]`).inputValue();
|
|
433
251
|
}
|
|
434
|
-
async
|
|
435
|
-
await this.
|
|
252
|
+
async setValueFromString(propertyName, value) {
|
|
253
|
+
await this.railLocator.locator(`.input-scalar-fake-input[id="${propertyName}"]`).focus();
|
|
254
|
+
await this.railLocator.locator(`input[id="${propertyName}"]`).fill(value);
|
|
436
255
|
}
|
|
437
|
-
async
|
|
438
|
-
await this.
|
|
256
|
+
async setValueFromLargeString(propertyName, value) {
|
|
257
|
+
await this.railLocator.locator(`.input-scalar-fake-input[id="${propertyName}"]`).focus();
|
|
258
|
+
await this.railLocator.locator(`textarea[id="${propertyName}"]`).fill(value);
|
|
439
259
|
}
|
|
440
|
-
async
|
|
441
|
-
await this.
|
|
442
|
-
await this.commentBox.fill(comment);
|
|
443
|
-
await this.confirm.click();
|
|
260
|
+
async setValueFromPassword(propertyName, value) {
|
|
261
|
+
await this.railLocator.locator(`input[id="${propertyName}"]`).fill(value);
|
|
444
262
|
}
|
|
445
|
-
async
|
|
446
|
-
await this.
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
263
|
+
async setAndCreateVariable(propertyName, variableName) {
|
|
264
|
+
await this.railLocator.locator(`input[id="${propertyName}"]`).clear();
|
|
265
|
+
await this.railLocator.locator(`input[id="${propertyName}"]`).click();
|
|
266
|
+
await this.railLocator.locator(`input[id="${propertyName}"]`).fill(variableName);
|
|
267
|
+
await this.railLocator.locator(`.dot-popper button`, {
|
|
268
|
+
hasText: variableName
|
|
269
|
+
}).click();
|
|
270
|
+
}
|
|
271
|
+
async setVariable(propertyName, variableName) {
|
|
272
|
+
return this.setValueFromCi(propertyName, variableName);
|
|
273
|
+
}
|
|
274
|
+
async expectValueFromString(propertyName, propertyValue) {
|
|
275
|
+
return await (0, $hOLA6$expect)(this.railLocator.locator(`.input-scalar-fake-input[id="${propertyName}"]`)).toHaveText(propertyValue);
|
|
276
|
+
}
|
|
277
|
+
async setValueFromMap(propertyName, key, value) {
|
|
278
|
+
await this.railLocator.locator(`.input-with-map[data-test-id="${propertyName}"] button.add-new-button`).click();
|
|
279
|
+
await this.railLocator.locator(`.input-with-map[data-test-id="${propertyName}"] input[id="new-row-key-input"]`).fill(key);
|
|
280
|
+
await this.railLocator.locator(`.input-with-map[data-test-id="${propertyName}"] input[id="new-row-value-input"]`).fill(value);
|
|
281
|
+
await this.railLocator.locator(`.input-with-map[data-test-id="${propertyName}"] button.map-row-save-button`).click();
|
|
282
|
+
}
|
|
283
|
+
async setScript(script) {
|
|
284
|
+
await this.page.locator(".code-editor textarea.ace_text-input").clear();
|
|
285
|
+
await this.page.locator(".code-editor textarea.ace_text-input").fill(script);
|
|
286
|
+
await this.page.locator('.code-editor .header button:has-text("Save")').click();
|
|
287
|
+
}
|
|
288
|
+
async expectScriptToContain(script) {
|
|
289
|
+
await (0, $hOLA6$expect)(this.page.locator(".code-editor .ace_content")).toContainText(script);
|
|
290
|
+
}
|
|
291
|
+
async enterScriptForAutoComplete(script) {
|
|
292
|
+
await this.page.locator(".code-editor textarea.ace_text-input").clear();
|
|
293
|
+
await this.page.locator(".code-editor textarea.ace_text-input").fill(script);
|
|
294
|
+
await this.page.locator(".code-editor textarea.ace_text-input").press(".");
|
|
295
|
+
}
|
|
296
|
+
async openScriptEditorInSeparateWindow() {
|
|
297
|
+
await this.page.getByTestId("fullscreen-enter-btn").click();
|
|
298
|
+
(0, $hOLA6$expect)(this.page.locator("#dialogTitle")).toBeVisible();
|
|
299
|
+
}
|
|
300
|
+
async closeFullscreenScriptWindowWithESC() {
|
|
301
|
+
await this.page.locator("#dialogTitle").press("Escape");
|
|
302
|
+
(0, $hOLA6$expect)(this.page.locator("#dialogTitle")).not.toBeVisible();
|
|
303
|
+
}
|
|
304
|
+
async closeFullscreenScriptWindow() {
|
|
305
|
+
await this.page.getByTestId("fullscreen-exit-btn").click();
|
|
306
|
+
(0, $hOLA6$expect)(this.page.locator("#dialogTitle")).not.toBeVisible();
|
|
307
|
+
}
|
|
308
|
+
async abort(comment) {
|
|
309
|
+
await this.page.getByTestId("single-action-button").click();
|
|
310
|
+
await this.page.getByTestId("task-action-comment").click();
|
|
311
|
+
await this.page.getByTestId("task-action-comment").fill(comment);
|
|
312
|
+
await this.page.getByTestId("task-action-confirm").click();
|
|
313
|
+
}
|
|
314
|
+
async expectDependenciesDisplayed(dependencies) {
|
|
315
|
+
await this.railLocator.locator(".gate-task-dependencies").waitFor();
|
|
316
|
+
for(let i = 0; i < dependencies.length; i++)await (0, $hOLA6$expect)(this.page.locator(".dependency").filter({
|
|
317
|
+
hasText: dependencies[i]
|
|
318
|
+
})).toBeVisible();
|
|
319
|
+
}
|
|
320
|
+
async expectCanDeleteDependency(title, canDelete = true) {
|
|
321
|
+
if (canDelete) {
|
|
322
|
+
const locat = this.page.locator(".dependency").filter({
|
|
323
|
+
has: this.page.getByRole("link", {
|
|
324
|
+
name: title,
|
|
325
|
+
exact: true
|
|
326
|
+
})
|
|
327
|
+
}).locator(".icon-options");
|
|
328
|
+
await locat.isVisible();
|
|
329
|
+
await locat.click();
|
|
330
|
+
await (0, $hOLA6$expect)(this.railLocator.getByRole("menuitem", {
|
|
331
|
+
name: "Remove"
|
|
332
|
+
})).toBeVisible();
|
|
333
|
+
} else await (0, $hOLA6$expect)(this.page.locator(".dependency").filter({
|
|
334
|
+
has: this.page.getByRole("link", {
|
|
335
|
+
name: title,
|
|
336
|
+
exact: true
|
|
337
|
+
})
|
|
338
|
+
}).locator(".icon-options")).not.toBeVisible();
|
|
339
|
+
}
|
|
340
|
+
async getDependencyCount() {
|
|
341
|
+
await (0, $hOLA6$expect)(this.railLocator.locator(".gate-task-dependencies")).toBeVisible();
|
|
342
|
+
const count = await this.railLocator.locator(".gate-task-dependencies .dependency").count();
|
|
343
|
+
return count;
|
|
344
|
+
}
|
|
345
|
+
async addDependency() {
|
|
346
|
+
await (0, $hOLA6$expect)(this.railLocator.locator(".add-dependency-btn")).toBeVisible();
|
|
347
|
+
await this.railLocator.locator(".add-dependency-btn").click();
|
|
348
|
+
}
|
|
349
|
+
async expectDependencyText(dependencies) {
|
|
350
|
+
await (0, $hOLA6$expect)(this.railLocator.locator(".gate-task-dependencies")).toBeVisible();
|
|
351
|
+
await (0, $hOLA6$expect)(this.page.getByRole("link", {
|
|
352
|
+
name: dependencies,
|
|
353
|
+
exact: true
|
|
354
|
+
}).first()).toBeVisible();
|
|
355
|
+
}
|
|
356
|
+
async clickEditDependency(dependencies) {
|
|
357
|
+
const locat = this.page.locator(".dependency").filter({
|
|
358
|
+
has: this.page.getByRole("link", {
|
|
359
|
+
name: dependencies,
|
|
360
|
+
exact: true
|
|
361
|
+
})
|
|
362
|
+
}).locator(".icon-options");
|
|
363
|
+
await locat.isVisible();
|
|
364
|
+
await locat.click();
|
|
365
|
+
const frame = this.page.getByTestId("undefined-menu");
|
|
366
|
+
if (await frame.isVisible()) await this.railLocator.getByRole("menuitem", {
|
|
367
|
+
name: "Edit"
|
|
368
|
+
}).click();
|
|
369
|
+
else {
|
|
370
|
+
await locat.nth(1).click();
|
|
371
|
+
await this.railLocator.getByRole("menuitem", {
|
|
372
|
+
name: "Edit"
|
|
373
|
+
}).click();
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
class $90bb70a7e909e500$export$fbbf45eff21470e3 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
|
|
378
|
+
constructor(page){
|
|
379
|
+
super(page);
|
|
380
|
+
this.dependencyLocator = page.locator(".gate-task-dependencies .dependency-selector-component");
|
|
381
|
+
this.release = this.dependencyLocator.locator("#release-dependency");
|
|
382
|
+
this.phase = this.dependencyLocator.locator("#phase-dependency");
|
|
383
|
+
this.task = this.dependencyLocator.locator("#task-dependency");
|
|
384
|
+
}
|
|
385
|
+
async getRelease() {
|
|
386
|
+
await this.release.isVisible();
|
|
387
|
+
const releaseValue = await this.release.getAttribute("value");
|
|
388
|
+
return releaseValue;
|
|
389
|
+
}
|
|
390
|
+
async getPhase() {
|
|
391
|
+
await this.phase.isVisible();
|
|
392
|
+
const phaseValue = await this.phase.getAttribute("value");
|
|
393
|
+
return phaseValue;
|
|
394
|
+
}
|
|
395
|
+
async getTask() {
|
|
396
|
+
await this.task.isVisible();
|
|
397
|
+
const taskValue = await this.task.getAttribute("value");
|
|
398
|
+
return taskValue;
|
|
399
|
+
}
|
|
400
|
+
async setRelease(releaseTitle) {
|
|
401
|
+
await this.release.click();
|
|
402
|
+
await this.release.fill(releaseTitle);
|
|
403
|
+
await this.page.getByRole("option", {
|
|
404
|
+
name: releaseTitle
|
|
405
|
+
}).click();
|
|
406
|
+
}
|
|
407
|
+
async save() {
|
|
408
|
+
await (0, $hOLA6$expect)(this.dependencyLocator.getByRole("button", {
|
|
409
|
+
name: "OK"
|
|
410
|
+
})).toBeEnabled();
|
|
411
|
+
await this.dependencyLocator.getByRole("button", {
|
|
412
|
+
name: "OK"
|
|
413
|
+
}).click();
|
|
414
|
+
}
|
|
415
|
+
async setPhase(phaseTitle) {
|
|
416
|
+
await this.phase.click();
|
|
417
|
+
await this.phase.fill("");
|
|
418
|
+
await this.page.getByRole("option", {
|
|
419
|
+
name: phaseTitle
|
|
420
|
+
}).click();
|
|
421
|
+
}
|
|
422
|
+
async setTask(taskTitle) {
|
|
423
|
+
await this.task.click();
|
|
424
|
+
await this.task.fill("");
|
|
425
|
+
await this.page.getByRole("option", {
|
|
426
|
+
name: taskTitle
|
|
427
|
+
}).click();
|
|
428
|
+
}
|
|
429
|
+
async clearPhase() {
|
|
430
|
+
await this.phase.clear();
|
|
431
|
+
}
|
|
432
|
+
async expectVariableModeEnabled(mode) {
|
|
433
|
+
await (0, $hOLA6$expect)(this.dependencyLocator.getByLabel("input-variable")).toBeVisible();
|
|
434
|
+
const variablemode = await this.dependencyLocator.getByLabel("input-variable").getAttribute("aria-pressed");
|
|
435
|
+
(0, $hOLA6$expect)(variablemode).toBe("" + mode + "");
|
|
436
|
+
}
|
|
437
|
+
async clickVariable() {
|
|
438
|
+
await this.dependencyLocator.getByLabel("input-variable").click();
|
|
439
|
+
}
|
|
440
|
+
//TODO: getAttribute('value') is not working as expected. Need to be fixed with better alternative.
|
|
441
|
+
async expectMinimumOptions(options) {
|
|
442
|
+
await this.dependencyLocator.getByPlaceholder("Please select a variable of").click();
|
|
443
|
+
for(let i = 0; i < options.length; i++){
|
|
444
|
+
const option = await this.dependencyLocator.locator("#mui-30-option-" + i).getAttribute("value");
|
|
445
|
+
(0, $hOLA6$expect)(options[i]).toContain(option);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
async enterNewVariable(variablename) {
|
|
449
|
+
await this.page.getByLabel("Please select a variable of").click();
|
|
450
|
+
await this.page.getByLabel("Please select a variable of").fill(variablename);
|
|
451
|
+
await this.page.getByTestId("dot-action-item-btn").click();
|
|
452
|
+
}
|
|
453
|
+
async selectVariable(variablename) {
|
|
454
|
+
await this.page.getByLabel("Please select a variable of").click();
|
|
455
|
+
await this.page.getByRole("option", {
|
|
456
|
+
name: variablename
|
|
457
|
+
}).click();
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
class $69e86f559cdf2bd0$export$15d3f9b095bb5188 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
|
|
465
|
+
async expectCommentToContain(text) {
|
|
466
|
+
await (0, $hOLA6$expect)(this.page.locator(".task-comment .markdown-wrapper p")).toContainText(text);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
class $9c357602b6f466e7$export$aa59788fdecae2f2 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
|
|
474
|
+
async expectWithAttachment(filename) {
|
|
475
|
+
const test = this.page.locator(".task-attachments-grid .file-item-text");
|
|
476
|
+
await test.isVisible();
|
|
477
|
+
await (0, $hOLA6$expect)(test).toContainText(filename);
|
|
478
|
+
}
|
|
479
|
+
async getAttachmentsListCount() {
|
|
480
|
+
return await this.page.locator(".file-upload-list div").count();
|
|
481
|
+
}
|
|
482
|
+
async uploadFile(filePath) {
|
|
483
|
+
const fileChooserPromise = this.page.waitForEvent("filechooser");
|
|
484
|
+
await this.page.getByRole("button", {
|
|
485
|
+
name: "Select file(s)"
|
|
486
|
+
}).click();
|
|
487
|
+
const fileChooser = await fileChooserPromise;
|
|
488
|
+
await fileChooser.setFiles(filePath);
|
|
489
|
+
}
|
|
490
|
+
async downloadFile(filename) {
|
|
491
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
492
|
+
this.page.on("download", ()=>{});
|
|
493
|
+
const downloadPromise = this.page.waitForEvent("download");
|
|
494
|
+
await this.page.locator("li").filter({
|
|
495
|
+
hasText: "" + filename + ""
|
|
496
|
+
}).click();
|
|
497
|
+
await downloadPromise;
|
|
498
|
+
}
|
|
499
|
+
async deleteAttachment(fileName) {
|
|
500
|
+
await this.page.locator("li").filter({
|
|
501
|
+
hasText: fileName
|
|
502
|
+
}).click();
|
|
503
|
+
await this.page.getByLabel("delete file").click();
|
|
504
|
+
await this.page.getByRole("button", {
|
|
505
|
+
name: "Delete"
|
|
506
|
+
}).click();
|
|
507
|
+
}
|
|
508
|
+
async expectWithNoAttachment(tempFile) {
|
|
509
|
+
const test = await this.page.locator(".task-attachments-grid .file-item-text").isVisible();
|
|
510
|
+
if (test) await (0, $hOLA6$expect)(this.page.locator(".task-attachments-grid .file-item-text")).not.toContainText(tempFile);
|
|
511
|
+
else await (0, $hOLA6$expect)(this.page.locator(".task-attachments-grid .file-item-text")).not.toBeVisible();
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
class $8e39246218b802fc$export$e946776eae644790 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
|
|
518
|
+
constructor(page){
|
|
519
|
+
super(page);
|
|
520
|
+
this.taskDrawerLocator = this.page.locator("task-drawer .dot-drawer");
|
|
521
|
+
this.retryButton = this.page.getByRole("button", {
|
|
522
|
+
name: "Retry"
|
|
523
|
+
});
|
|
524
|
+
this.cancelButton = this.page.getByTestId("task-action-cancel");
|
|
525
|
+
this.commentBox = this.page.getByTestId("task-action-comment");
|
|
526
|
+
this.confirm = this.page.getByTestId("task-action-confirm");
|
|
527
|
+
this.activity = new (0, $69e86f559cdf2bd0$export$15d3f9b095bb5188)(page);
|
|
528
|
+
this.attachment = new (0, $9c357602b6f466e7$export$aa59788fdecae2f2)(page);
|
|
529
|
+
this.config = new (0, $e44e9af564fb00f7$export$64c93bc7fb9ca44e)(page);
|
|
530
|
+
this.condition = new (0, $3fa741329d8067d5$export$d4865631ba74f3e2)(page);
|
|
531
|
+
this.overview = new (0, $90bb70a7e909e500$export$519356f6c50361f7)(page);
|
|
532
|
+
this.skipMenu = this.page.getByRole("menuitem", {
|
|
533
|
+
name: "Skip"
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
async openOverviewRail() {
|
|
537
|
+
await this.openRail("Overview");
|
|
538
|
+
}
|
|
539
|
+
async openActivityRail() {
|
|
540
|
+
await this.openRail("Activity");
|
|
541
|
+
}
|
|
542
|
+
async openSchedulingRail() {
|
|
543
|
+
await this.openRail("Scheduling");
|
|
544
|
+
}
|
|
545
|
+
async openConditionRail() {
|
|
546
|
+
await this.openRail("Conditions");
|
|
547
|
+
}
|
|
548
|
+
async openAttributesRail() {
|
|
549
|
+
await this.openRail("Attributes");
|
|
550
|
+
}
|
|
551
|
+
async openAttachRail() {
|
|
552
|
+
await this.openRail("Attach");
|
|
553
|
+
}
|
|
554
|
+
async openTagsRail() {
|
|
555
|
+
await this.openRail("Tags");
|
|
556
|
+
}
|
|
557
|
+
async openRail(rail) {
|
|
558
|
+
await this.taskDrawerLocator.locator(".task-navigation-rail").getByText(rail).click();
|
|
559
|
+
}
|
|
560
|
+
async close() {
|
|
561
|
+
await this.taskDrawerLocator.locator(".task-drawer-header").getByTestId("close-btn").click();
|
|
562
|
+
}
|
|
563
|
+
async retryTask(comment) {
|
|
564
|
+
await this.retryButton.click();
|
|
565
|
+
await this.commentBox.fill(comment);
|
|
566
|
+
await this.confirm.click();
|
|
567
|
+
}
|
|
568
|
+
async skipTask(comment) {
|
|
569
|
+
await this.page.getByRole("button", {
|
|
570
|
+
name: "arrow-down icon",
|
|
571
|
+
exact: true
|
|
572
|
+
}).click();
|
|
450
573
|
await this.skipMenu.click();
|
|
451
574
|
await this.commentBox.fill(comment);
|
|
452
575
|
await this.confirm.click();
|
|
453
576
|
}
|
|
577
|
+
async expectTaskTitle(taskTitle) {
|
|
578
|
+
(0, $hOLA6$expect)(await this.page.locator(".task-drawer .task-title-input .dot-view-mode-typography").innerText()).toContain(taskTitle);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
class $c9bb587dd92143c3$export$d1077068a9cc9f17 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
|
|
586
|
+
constructor(page){
|
|
587
|
+
super(page);
|
|
588
|
+
}
|
|
589
|
+
async editReleaseName(name) {
|
|
590
|
+
await this.page.locator("#release-form-title").clear();
|
|
591
|
+
await this.page.locator("#release-form-title").fill(name);
|
|
592
|
+
}
|
|
593
|
+
async setDescription(description) {
|
|
594
|
+
await this.page.locator(".display > .xl-icon").first().click();
|
|
595
|
+
await this.page.locator("textarea").click();
|
|
596
|
+
await this.page.locator("textarea").clear();
|
|
597
|
+
await this.page.locator("textarea").fill(description);
|
|
598
|
+
await this.page.getByText("Save").first().click();
|
|
599
|
+
}
|
|
600
|
+
async setScriptUsername(username) {
|
|
601
|
+
await this.page.getByPlaceholder("Set user...").waitFor();
|
|
602
|
+
await this.page.getByPlaceholder("Set user...").click();
|
|
603
|
+
await this.page.locator('input[name=""]').fill(username, {
|
|
604
|
+
timeout: 2000
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
async setScriptUserPassword(password) {
|
|
608
|
+
await this.page.locator('span[name="scriptUserPassword"]').waitFor();
|
|
609
|
+
await this.page.locator('span[name="scriptUserPassword"]').click();
|
|
610
|
+
await this.page.locator('input[name="scriptUserPassword"]').fill(password, {
|
|
611
|
+
timeout: 2000
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
async save() {
|
|
615
|
+
await this.page.getByRole("button", {
|
|
616
|
+
name: "Save"
|
|
617
|
+
}).click({
|
|
618
|
+
timeout: 2000
|
|
619
|
+
});
|
|
620
|
+
await (0, $hOLA6$expect)(this.page.locator(".form-footer .last-saved")).toBeVisible();
|
|
621
|
+
}
|
|
622
|
+
async reset() {
|
|
623
|
+
await this.page.getByRole("button", {
|
|
624
|
+
name: "Reset"
|
|
625
|
+
}).waitFor();
|
|
626
|
+
await this.page.getByRole("button", {
|
|
627
|
+
name: "Reset"
|
|
628
|
+
}).click();
|
|
629
|
+
}
|
|
454
630
|
}
|
|
455
631
|
|
|
456
632
|
|
|
@@ -458,6 +634,8 @@ class $43cbcdfccb6c2a76$export$f43492e8ac3c566 extends (0, $9626bc9256ce31f7$exp
|
|
|
458
634
|
constructor(page){
|
|
459
635
|
super(page);
|
|
460
636
|
this.taskDrawer = new (0, $8e39246218b802fc$export$e946776eae644790)(page);
|
|
637
|
+
this.properties = new (0, $c9bb587dd92143c3$export$d1077068a9cc9f17)(page);
|
|
638
|
+
this.variables = new (0, $f48771b486a3eb8f$export$a87f0ae8695e74be)(page);
|
|
461
639
|
}
|
|
462
640
|
async openTriggers() {
|
|
463
641
|
await this.openSubPage("Triggers");
|
|
@@ -479,6 +657,11 @@ class $43cbcdfccb6c2a76$export$f43492e8ac3c566 extends (0, $9626bc9256ce31f7$exp
|
|
|
479
657
|
name: "Start"
|
|
480
658
|
}).click();
|
|
481
659
|
}
|
|
660
|
+
async waitForCompletion(timeout) {
|
|
661
|
+
await this.page.locator("#release.completed").waitFor({
|
|
662
|
+
timeout: timeout
|
|
663
|
+
});
|
|
664
|
+
}
|
|
482
665
|
async waitForTaskCompleted(taskTitle) {
|
|
483
666
|
await (0, $hOLA6$expect)(this.page.locator(".task.completed").getByText(taskTitle, {
|
|
484
667
|
exact: true
|
|
@@ -522,12 +705,31 @@ class $43cbcdfccb6c2a76$export$f43492e8ac3c566 extends (0, $9626bc9256ce31f7$exp
|
|
|
522
705
|
});
|
|
523
706
|
}
|
|
524
707
|
async openTaskDrawer(taskName) {
|
|
525
|
-
await this.page.locator(".task-header").getByText(taskName
|
|
708
|
+
await this.page.locator(".task-header").getByText(taskName, {
|
|
709
|
+
exact: true
|
|
710
|
+
}).click();
|
|
526
711
|
return this.taskDrawer;
|
|
527
712
|
}
|
|
528
713
|
async openVariables() {
|
|
529
714
|
await this.openReleaseMenu("Variables");
|
|
530
|
-
|
|
715
|
+
}
|
|
716
|
+
async openProperties() {
|
|
717
|
+
await this.openReleaseMenu("Properties");
|
|
718
|
+
}
|
|
719
|
+
async openReleaseFlow() {
|
|
720
|
+
await this.openReleaseMenu("Release flow");
|
|
721
|
+
}
|
|
722
|
+
async openRelationships() {
|
|
723
|
+
await this.openReleaseMenu("Relationships");
|
|
724
|
+
}
|
|
725
|
+
async openTeamsPermissions() {
|
|
726
|
+
await this.openReleaseMenu("Teams & Permissions");
|
|
727
|
+
}
|
|
728
|
+
async openDashboard() {
|
|
729
|
+
await this.openReleaseMenu("Dashboard");
|
|
730
|
+
}
|
|
731
|
+
async openActivityLogs() {
|
|
732
|
+
await this.openReleaseMenu("ActivityLogs");
|
|
531
733
|
}
|
|
532
734
|
async openReleaseMenu(menuItem) {
|
|
533
735
|
await this.page.locator(`navigation-sidebar ul li`).getByText(menuItem, {
|
|
@@ -564,6 +766,9 @@ class $43cbcdfccb6c2a76$export$f43492e8ac3c566 extends (0, $9626bc9256ce31f7$exp
|
|
|
564
766
|
}
|
|
565
767
|
}
|
|
566
768
|
}
|
|
769
|
+
async backToRelease() {
|
|
770
|
+
await this.page.locator(".icon-back").click();
|
|
771
|
+
}
|
|
567
772
|
}
|
|
568
773
|
class $43cbcdfccb6c2a76$var$Phase extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
|
|
569
774
|
constructor(page, phaseName){
|
|
@@ -572,24 +777,43 @@ class $43cbcdfccb6c2a76$var$Phase extends (0, $9626bc9256ce31f7$export$2b65d1d97
|
|
|
572
777
|
hasText: phaseName
|
|
573
778
|
});
|
|
574
779
|
}
|
|
575
|
-
async
|
|
576
|
-
await this.phaseLocator.
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
await this.phaseLocator.locator(".
|
|
780
|
+
async setTitle(title) {
|
|
781
|
+
await this.phaseLocator.locator(".phase-header .display").click();
|
|
782
|
+
await this.phaseLocator.locator(".phase-header input").clear();
|
|
783
|
+
await this.phaseLocator.locator(".phase-header input").fill(title);
|
|
784
|
+
await this.phaseLocator.locator(".phase-header input").blur();
|
|
785
|
+
}
|
|
786
|
+
async expectTaskBorderWithColor(taskName, color) {
|
|
787
|
+
await (0, $hOLA6$expect)(this.page.locator(`.task-box:has-text('${taskName}')`)).toHaveCSS("border-top-color", color);
|
|
788
|
+
}
|
|
789
|
+
async addTaskInPhase(taskTitle, taskType) {
|
|
790
|
+
await this.phaseLocator.getByText("Add task").click();
|
|
791
|
+
await this.phaseLocator.getByPlaceholder("Task title...").click();
|
|
792
|
+
await this.phaseLocator.getByPlaceholder("Task title...").fill(taskTitle);
|
|
580
793
|
await this.phaseLocator.locator(".xlr-ctx-menu-toggle").click();
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
}).hover();
|
|
587
|
-
await this.page.locator(`.xlr-ctx-menu.active`).getByTitle(taskType, {
|
|
588
|
-
exact: true
|
|
589
|
-
}).click();
|
|
794
|
+
const count = taskType.length - 1;
|
|
795
|
+
for(let i = 0; i < count; i++){
|
|
796
|
+
await this.page.locator('[data-test="' + taskType[i] + '"]').getByText(taskType[i]).click();
|
|
797
|
+
await this.page.getByText(taskType[i + 1]).click();
|
|
798
|
+
}
|
|
590
799
|
await this.phaseLocator.locator(".quick-controls-container a").getByText("Add", {
|
|
591
800
|
exact: true
|
|
592
801
|
}).click();
|
|
802
|
+
await this.phaseLocator.locator(".button.cancel").click();
|
|
803
|
+
await (0, $hOLA6$expect)(this.phaseLocator.locator(".task").filter({
|
|
804
|
+
hasText: taskTitle
|
|
805
|
+
})).toBeVisible({
|
|
806
|
+
timeout: 5000
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
async getNumberOfTasks() {
|
|
810
|
+
return await this.phaseLocator.locator(".task").count();
|
|
811
|
+
}
|
|
812
|
+
async expectToHaveNoneditableTitle(phaseTitle) {
|
|
813
|
+
await (0, $hOLA6$expect)(this.phaseLocator.locator(".phase-title > span")).toContainText(phaseTitle);
|
|
814
|
+
}
|
|
815
|
+
async expectToHaveTitle(phaseTitle) {
|
|
816
|
+
await (0, $hOLA6$expect)(this.phaseLocator.locator(".phase-title")).toContainText(phaseTitle);
|
|
593
817
|
}
|
|
594
818
|
}
|
|
595
819
|
|
|
@@ -646,17 +870,16 @@ class $6720a523bcb1cce0$export$3cac5fd37ae64b91 extends (0, $9626bc9256ce31f7$ex
|
|
|
646
870
|
|
|
647
871
|
|
|
648
872
|
|
|
873
|
+
|
|
649
874
|
class $21185a378c23589e$export$e2e2e1ffdce20c30 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
|
|
650
875
|
constructor(page){
|
|
651
876
|
super(page);
|
|
652
877
|
this.userName = page.locator("#username");
|
|
653
|
-
this.name = page.locator("#
|
|
878
|
+
this.name = page.locator("#fullName");
|
|
654
879
|
this.email = page.locator("#email");
|
|
655
|
-
this.password = page.locator(
|
|
656
|
-
this.cnfPassword = page.locator("#
|
|
657
|
-
this.saveButton = page.
|
|
658
|
-
name: "Save"
|
|
659
|
-
});
|
|
880
|
+
this.password = page.locator("#password");
|
|
881
|
+
this.cnfPassword = page.locator("#confirmPassword");
|
|
882
|
+
this.saveButton = page.getByTestId("save-btn");
|
|
660
883
|
this.cancelButton = page.getByRole("button", {
|
|
661
884
|
name: "Cancel"
|
|
662
885
|
});
|
|
@@ -680,6 +903,9 @@ class $21185a378c23589e$export$e2e2e1ffdce20c30 extends (0, $9626bc9256ce31f7$ex
|
|
|
680
903
|
return await this.cnfPassword.fill(cnfPassword);
|
|
681
904
|
}
|
|
682
905
|
async save() {
|
|
906
|
+
await this.saveButton.isEnabled();
|
|
907
|
+
await (0, $hOLA6$expect)(this.saveButton).not.toBeDisabled();
|
|
908
|
+
await this.saveButton.focus();
|
|
683
909
|
await this.saveButton.click();
|
|
684
910
|
}
|
|
685
911
|
async cancel() {
|
|
@@ -706,8 +932,10 @@ class $2cb6a6ac6b17e85f$export$107317390f5aa598 extends (0, $9626bc9256ce31f7$ex
|
|
|
706
932
|
async toggleLoginPermission(username) {
|
|
707
933
|
await this.page.getByRole("row", {
|
|
708
934
|
name: "" + username + ""
|
|
709
|
-
}).getByRole("checkbox").
|
|
710
|
-
|
|
935
|
+
}).getByRole("checkbox").click();
|
|
936
|
+
await (0, $hOLA6$expect)(this.page.getByRole("row", {
|
|
937
|
+
name: "" + username + ""
|
|
938
|
+
}).locator(".Mui-checked")).toBeChecked();
|
|
711
939
|
}
|
|
712
940
|
async addUser() {
|
|
713
941
|
await this.newUserButton.click();
|
|
@@ -788,6 +1016,7 @@ class $3a340a3f4fd8f04d$export$43682cddead1dd78 extends (0, $9626bc9256ce31f7$ex
|
|
|
788
1016
|
year: "numeric"
|
|
789
1017
|
};
|
|
790
1018
|
this.monthFormat = today.toLocaleDateString("en-US", options);
|
|
1019
|
+
this.monthFormat = this.monthFormat.replace(/(\w+) (\d+)/, "$1, $2");
|
|
791
1020
|
await (0, $hOLA6$expect)(this.page).toHaveTitle("Release calendar / Home - Digital.ai Release");
|
|
792
1021
|
return this;
|
|
793
1022
|
}
|
|
@@ -818,7 +1047,7 @@ class $3a340a3f4fd8f04d$export$43682cddead1dd78 extends (0, $9626bc9256ce31f7$ex
|
|
|
818
1047
|
return downloadCount;
|
|
819
1048
|
}
|
|
820
1049
|
async verifyDayView() {
|
|
821
|
-
await this.page.getByRole("combobox").click();
|
|
1050
|
+
await this.page.locator(".tl-header-navigation").getByRole("combobox").click();
|
|
822
1051
|
await this.page.getByRole("option", {
|
|
823
1052
|
name: "Day"
|
|
824
1053
|
}).click();
|
|
@@ -829,7 +1058,7 @@ class $3a340a3f4fd8f04d$export$43682cddead1dd78 extends (0, $9626bc9256ce31f7$ex
|
|
|
829
1058
|
await (0, $hOLA6$expect)(this.page.getByText(this.dayFormat)).toBeVisible();
|
|
830
1059
|
}
|
|
831
1060
|
async verifyYearView() {
|
|
832
|
-
await this.page.getByRole("combobox").click();
|
|
1061
|
+
await this.page.locator(".tl-header-navigation").getByRole("combobox").click();
|
|
833
1062
|
await this.page.getByRole("option", {
|
|
834
1063
|
name: "Year"
|
|
835
1064
|
}).click();
|
|
@@ -837,11 +1066,147 @@ class $3a340a3f4fd8f04d$export$43682cddead1dd78 extends (0, $9626bc9256ce31f7$ex
|
|
|
837
1066
|
name: "Today"
|
|
838
1067
|
}).click();
|
|
839
1068
|
//Verify Page has correct Year format displayed at the page bottom
|
|
840
|
-
await (0, $hOLA6$expect)(this.page.
|
|
1069
|
+
await (0, $hOLA6$expect)(this.page.locator(".tl-footer-label").filter({
|
|
1070
|
+
hasText: this.yearFormatString
|
|
1071
|
+
})).toHaveText(this.yearFormatString);
|
|
1072
|
+
}
|
|
1073
|
+
async verifyMonthView() {
|
|
1074
|
+
await this.page.locator(".tl-header-navigation").getByRole("combobox").click();
|
|
1075
|
+
await this.page.getByRole("option", {
|
|
1076
|
+
name: "Month"
|
|
1077
|
+
}).click();
|
|
1078
|
+
await this.page.getByRole("button", {
|
|
1079
|
+
name: "Today"
|
|
1080
|
+
}).click();
|
|
1081
|
+
//Verify Page has correct Year format displayed at the page bottom
|
|
1082
|
+
await (0, $hOLA6$expect)(this.page.locator(".tl-footer-label").filter({
|
|
1083
|
+
hasText: this.monthFormat
|
|
1084
|
+
})).toHaveText(this.monthFormat);
|
|
1085
|
+
}
|
|
1086
|
+
async verifyPageContent(title) {
|
|
1087
|
+
const view_type = [
|
|
1088
|
+
"Day",
|
|
1089
|
+
"Week",
|
|
1090
|
+
"Month",
|
|
1091
|
+
"Year"
|
|
1092
|
+
];
|
|
1093
|
+
for (const view of view_type){
|
|
1094
|
+
await this.page.locator(".tl-header-navigation").getByRole("combobox").click();
|
|
1095
|
+
await this.page.getByRole("option", {
|
|
1096
|
+
name: view
|
|
1097
|
+
}).click();
|
|
1098
|
+
await this.page.getByRole("button", {
|
|
1099
|
+
name: "Today"
|
|
1100
|
+
}).click();
|
|
1101
|
+
//Verify Page has correct Year format displayed at the page bottom
|
|
1102
|
+
await (0, $hOLA6$expect)(this.page.getByText(title)).toBeVisible();
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
async filterReleaseByTitle(title) {
|
|
1106
|
+
await this.page.getByPlaceholder("Filter by release title").click();
|
|
1107
|
+
await this.page.getByPlaceholder("Filter by release title").fill(title);
|
|
1108
|
+
await this.page.getByPlaceholder("Filter by release title").press("Enter");
|
|
1109
|
+
//Verify Page has correct Year format displayed at the page bottom
|
|
1110
|
+
await this.verifyPageContent(title);
|
|
1111
|
+
}
|
|
1112
|
+
async filterReleaseByTags(tags, release_title) {
|
|
1113
|
+
await this.page.locator(".tl-filter-release-tags").locator(".react-tagsinput").click();
|
|
1114
|
+
for (let tag of tags){
|
|
1115
|
+
tag = tag.toString();
|
|
1116
|
+
await this.page.locator(".tl-filter-release-tags").locator(".react-tagsinput-input").fill(tag);
|
|
1117
|
+
await this.page.getByTitle(tag).locator("i").click();
|
|
1118
|
+
}
|
|
1119
|
+
await this.verifyPageContent(release_title);
|
|
1120
|
+
}
|
|
1121
|
+
async filterTaskByTags(tags, task_title, release_title) {
|
|
1122
|
+
await this.page.locator(".tl-filter-task-tags").locator(".react-tagsinput").click();
|
|
1123
|
+
for (let tag of tags){
|
|
1124
|
+
tag = tag.toString();
|
|
1125
|
+
await this.page.locator(".tl-filter-task-tags").locator(".react-tagsinput-input").fill(tag);
|
|
1126
|
+
await this.page.getByTitle(tag).locator("i").click();
|
|
1127
|
+
}
|
|
1128
|
+
//Make sure task is visible on calnedar page
|
|
1129
|
+
await this.verifyPageContent(task_title);
|
|
1130
|
+
//Make sure parent release of the selected task is visible on calnedar page
|
|
1131
|
+
await this.verifyPageContent(release_title);
|
|
1132
|
+
}
|
|
1133
|
+
async filterReleaseByStatus(release_status, release_title) {
|
|
1134
|
+
if (!await this.page.locator(".tl-filter-advanced").isVisible()) await this.page.getByRole("button", {
|
|
1135
|
+
name: "Advanced filters"
|
|
1136
|
+
}).click();
|
|
1137
|
+
await this.page.locator(".tl-filter-release-status").locator(".react-tagsinput").click();
|
|
1138
|
+
await this.page.getByTitle(release_status).locator("i").first().click();
|
|
1139
|
+
await this.verifyPageContent(release_title);
|
|
1140
|
+
}
|
|
1141
|
+
async filterReleaseByRisk(release_risk, release_title) {
|
|
1142
|
+
if (!await this.page.locator(".tl-filter-advanced").isVisible()) await this.page.getByRole("button", {
|
|
1143
|
+
name: "Advanced filters"
|
|
1144
|
+
}).click();
|
|
1145
|
+
await this.page.locator(".tl-filter-risk-filter").getByRole("combobox").click();
|
|
1146
|
+
await this.page.getByRole("option", {
|
|
1147
|
+
name: release_risk
|
|
1148
|
+
}).click();
|
|
1149
|
+
await this.verifyPageContent(release_title);
|
|
1150
|
+
}
|
|
1151
|
+
async filterFlaggedRelease(release_title) {
|
|
1152
|
+
if (!await this.page.locator(".tl-filter-advanced").isVisible()) await this.page.getByRole("button", {
|
|
1153
|
+
name: "Advanced filters"
|
|
1154
|
+
}).click();
|
|
1155
|
+
if (await this.page.locator(".tl-filter-flag-only.btn.btn-flat.btn-fixed.button-toggle-filter.active").isVisible()) await this.page.getByRole("button", {
|
|
1156
|
+
name: " Flagged"
|
|
1157
|
+
}).click();
|
|
1158
|
+
await this.verifyPageContent(release_title);
|
|
1159
|
+
}
|
|
1160
|
+
async viewRelease(release_title, release_id) {
|
|
1161
|
+
await this.page.locator(".tl-header-navigation").getByRole("combobox").click();
|
|
1162
|
+
await this.page.getByRole("option", {
|
|
1163
|
+
name: "Day"
|
|
1164
|
+
}).click();
|
|
1165
|
+
await this.page.getByRole("button", {
|
|
1166
|
+
name: "Today"
|
|
1167
|
+
}).click();
|
|
1168
|
+
await this.page.getByText(release_title).click();
|
|
1169
|
+
await this.page.locator(".release-modal-container").locator(".xl-icon.release-icon").click();
|
|
1170
|
+
const releaseurl = `/#/releases/${release_id}`;
|
|
1171
|
+
const currentURL = await this.page.url();
|
|
1172
|
+
// Check if the release name present in redirected URL
|
|
1173
|
+
(0, $hOLA6$expect)(currentURL).toContain(releaseurl);
|
|
1174
|
+
}
|
|
1175
|
+
async viewDependency(source_release, dest_release) {
|
|
1176
|
+
const source_text = source_release + "dependencies";
|
|
1177
|
+
await this.page.locator(".tl-header-navigation").getByRole("combobox").click();
|
|
1178
|
+
await this.page.getByRole("option", {
|
|
1179
|
+
name: "Day"
|
|
1180
|
+
}).click();
|
|
1181
|
+
await this.page.getByRole("button", {
|
|
1182
|
+
name: "Today"
|
|
1183
|
+
}).click();
|
|
1184
|
+
await this.page.getByText(source_release).click();
|
|
1185
|
+
await this.page.locator(".release-modal-container").locator(".xl-icon.cluster-dependencies-icon").click();
|
|
1186
|
+
await (0, $hOLA6$expect)(this.page.locator(".tl-drawer-navigation-header")).toHaveText(source_text);
|
|
1187
|
+
await (0, $hOLA6$expect)(this.page.locator(".tl-drawer-dependency-body-title-text")).toHaveText(dest_release);
|
|
1188
|
+
}
|
|
1189
|
+
async downloadIcsCalendar(release_title) {
|
|
1190
|
+
let downloadCount = 0;
|
|
1191
|
+
// Listen to download events
|
|
1192
|
+
this.page.on("download", (_download)=>{
|
|
1193
|
+
downloadCount++;
|
|
1194
|
+
});
|
|
1195
|
+
await this.page.locator(".tl-header-navigation").getByRole("combobox").click();
|
|
1196
|
+
await this.page.getByRole("option", {
|
|
1197
|
+
name: "Day"
|
|
1198
|
+
}).click();
|
|
1199
|
+
await this.page.getByRole("button", {
|
|
1200
|
+
name: "Today"
|
|
1201
|
+
}).click();
|
|
1202
|
+
await this.page.getByText(release_title).click();
|
|
1203
|
+
await this.page.locator(".release-modal-container").locator(".xl-icon.calendar-icon").click();
|
|
1204
|
+
return downloadCount;
|
|
841
1205
|
}
|
|
842
1206
|
}
|
|
843
1207
|
|
|
844
1208
|
|
|
1209
|
+
|
|
845
1210
|
class $e72552cbf941ecfa$export$b8a61e5c71402559 {
|
|
846
1211
|
constructor(page){
|
|
847
1212
|
this.page = page;
|
|
@@ -851,6 +1216,7 @@ class $e72552cbf941ecfa$export$b8a61e5c71402559 {
|
|
|
851
1216
|
this.applicationPage = new (0, $c313b10398604df2$export$1533b625ec0c75e2)(page);
|
|
852
1217
|
this.taskDetailsPage = new (0, $9ca6e63d357957dd$export$922081b54f2ab994)(page);
|
|
853
1218
|
this.releaseCalendarPage = new (0, $3a340a3f4fd8f04d$export$43682cddead1dd78)(page);
|
|
1219
|
+
this.releaseListPage = new (0, $5359280e98d97ff9$export$a678525e79c4ccc4)(page);
|
|
854
1220
|
}
|
|
855
1221
|
async openTemplate(id) {
|
|
856
1222
|
return this.openReleaseOrTemplate(id, false);
|
|
@@ -865,83 +1231,83 @@ class $e72552cbf941ecfa$export$b8a61e5c71402559 {
|
|
|
865
1231
|
return new (0, $6720a523bcb1cce0$export$3cac5fd37ae64b91)(this.page).openPersonalAccessTokenPage();
|
|
866
1232
|
}
|
|
867
1233
|
async gotoFolderPage() {
|
|
868
|
-
await this.page.locator("ul.side-nav li", {
|
|
869
|
-
|
|
1234
|
+
await this.page.locator("ul.side-nav li").getByText("Folders", {
|
|
1235
|
+
exact: true
|
|
870
1236
|
}).click();
|
|
871
1237
|
}
|
|
872
1238
|
async gotoTaskPage() {
|
|
873
|
-
await this.page.locator("ul.side-nav li", {
|
|
874
|
-
|
|
1239
|
+
await this.page.locator("ul.side-nav li").getByText("Tasks", {
|
|
1240
|
+
exact: true
|
|
875
1241
|
}).click();
|
|
876
1242
|
}
|
|
877
1243
|
async gotoReleasePage() {
|
|
878
|
-
await this.page.locator("ul.side-nav li", {
|
|
879
|
-
|
|
1244
|
+
await this.page.locator("ul.side-nav li").getByText("Releases", {
|
|
1245
|
+
exact: true
|
|
880
1246
|
}).click();
|
|
881
1247
|
}
|
|
882
1248
|
async gotoWorkflowCatalogPage() {
|
|
883
|
-
await this.page.locator("ul.side-nav li", {
|
|
884
|
-
|
|
1249
|
+
await this.page.locator("ul.side-nav li").getByText("Workflow catalog", {
|
|
1250
|
+
exact: true
|
|
885
1251
|
}).click();
|
|
886
1252
|
}
|
|
887
1253
|
async gotoWorkflowsPage() {
|
|
888
|
-
await this.page.locator("ul.side-nav li", {
|
|
889
|
-
|
|
1254
|
+
await this.page.locator("ul.side-nav li").getByText("Workflows", {
|
|
1255
|
+
exact: true
|
|
890
1256
|
}).click();
|
|
891
1257
|
}
|
|
892
1258
|
async gotoGroupsPage() {
|
|
893
|
-
await this.page.locator("ul.side-nav li", {
|
|
894
|
-
|
|
1259
|
+
await this.page.locator("ul.side-nav li").getByText("Groups", {
|
|
1260
|
+
exact: true
|
|
895
1261
|
}).click();
|
|
896
1262
|
}
|
|
897
1263
|
async gotoReleaseCalenderPage() {
|
|
898
|
-
await this.page.locator("ul.side-nav li", {
|
|
899
|
-
|
|
1264
|
+
await this.page.locator("ul.side-nav li").getByText("Release calendar", {
|
|
1265
|
+
exact: true
|
|
900
1266
|
}).click();
|
|
901
1267
|
}
|
|
902
1268
|
async gotoDeliveriesPage() {
|
|
903
|
-
await this.page.locator("ul.side-nav li", {
|
|
904
|
-
|
|
1269
|
+
await this.page.locator("ul.side-nav li").getByText("Deliveries", {
|
|
1270
|
+
exact: true
|
|
905
1271
|
}).click();
|
|
906
1272
|
}
|
|
907
1273
|
async gotoTriggersPage() {
|
|
908
|
-
await this.page.locator("ul.side-nav li", {
|
|
909
|
-
|
|
1274
|
+
await this.page.locator("ul.side-nav li").getByText("Triggers", {
|
|
1275
|
+
exact: true
|
|
910
1276
|
}).click();
|
|
911
1277
|
}
|
|
912
1278
|
async gotoDigitalAnalyticsPage() {
|
|
913
|
-
await this.page.locator("ul.side-nav li", {
|
|
914
|
-
|
|
1279
|
+
await this.page.locator("ul.side-nav li").getByText("Digital.ai Analytics", {
|
|
1280
|
+
exact: true
|
|
915
1281
|
}).click();
|
|
916
1282
|
}
|
|
917
1283
|
async gotoReportsPage() {
|
|
918
|
-
await this.page.locator("ul.side-nav li", {
|
|
919
|
-
|
|
1284
|
+
await this.page.locator("ul.side-nav li").getByText("Reports", {
|
|
1285
|
+
exact: true
|
|
920
1286
|
}).click();
|
|
921
1287
|
}
|
|
922
1288
|
async gotoTemplatesPage() {
|
|
923
|
-
await this.page.locator("ul.side-nav li", {
|
|
924
|
-
|
|
1289
|
+
await this.page.locator("ul.side-nav li").getByText("Templates", {
|
|
1290
|
+
exact: true
|
|
925
1291
|
}).click();
|
|
926
1292
|
}
|
|
927
1293
|
async gotoEnvironmentsPage() {
|
|
928
|
-
await this.page.locator("ul.side-nav li", {
|
|
929
|
-
|
|
1294
|
+
await this.page.locator("ul.side-nav li").getByText("Environments", {
|
|
1295
|
+
exact: true
|
|
930
1296
|
}).click();
|
|
931
1297
|
}
|
|
932
1298
|
async gotoEnvironmentsCalenderPage() {
|
|
933
|
-
await this.page.locator("ul.side-nav li", {
|
|
934
|
-
|
|
1299
|
+
await this.page.locator("ul.side-nav li").getByText("Environments calendar", {
|
|
1300
|
+
exact: true
|
|
935
1301
|
}).click();
|
|
936
1302
|
}
|
|
937
1303
|
async gotoGobalVariablesPage() {
|
|
938
|
-
await this.page.locator("ul.side-nav li", {
|
|
939
|
-
|
|
1304
|
+
await this.page.locator("ul.side-nav li").getByText("Global variables", {
|
|
1305
|
+
exact: true
|
|
940
1306
|
}).click();
|
|
941
1307
|
}
|
|
942
1308
|
async gotoConnectionsPage() {
|
|
943
|
-
await this.page.locator("ul.side-nav li", {
|
|
944
|
-
|
|
1309
|
+
await this.page.locator("ul.side-nav li").getByText("Connections", {
|
|
1310
|
+
exact: true
|
|
945
1311
|
}).click();
|
|
946
1312
|
}
|
|
947
1313
|
async openReleaseOrTemplate(id, release) {
|
|
@@ -954,6 +1320,192 @@ class $e72552cbf941ecfa$export$b8a61e5c71402559 {
|
|
|
954
1320
|
|
|
955
1321
|
|
|
956
1322
|
|
|
1323
|
+
|
|
1324
|
+
class $4444bee76761dfb1$export$f14c0e3f98d164c0 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
|
|
1325
|
+
/**
|
|
1326
|
+
* Login with username and password
|
|
1327
|
+
* @param userName
|
|
1328
|
+
* @param password
|
|
1329
|
+
*/ async login(userName, password) {
|
|
1330
|
+
await this.page.goto("./#/login");
|
|
1331
|
+
await (0, $hOLA6$expect)(this.page).toHaveTitle("Digital.ai Release");
|
|
1332
|
+
await this.page.getByPlaceholder("User").fill(userName, {
|
|
1333
|
+
timeout: 1000
|
|
1334
|
+
});
|
|
1335
|
+
await this.page.getByPlaceholder("Password").fill(password, {
|
|
1336
|
+
timeout: 10000
|
|
1337
|
+
});
|
|
1338
|
+
await this.page.getByRole("button", {
|
|
1339
|
+
name: "Log in"
|
|
1340
|
+
}).click({
|
|
1341
|
+
timeout: 10000
|
|
1342
|
+
});
|
|
1343
|
+
await this.page.waitForTimeout(1000);
|
|
1344
|
+
}
|
|
1345
|
+
/**
|
|
1346
|
+
* Logout as authenticated user
|
|
1347
|
+
*/ async logout() {
|
|
1348
|
+
await this.page.locator("button.dot-avatar").click();
|
|
1349
|
+
await this.page.getByText("Log out", {
|
|
1350
|
+
exact: true
|
|
1351
|
+
}).click();
|
|
1352
|
+
}
|
|
1353
|
+
/**
|
|
1354
|
+
* Expect login to be restricted for a user
|
|
1355
|
+
*/ async expectLoginDisallowed() {
|
|
1356
|
+
const val = await this.page.textContent('.error-content span[ng-show="loginInfo.failedStatus == 403"]');
|
|
1357
|
+
(0, $hOLA6$expect)(val).toContain("You do not have 'login' permission.");
|
|
1358
|
+
}
|
|
1359
|
+
/**
|
|
1360
|
+
* Expect the respective user is logged In
|
|
1361
|
+
* @param username
|
|
1362
|
+
*/ async expectToBeLogged(username) {
|
|
1363
|
+
const val = await this.page.locator("top-toolbar .avatar-wrapper span.dot-tooltip").getAttribute("aria-label");
|
|
1364
|
+
(0, $hOLA6$expect)(val).toContain(username);
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
|
|
1369
|
+
|
|
1370
|
+
|
|
1371
|
+
|
|
1372
|
+
|
|
1373
|
+
|
|
1374
|
+
const $f86fbaaa8b4e8c61$export$45f0aca2596a2bb3 = function() {
|
|
1375
|
+
const RELEASE_TYPE = "xlrelease.Release";
|
|
1376
|
+
const PHASE_TYPE = "xlrelease.Phase";
|
|
1377
|
+
const TEAM_TYPE = "xlrelease.Team";
|
|
1378
|
+
const TASK_TYPE = "xlrelease.Task";
|
|
1379
|
+
const COMMENT_TYPE = "xlrelease.Comment";
|
|
1380
|
+
const CONDITION_TYPE = "xlrelease.GateCondition";
|
|
1381
|
+
const DEPENDENCY_TYPE = "xlrelease.Dependency";
|
|
1382
|
+
const LINK_TYPE = "xlrelease.Link";
|
|
1383
|
+
const ATTACHMENT_TYPE = "xlrelease.Attachment";
|
|
1384
|
+
const DASHBOARD_TYPE = "xlrelease.Dashboard";
|
|
1385
|
+
const _TRIGGER_TYPE = "xlrelease.ReleaseTrigger";
|
|
1386
|
+
const JIRA_TYPE = "jira.CreateIssue";
|
|
1387
|
+
const DEFAULT_TASK_OWNER = "Itchy";
|
|
1388
|
+
const processTasks = (task, container, index)=>{
|
|
1389
|
+
if ((0, $hOLA6$lodashisUndefined)(task.type)) task.type = TASK_TYPE;
|
|
1390
|
+
task.id = task.id || `${container.id}/Task${index}`;
|
|
1391
|
+
if ((0, $hOLA6$lodashisUndefined)(task.owner) && task.type !== JIRA_TYPE) task.owner = DEFAULT_TASK_OWNER;
|
|
1392
|
+
if (task.owner === null) delete task.owner;
|
|
1393
|
+
(0, $hOLA6$lodasheach)(task.conditions, function(condition, idx) {
|
|
1394
|
+
condition.type = CONDITION_TYPE;
|
|
1395
|
+
condition.id = `${task.id}/GateCondition${idx}`;
|
|
1396
|
+
});
|
|
1397
|
+
(0, $hOLA6$lodasheach)(task.dependencies, function(dependency, idx) {
|
|
1398
|
+
dependency.type = DEPENDENCY_TYPE;
|
|
1399
|
+
dependency.id = `${task.id}/Dependency${idx}`;
|
|
1400
|
+
});
|
|
1401
|
+
(0, $hOLA6$lodasheach)(task.links, function(link, idx) {
|
|
1402
|
+
link.type = LINK_TYPE;
|
|
1403
|
+
link.id = `${task.id}/Link${idx}`;
|
|
1404
|
+
});
|
|
1405
|
+
(0, $hOLA6$lodasheach)(task.comments, function(comment, idx) {
|
|
1406
|
+
comment.type = COMMENT_TYPE;
|
|
1407
|
+
comment.id = `${task.id}/Comment${idx}`;
|
|
1408
|
+
});
|
|
1409
|
+
(0, $hOLA6$lodasheach)(task.tasks, function(subTask, idx) {
|
|
1410
|
+
processTasks(subTask, task, idx);
|
|
1411
|
+
});
|
|
1412
|
+
(0, $hOLA6$lodasheach)(task.templateVariables, function(variable, idx) {
|
|
1413
|
+
(0, $hOLA6$lodashdefaults)(variable, getVariableEntity(variable.value, variable.key, task.id, idx));
|
|
1414
|
+
});
|
|
1415
|
+
(0, $hOLA6$lodasheach)(task.attachments, function(attachment, idx) {
|
|
1416
|
+
attachment.type = ATTACHMENT_TYPE;
|
|
1417
|
+
attachment.id = `${task.id}/Attachment${idx}`;
|
|
1418
|
+
});
|
|
1419
|
+
if (task.pythonScript) {
|
|
1420
|
+
const pythonScript = task.pythonScript;
|
|
1421
|
+
pythonScript.id = `${task.id}/PythonScript`;
|
|
1422
|
+
pythonScript.customScriptTask = task.id;
|
|
1423
|
+
}
|
|
1424
|
+
};
|
|
1425
|
+
const processPhases = (phase, release, index)=>{
|
|
1426
|
+
phase.type = PHASE_TYPE;
|
|
1427
|
+
phase.id = `${release.id}/Phase${index}`;
|
|
1428
|
+
(0, $hOLA6$lodashforEach)(phase.tasks, (task, idx)=>{
|
|
1429
|
+
processTasks(task, phase, idx);
|
|
1430
|
+
});
|
|
1431
|
+
};
|
|
1432
|
+
const getVariableEntity = (value, key, containerId, index, password)=>{
|
|
1433
|
+
const keyNoSyntax = key.replace("${", "").replace("}", "");
|
|
1434
|
+
return {
|
|
1435
|
+
id: `${containerId}/Variable${index}`,
|
|
1436
|
+
key: keyNoSyntax,
|
|
1437
|
+
requiresValue: true,
|
|
1438
|
+
showOnReleaseStart: true,
|
|
1439
|
+
type: password ? "xlrelease.PasswordStringVariable" : "xlrelease.StringVariable",
|
|
1440
|
+
value: value
|
|
1441
|
+
};
|
|
1442
|
+
};
|
|
1443
|
+
const getValueProviderConfigurationEntity = function(containerId) {
|
|
1444
|
+
return {
|
|
1445
|
+
id: `${containerId}/valueProvider`,
|
|
1446
|
+
variable: containerId
|
|
1447
|
+
};
|
|
1448
|
+
};
|
|
1449
|
+
const getDashboardExtension = (dashboard, releaseId)=>{
|
|
1450
|
+
const dashboardExtension = {
|
|
1451
|
+
id: `${releaseId}/summary`,
|
|
1452
|
+
type: DASHBOARD_TYPE,
|
|
1453
|
+
tiles: []
|
|
1454
|
+
};
|
|
1455
|
+
if (dashboard.tiles) (0, $hOLA6$lodashforEach)(dashboard.tiles, function(tile, index) {
|
|
1456
|
+
dashboardExtension.tiles.push(getTileEntity(tile, `${releaseId}/summary`, index));
|
|
1457
|
+
});
|
|
1458
|
+
return dashboardExtension;
|
|
1459
|
+
};
|
|
1460
|
+
function getTileEntity(tile, containerId, index) {
|
|
1461
|
+
tile.id = tile.id || `${containerId}/Tile${index}`;
|
|
1462
|
+
return tile;
|
|
1463
|
+
}
|
|
1464
|
+
return function(release) {
|
|
1465
|
+
release.type = RELEASE_TYPE;
|
|
1466
|
+
if (release.id.indexOf("Applications/") === -1) release.id = `Applications/${release.id}`;
|
|
1467
|
+
if (release.startDate) release.queryableStartDate = release.startDate;
|
|
1468
|
+
else if (release.scheduledStartDate) release.queryableStartDate = release.scheduledStartDate;
|
|
1469
|
+
if (release.endDate) release.queryableEndDate = release.endDate;
|
|
1470
|
+
else if (release.dueDate) release.queryableEndDate = release.dueDate;
|
|
1471
|
+
if ((0, $hOLA6$lodashisUndefined)(release.owner)) release.owner = "Itchy"; // default release manager
|
|
1472
|
+
(0, $hOLA6$lodashforEach)(release.phases, function(phase, index) {
|
|
1473
|
+
processPhases(phase, release, index);
|
|
1474
|
+
});
|
|
1475
|
+
(0, $hOLA6$lodashforEach)(release.teams, function(team, index) {
|
|
1476
|
+
team.type = TEAM_TYPE;
|
|
1477
|
+
team.id = `${release.id}/Team${index}`;
|
|
1478
|
+
});
|
|
1479
|
+
(0, $hOLA6$lodashforEach)(release.attachments, function(attachment, index) {
|
|
1480
|
+
attachment.type = ATTACHMENT_TYPE;
|
|
1481
|
+
attachment.id = `${release.id}/Attachment${index}`;
|
|
1482
|
+
});
|
|
1483
|
+
(0, $hOLA6$lodashforEach)(release.variables, function(variable, index) {
|
|
1484
|
+
(0, $hOLA6$lodashdefaults)(variable, getVariableEntity(variable.value, variable.key, release.id, index));
|
|
1485
|
+
if (variable.valueProvider) (0, $hOLA6$lodashdefaults)(variable.valueProvider, getValueProviderConfigurationEntity(variable.id));
|
|
1486
|
+
});
|
|
1487
|
+
(0, $hOLA6$lodashforEach)((0, $hOLA6$lodashtoPairs)(release.variableValues), function(keyValue, index) {
|
|
1488
|
+
if (!release.variables) release.variables = [];
|
|
1489
|
+
release.variables.push(getVariableEntity(keyValue[1], keyValue[0], release.id, 1000 + index));
|
|
1490
|
+
release.variableValues = undefined;
|
|
1491
|
+
});
|
|
1492
|
+
(0, $hOLA6$lodashforEach)((0, $hOLA6$lodashtoPairs)(release.passwordVariableValues), function(keyValue, index) {
|
|
1493
|
+
if (!release.variables) release.variables = [];
|
|
1494
|
+
release.variables.push(getVariableEntity(keyValue[1], keyValue[0], release.id, 1500 + index, true));
|
|
1495
|
+
release.passwordVariableValues = undefined;
|
|
1496
|
+
});
|
|
1497
|
+
if (release.summary) {
|
|
1498
|
+
release.extensions = [
|
|
1499
|
+
getDashboardExtension(release.summary, release.id)
|
|
1500
|
+
];
|
|
1501
|
+
release.summary = undefined;
|
|
1502
|
+
}
|
|
1503
|
+
};
|
|
1504
|
+
}();
|
|
1505
|
+
|
|
1506
|
+
|
|
1507
|
+
|
|
1508
|
+
const $80c3ae34677b4324$var$JIRA_ISSUE_API_URL = "https://digitalai.atlassian.net/rest/api/2/issue";
|
|
957
1509
|
const $80c3ae34677b4324$var$adminHeaders = {
|
|
958
1510
|
Authorization: "Basic YWRtaW46YWRtaW4=",
|
|
959
1511
|
Cookie: "XSRF-TOKEN=1;",
|
|
@@ -977,29 +1529,46 @@ const $80c3ae34677b4324$export$e0969da9b8fb378d = (0, $hOLA6$test).extend({
|
|
|
977
1529
|
}
|
|
978
1530
|
});
|
|
979
1531
|
class $80c3ae34677b4324$var$Fixtures {
|
|
1532
|
+
archivedReleaseIds = [];
|
|
980
1533
|
releaseIds = [];
|
|
981
1534
|
triggerIds = [];
|
|
982
1535
|
configurationIds = [];
|
|
1536
|
+
globalVariableIds = [];
|
|
1537
|
+
folderIds = [];
|
|
983
1538
|
usernames = [];
|
|
984
1539
|
userProfiles = [];
|
|
985
1540
|
constructor(request, page){
|
|
986
1541
|
this.request = request;
|
|
987
1542
|
this.page = page;
|
|
988
1543
|
}
|
|
989
|
-
|
|
1544
|
+
release(release) {
|
|
990
1545
|
this.initDefaults(release);
|
|
991
1546
|
this.releaseIds.push(release.id);
|
|
992
1547
|
return this.deleteRelease(release.id).then(()=>this.deleteArchivedRelease(release.id)).then(()=>this.doPost("fixtures/release", release));
|
|
993
1548
|
}
|
|
1549
|
+
archivedRelease(release) {
|
|
1550
|
+
this.initDefaults(release);
|
|
1551
|
+
this.archivedReleaseIds.push(release.id);
|
|
1552
|
+
return this.doPost("fixtures/archived", release);
|
|
1553
|
+
}
|
|
994
1554
|
configuration(ci) {
|
|
995
1555
|
this.configurationIds.push(ci.id);
|
|
996
1556
|
return this.doPost("fixtures/shared", [
|
|
997
1557
|
ci
|
|
998
1558
|
]);
|
|
999
1559
|
}
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1560
|
+
getParentId(id) {
|
|
1561
|
+
return id.substring(0, id.lastIndexOf("/"));
|
|
1562
|
+
}
|
|
1563
|
+
folder(folder) {
|
|
1564
|
+
const parentId = this.getParentId(folder.id);
|
|
1565
|
+
//ToDo: Add system teams
|
|
1566
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */ const teams = folder.teams;
|
|
1567
|
+
delete folder.teams;
|
|
1568
|
+
//ToDo: Add Children
|
|
1569
|
+
const children = folder.children || [];
|
|
1570
|
+
delete folder.children;
|
|
1571
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */ return this.doPost(`api/v1/folders/${parentId}`, folder);
|
|
1003
1572
|
}
|
|
1004
1573
|
deleteArchivedRelease(id) {
|
|
1005
1574
|
const releaseId = id.includes("Applications/") ? id : `Applications/${id}`;
|
|
@@ -1014,6 +1583,12 @@ class $80c3ae34677b4324$var$Fixtures {
|
|
|
1014
1583
|
const releaseId = id.includes("Applications/") ? id : `Applications/${id}`;
|
|
1015
1584
|
return this.doDelete(`fixtures/${releaseId}`);
|
|
1016
1585
|
}
|
|
1586
|
+
deleteUser(username) {
|
|
1587
|
+
return this.doDelete(`fixtures/user/${username}`);
|
|
1588
|
+
}
|
|
1589
|
+
deleteUserProfile(userProfile) {
|
|
1590
|
+
return this.doDelete(`fixtures/userProfile/${userProfile}`);
|
|
1591
|
+
}
|
|
1017
1592
|
deleteTrigger(id) {
|
|
1018
1593
|
return this.doDelete(`fixtures/trigger/${id}`);
|
|
1019
1594
|
}
|
|
@@ -1022,19 +1597,96 @@ class $80c3ae34677b4324$var$Fixtures {
|
|
|
1022
1597
|
id
|
|
1023
1598
|
]);
|
|
1024
1599
|
}
|
|
1025
|
-
|
|
1026
|
-
const
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1600
|
+
deleteFolder(folderId) {
|
|
1601
|
+
const id = this.doGet(`api/v1/folders/${folderId}`);
|
|
1602
|
+
return this.doDelete(`api/v1/folders/${id}`);
|
|
1603
|
+
}
|
|
1604
|
+
activityLogs(id, logs) {
|
|
1605
|
+
return this.doPost(`fixtures/activityLogs/${id}`, logs);
|
|
1606
|
+
}
|
|
1607
|
+
globalVariable(variable) {
|
|
1608
|
+
variable.id = variable.id || `Configuration/variables/global/Variable_${variable.key}`;
|
|
1609
|
+
this.globalVariableIds.push(variable.id);
|
|
1610
|
+
variable.requiresValue = false;
|
|
1611
|
+
variable.showOnReleaseStart = false;
|
|
1612
|
+
return this.doPost("api/v1/config/Configuration/variables/global", variable);
|
|
1613
|
+
}
|
|
1614
|
+
async cleanAll() {
|
|
1615
|
+
for (const username of this.usernames)await this.deleteUser(username);
|
|
1616
|
+
for (const userProfile of this.userProfiles)await this.deleteUserProfile(userProfile);
|
|
1617
|
+
for (const triggerId of this.triggerIds)await this.deleteTrigger(triggerId);
|
|
1618
|
+
for (const releaseId of this.releaseIds.reverse())await this.deleteRelease(releaseId);
|
|
1619
|
+
for (const confId of this.configurationIds)await this.deleteConfiguration(confId);
|
|
1620
|
+
for (const folderId of this.folderIds.reverse())await this.deleteFolder(folderId);
|
|
1621
|
+
this.folderIds = [];
|
|
1032
1622
|
this.releaseIds = [];
|
|
1033
1623
|
this.triggerIds = [];
|
|
1034
1624
|
this.configurationIds = [];
|
|
1035
1625
|
this.usernames = [];
|
|
1036
1626
|
this.userProfiles = [];
|
|
1037
|
-
|
|
1627
|
+
}
|
|
1628
|
+
async addJiraTask() {
|
|
1629
|
+
const data = {
|
|
1630
|
+
fields: {
|
|
1631
|
+
project: {
|
|
1632
|
+
key: "RIT"
|
|
1633
|
+
},
|
|
1634
|
+
summary: "Test Task",
|
|
1635
|
+
description: "Test task description",
|
|
1636
|
+
issuetype: {
|
|
1637
|
+
name: "Task"
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
};
|
|
1641
|
+
const headers = {
|
|
1642
|
+
Authorization: `Basic ${btoa("xlr-jira-testuser@xebialabs.com:zgsXK6c3oLVkJxrWVJQy9DB7")}`,
|
|
1643
|
+
Origin: "https://digitalai.atlassian.net/"
|
|
1644
|
+
};
|
|
1645
|
+
const response = await this.request.post($80c3ae34677b4324$var$JIRA_ISSUE_API_URL, {
|
|
1646
|
+
data: data,
|
|
1647
|
+
headers: headers
|
|
1648
|
+
});
|
|
1649
|
+
const json = await response.json();
|
|
1650
|
+
return json.key;
|
|
1651
|
+
}
|
|
1652
|
+
async addUser(username, password) {
|
|
1653
|
+
this.usernames.push(username);
|
|
1654
|
+
await this.doPost("fixtures/user", {
|
|
1655
|
+
username: username,
|
|
1656
|
+
password: password
|
|
1657
|
+
});
|
|
1658
|
+
}
|
|
1659
|
+
async addUserProfile(username, profile) {
|
|
1660
|
+
if (!profile) profile = {};
|
|
1661
|
+
profile.id = username;
|
|
1662
|
+
profile.type = "xlrelease.UserProfile";
|
|
1663
|
+
profile.canonicalId = username.toLowerCase();
|
|
1664
|
+
this.userProfiles.push(profile.canonicalId);
|
|
1665
|
+
await this.doPost("fixtures/userProfile", profile);
|
|
1666
|
+
}
|
|
1667
|
+
async expectJiraTaskStatus(taskId, expectedStatus) {
|
|
1668
|
+
const headers = {
|
|
1669
|
+
Authorization: `Basic ${btoa("xlr-jira-testuser@xebialabs.com:zgsXK6c3oLVkJxrWVJQy9DB7")}`,
|
|
1670
|
+
Origin: "https://digitalai.atlassian.net/"
|
|
1671
|
+
};
|
|
1672
|
+
const response = await this.request.get(`${$80c3ae34677b4324$var$JIRA_ISSUE_API_URL}/${taskId}`, {
|
|
1673
|
+
headers: headers
|
|
1674
|
+
});
|
|
1675
|
+
const json = await response.json();
|
|
1676
|
+
const status = json.fields.status.name;
|
|
1677
|
+
(0, $hOLA6$expect)(status).toBe(expectedStatus);
|
|
1678
|
+
}
|
|
1679
|
+
async expectJiraTaskSummary(taskId, expectedSummary) {
|
|
1680
|
+
const headers = {
|
|
1681
|
+
Authorization: `Basic ${btoa("xlr-jira-testuser@xebialabs.com:zgsXK6c3oLVkJxrWVJQy9DB7")}`,
|
|
1682
|
+
Origin: "https://digitalai.atlassian.net/"
|
|
1683
|
+
};
|
|
1684
|
+
const response = await this.request.get(`${$80c3ae34677b4324$var$JIRA_ISSUE_API_URL}/${taskId}`, {
|
|
1685
|
+
headers: headers
|
|
1686
|
+
});
|
|
1687
|
+
const json = await response.json();
|
|
1688
|
+
const summary = json.fields.summary;
|
|
1689
|
+
(0, $hOLA6$expect)(summary).toBe(expectedSummary);
|
|
1038
1690
|
}
|
|
1039
1691
|
async waitForReleaseStarted(releaseTitle) {
|
|
1040
1692
|
await (0, $hOLA6$expect)(async ()=>{
|
|
@@ -1070,6 +1722,12 @@ class $80c3ae34677b4324$var$Fixtures {
|
|
|
1070
1722
|
getEnvVariable(name) {
|
|
1071
1723
|
return $hOLA6$env[name];
|
|
1072
1724
|
}
|
|
1725
|
+
async archiveRelease(releaseId) {
|
|
1726
|
+
return this.doGet(`fixtures/archive/${releaseId}`);
|
|
1727
|
+
}
|
|
1728
|
+
async preArchiveRelease(releaseId) {
|
|
1729
|
+
return this.doGet(`fixtures/preArchive/${releaseId}`);
|
|
1730
|
+
}
|
|
1073
1731
|
async setFeatures(features) {
|
|
1074
1732
|
return this.doPut("settings/features", features);
|
|
1075
1733
|
}
|
|
@@ -1078,32 +1736,10 @@ class $80c3ae34677b4324$var$Fixtures {
|
|
|
1078
1736
|
{
|
|
1079
1737
|
id: "Configuration/features/xlrelease.TaskDrawer",
|
|
1080
1738
|
type: "xlrelease.TaskDrawer",
|
|
1081
|
-
category: "Stable",
|
|
1082
1739
|
enabled: enabled
|
|
1083
1740
|
}
|
|
1084
1741
|
]);
|
|
1085
1742
|
}
|
|
1086
|
-
async addUser(username, password) {
|
|
1087
|
-
this.usernames.push(username);
|
|
1088
|
-
return await this.doPost("fixtures/user", {
|
|
1089
|
-
username: username,
|
|
1090
|
-
password: password
|
|
1091
|
-
});
|
|
1092
|
-
}
|
|
1093
|
-
async addUserProfile(username, profile) {
|
|
1094
|
-
if (!profile) profile = {};
|
|
1095
|
-
profile.id = username;
|
|
1096
|
-
profile.type = "xlrelease.UserProfile";
|
|
1097
|
-
profile.canonicalId = username.toLowerCase();
|
|
1098
|
-
this.userProfiles.push(profile.canonicalId);
|
|
1099
|
-
return await this.doPost("fixtures/userProfile", profile);
|
|
1100
|
-
}
|
|
1101
|
-
async deleteUser(username) {
|
|
1102
|
-
return await this.request.delete(`fixtures/user/${username}`);
|
|
1103
|
-
}
|
|
1104
|
-
async deleteUserProfile(username) {
|
|
1105
|
-
return await this.request.delete(`fixtures/userProfile/${username}`);
|
|
1106
|
-
}
|
|
1107
1743
|
doPost(url, body) {
|
|
1108
1744
|
return this.request.post(url, {
|
|
1109
1745
|
data: body,
|