@digital-ai/devops-page-object-release 0.0.11 → 0.0.12
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 +9 -0
- package/dist/main.js +1796 -1451
- package/dist/main.js.map +1 -1
- package/dist/module.js +618 -273
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +197 -137
- 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,11 @@ 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
|
-
if (amount === 1) await (0, $hOLA6$expect)(this.page.locator(".release").getByText(releaseTitle)).toBeVisible(
|
|
27
|
+
if (amount === 1) await (0, $hOLA6$expect)(this.page.locator(".release").getByText(releaseTitle)).toBeVisible({
|
|
28
|
+
timeout: 5000
|
|
29
|
+
});
|
|
214
30
|
else await (0, $hOLA6$expect)(this.page.locator(".release").getByText(releaseTitle).count()).toBe(amount);
|
|
215
31
|
}
|
|
216
32
|
async openReleaseByName(releaseTitle) {
|
|
@@ -229,7 +45,7 @@ class $862f65268e488e83$export$fb932093f944abe4 extends (0, $9626bc9256ce31f7$ex
|
|
|
229
45
|
await this.page.locator(".popover-content xlr-context-menu a", {
|
|
230
46
|
hasText: "View releases"
|
|
231
47
|
}).click();
|
|
232
|
-
return new (0, $
|
|
48
|
+
return new (0, $5359280e98d97ff9$export$a678525e79c4ccc4)(this.page);
|
|
233
49
|
}
|
|
234
50
|
async openContextMenu(title) {
|
|
235
51
|
await (0, $hOLA6$expect)(async ()=>{
|
|
@@ -394,6 +210,56 @@ class $3fa741329d8067d5$export$d4865631ba74f3e2 extends (0, $9626bc9256ce31f7$ex
|
|
|
394
210
|
}
|
|
395
211
|
|
|
396
212
|
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
class $90bb70a7e909e500$export$519356f6c50361f7 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
|
|
216
|
+
constructor(page){
|
|
217
|
+
super(page);
|
|
218
|
+
this.railLocator = this.page.locator("task-drawer .dot-drawer .task-drawer-content");
|
|
219
|
+
}
|
|
220
|
+
async setValueFromMap(propertyName, key, value) {
|
|
221
|
+
await this.railLocator.locator(`.input-with-map[data-test-id="${propertyName}"] button.add-new-button`).click();
|
|
222
|
+
await this.railLocator.locator(`.input-with-map[data-test-id="${propertyName}"] input[id="new-row-key-input"]`).fill(key);
|
|
223
|
+
await this.railLocator.locator(`.input-with-map[data-test-id="${propertyName}"] input[id="new-row-value-input"]`).fill(value);
|
|
224
|
+
await this.railLocator.locator(`.input-with-map[data-test-id="${propertyName}"] button.map-row-save-button`).click();
|
|
225
|
+
}
|
|
226
|
+
async setScript(script) {
|
|
227
|
+
await this.page.locator(".code-editor textarea.ace_text-input").clear();
|
|
228
|
+
await this.page.locator(".code-editor textarea.ace_text-input").fill(script);
|
|
229
|
+
await this.page.locator('.code-editor .header button:has-text("Save")').click();
|
|
230
|
+
}
|
|
231
|
+
async expectScriptToContain(script) {
|
|
232
|
+
await (0, $hOLA6$expect)(this.page.locator(".code-editor .ace_content")).toContainText(script);
|
|
233
|
+
}
|
|
234
|
+
async abort(comment) {
|
|
235
|
+
await this.page.getByTestId("single-action-button").click();
|
|
236
|
+
await this.page.getByTestId("task-action-comment").click();
|
|
237
|
+
await this.page.getByTestId("task-action-comment").fill(comment);
|
|
238
|
+
await this.page.getByTestId("task-action-confirm").click();
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
class $69e86f559cdf2bd0$export$15d3f9b095bb5188 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
|
|
246
|
+
async expectCommentToContain(text) {
|
|
247
|
+
await (0, $hOLA6$expect)(this.page.locator(".task-comment .markdown-wrapper p")).toContainText(text);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
class $9c357602b6f466e7$export$aa59788fdecae2f2 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
|
|
255
|
+
async expectWithAttachment(filename) {
|
|
256
|
+
const test = this.page.locator(".task-attachments-grid .file-item-text");
|
|
257
|
+
await test.isVisible();
|
|
258
|
+
await (0, $hOLA6$expect)(test).toContainText(filename);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
|
|
397
263
|
class $8e39246218b802fc$export$e946776eae644790 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
|
|
398
264
|
constructor(page){
|
|
399
265
|
super(page);
|
|
@@ -404,8 +270,11 @@ class $8e39246218b802fc$export$e946776eae644790 extends (0, $9626bc9256ce31f7$ex
|
|
|
404
270
|
this.cancelButton = this.page.getByTestId("task-action-cancel");
|
|
405
271
|
this.commentBox = this.page.getByTestId("task-action-comment");
|
|
406
272
|
this.confirm = this.page.getByTestId("task-action-confirm");
|
|
273
|
+
this.activity = new (0, $69e86f559cdf2bd0$export$15d3f9b095bb5188)(page);
|
|
274
|
+
this.attachment = new (0, $9c357602b6f466e7$export$aa59788fdecae2f2)(page);
|
|
407
275
|
this.config = new (0, $e44e9af564fb00f7$export$64c93bc7fb9ca44e)(page);
|
|
408
276
|
this.condition = new (0, $3fa741329d8067d5$export$d4865631ba74f3e2)(page);
|
|
277
|
+
this.overview = new (0, $90bb70a7e909e500$export$519356f6c50361f7)(page);
|
|
409
278
|
this.skipMenu = this.page.getByRole("menuitem", {
|
|
410
279
|
name: "Skip"
|
|
411
280
|
});
|
|
@@ -454,10 +323,62 @@ class $8e39246218b802fc$export$e946776eae644790 extends (0, $9626bc9256ce31f7$ex
|
|
|
454
323
|
}
|
|
455
324
|
|
|
456
325
|
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
class $c9bb587dd92143c3$export$d1077068a9cc9f17 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
|
|
329
|
+
constructor(page){
|
|
330
|
+
super(page);
|
|
331
|
+
}
|
|
332
|
+
async editReleaseName(name) {
|
|
333
|
+
await this.page.locator("#release-form-title").clear();
|
|
334
|
+
await this.page.locator("#release-form-title").fill(name);
|
|
335
|
+
}
|
|
336
|
+
async setDescription(description) {
|
|
337
|
+
await this.page.locator(".display > .xl-icon").first().click();
|
|
338
|
+
await this.page.locator("textarea").click();
|
|
339
|
+
await this.page.locator("textarea").clear();
|
|
340
|
+
await this.page.locator("textarea").fill(description);
|
|
341
|
+
await this.page.getByText("Save").first().click();
|
|
342
|
+
}
|
|
343
|
+
async setScriptUsername(username) {
|
|
344
|
+
await this.page.getByPlaceholder("Set user...").waitFor();
|
|
345
|
+
await this.page.getByPlaceholder("Set user...").click();
|
|
346
|
+
await this.page.locator('input[name=""]').fill(username, {
|
|
347
|
+
timeout: 2000
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
async setScriptUserPassword(password) {
|
|
351
|
+
await this.page.locator('span[name="scriptUserPassword"]').waitFor();
|
|
352
|
+
await this.page.locator('span[name="scriptUserPassword"]').click();
|
|
353
|
+
await this.page.locator('input[name="scriptUserPassword"]').fill(password, {
|
|
354
|
+
timeout: 2000
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
async save() {
|
|
358
|
+
await this.page.getByRole("button", {
|
|
359
|
+
name: "Save"
|
|
360
|
+
}).click({
|
|
361
|
+
timeout: 2000
|
|
362
|
+
});
|
|
363
|
+
await (0, $hOLA6$expect)(this.page.locator(".form-footer .last-saved")).toBeVisible();
|
|
364
|
+
}
|
|
365
|
+
async reset() {
|
|
366
|
+
await this.page.getByRole("button", {
|
|
367
|
+
name: "Reset"
|
|
368
|
+
}).waitFor();
|
|
369
|
+
await this.page.getByRole("button", {
|
|
370
|
+
name: "Reset"
|
|
371
|
+
}).click();
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
|
|
457
376
|
class $43cbcdfccb6c2a76$export$f43492e8ac3c566 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
|
|
458
377
|
constructor(page){
|
|
459
378
|
super(page);
|
|
460
379
|
this.taskDrawer = new (0, $8e39246218b802fc$export$e946776eae644790)(page);
|
|
380
|
+
this.properties = new (0, $c9bb587dd92143c3$export$d1077068a9cc9f17)(page);
|
|
381
|
+
this.variables = new (0, $f48771b486a3eb8f$export$a87f0ae8695e74be)(page);
|
|
461
382
|
}
|
|
462
383
|
async openTriggers() {
|
|
463
384
|
await this.openSubPage("Triggers");
|
|
@@ -479,6 +400,11 @@ class $43cbcdfccb6c2a76$export$f43492e8ac3c566 extends (0, $9626bc9256ce31f7$exp
|
|
|
479
400
|
name: "Start"
|
|
480
401
|
}).click();
|
|
481
402
|
}
|
|
403
|
+
async waitForCompletion(timeout) {
|
|
404
|
+
await this.page.locator("#release.completed").waitFor({
|
|
405
|
+
timeout: timeout
|
|
406
|
+
});
|
|
407
|
+
}
|
|
482
408
|
async waitForTaskCompleted(taskTitle) {
|
|
483
409
|
await (0, $hOLA6$expect)(this.page.locator(".task.completed").getByText(taskTitle, {
|
|
484
410
|
exact: true
|
|
@@ -522,12 +448,31 @@ class $43cbcdfccb6c2a76$export$f43492e8ac3c566 extends (0, $9626bc9256ce31f7$exp
|
|
|
522
448
|
});
|
|
523
449
|
}
|
|
524
450
|
async openTaskDrawer(taskName) {
|
|
525
|
-
await this.page.locator(".task-header").getByText(taskName
|
|
451
|
+
await this.page.locator(".task-header").getByText(taskName, {
|
|
452
|
+
exact: true
|
|
453
|
+
}).click();
|
|
526
454
|
return this.taskDrawer;
|
|
527
455
|
}
|
|
528
456
|
async openVariables() {
|
|
529
457
|
await this.openReleaseMenu("Variables");
|
|
530
|
-
|
|
458
|
+
}
|
|
459
|
+
async openProperties() {
|
|
460
|
+
await this.openReleaseMenu("Properties");
|
|
461
|
+
}
|
|
462
|
+
async openReleaseFlow() {
|
|
463
|
+
await this.openReleaseMenu("Release flow");
|
|
464
|
+
}
|
|
465
|
+
async openRelationships() {
|
|
466
|
+
await this.openReleaseMenu("Relationships");
|
|
467
|
+
}
|
|
468
|
+
async openTeamsPermissions() {
|
|
469
|
+
await this.openReleaseMenu("Teams & Permissions");
|
|
470
|
+
}
|
|
471
|
+
async openDashboard() {
|
|
472
|
+
await this.openReleaseMenu("Dashboard");
|
|
473
|
+
}
|
|
474
|
+
async openActivityLogs() {
|
|
475
|
+
await this.openReleaseMenu("ActivityLogs");
|
|
531
476
|
}
|
|
532
477
|
async openReleaseMenu(menuItem) {
|
|
533
478
|
await this.page.locator(`navigation-sidebar ul li`).getByText(menuItem, {
|
|
@@ -564,6 +509,9 @@ class $43cbcdfccb6c2a76$export$f43492e8ac3c566 extends (0, $9626bc9256ce31f7$exp
|
|
|
564
509
|
}
|
|
565
510
|
}
|
|
566
511
|
}
|
|
512
|
+
async backToRelease() {
|
|
513
|
+
await this.page.locator(".icon-back").click();
|
|
514
|
+
}
|
|
567
515
|
}
|
|
568
516
|
class $43cbcdfccb6c2a76$var$Phase extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
|
|
569
517
|
constructor(page, phaseName){
|
|
@@ -572,27 +520,46 @@ class $43cbcdfccb6c2a76$var$Phase extends (0, $9626bc9256ce31f7$export$2b65d1d97
|
|
|
572
520
|
hasText: phaseName
|
|
573
521
|
});
|
|
574
522
|
}
|
|
575
|
-
async
|
|
576
|
-
await this.phaseLocator.
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
await this.phaseLocator.locator(".
|
|
523
|
+
async setTitle(title) {
|
|
524
|
+
await this.phaseLocator.locator(".phase-header .display").click();
|
|
525
|
+
await this.phaseLocator.locator(".phase-header input").clear();
|
|
526
|
+
await this.phaseLocator.locator(".phase-header input").fill(title);
|
|
527
|
+
await this.phaseLocator.locator(".phase-header input").blur();
|
|
528
|
+
}
|
|
529
|
+
async expectTaskBorderWithColor(taskName, color) {
|
|
530
|
+
await (0, $hOLA6$expect)(this.page.locator(`.task-box:has-text('${taskName}')`)).toHaveCSS("border-top-color", color);
|
|
531
|
+
}
|
|
532
|
+
async addTaskInPhase(taskTitle, taskType) {
|
|
533
|
+
await this.phaseLocator.getByText("Add task").click();
|
|
534
|
+
await this.phaseLocator.getByPlaceholder("Task title...").click();
|
|
535
|
+
await this.phaseLocator.getByPlaceholder("Task title...").fill(taskTitle);
|
|
580
536
|
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();
|
|
537
|
+
const count = taskType.length - 1;
|
|
538
|
+
for(let i = 0; i < count; i++){
|
|
539
|
+
await this.page.locator('[data-test="' + taskType[i] + '"]').getByText(taskType[i]).click();
|
|
540
|
+
await this.page.getByText(taskType[i + 1]).click();
|
|
541
|
+
}
|
|
590
542
|
await this.phaseLocator.locator(".quick-controls-container a").getByText("Add", {
|
|
591
543
|
exact: true
|
|
592
544
|
}).click();
|
|
545
|
+
await this.phaseLocator.locator(".button.cancel").click();
|
|
546
|
+
await (0, $hOLA6$expect)(this.phaseLocator.locator(".task").filter({
|
|
547
|
+
hasText: taskTitle
|
|
548
|
+
})).toBeVisible({
|
|
549
|
+
timeout: 5000
|
|
550
|
+
});
|
|
593
551
|
}
|
|
594
|
-
|
|
595
|
-
|
|
552
|
+
async getNumberOfTasks() {
|
|
553
|
+
return await this.phaseLocator.locator(".task").count();
|
|
554
|
+
}
|
|
555
|
+
async expectToHaveNoneditableTitle(phaseTitle) {
|
|
556
|
+
await (0, $hOLA6$expect)(this.phaseLocator.locator(".phase-title > span")).toContainText(phaseTitle);
|
|
557
|
+
}
|
|
558
|
+
async expectToHaveTitle(phaseTitle) {
|
|
559
|
+
await (0, $hOLA6$expect)(this.phaseLocator.locator(".phase-title")).toContainText(phaseTitle);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
596
563
|
|
|
597
564
|
|
|
598
565
|
|
|
@@ -788,6 +755,7 @@ class $3a340a3f4fd8f04d$export$43682cddead1dd78 extends (0, $9626bc9256ce31f7$ex
|
|
|
788
755
|
year: "numeric"
|
|
789
756
|
};
|
|
790
757
|
this.monthFormat = today.toLocaleDateString("en-US", options);
|
|
758
|
+
this.monthFormat = this.monthFormat.replace(/(\w+) (\d+)/, "$1, $2");
|
|
791
759
|
await (0, $hOLA6$expect)(this.page).toHaveTitle("Release calendar / Home - Digital.ai Release");
|
|
792
760
|
return this;
|
|
793
761
|
}
|
|
@@ -818,7 +786,7 @@ class $3a340a3f4fd8f04d$export$43682cddead1dd78 extends (0, $9626bc9256ce31f7$ex
|
|
|
818
786
|
return downloadCount;
|
|
819
787
|
}
|
|
820
788
|
async verifyDayView() {
|
|
821
|
-
await this.page.getByRole("combobox").click();
|
|
789
|
+
await this.page.locator(".tl-header-navigation").getByRole("combobox").click();
|
|
822
790
|
await this.page.getByRole("option", {
|
|
823
791
|
name: "Day"
|
|
824
792
|
}).click();
|
|
@@ -829,7 +797,7 @@ class $3a340a3f4fd8f04d$export$43682cddead1dd78 extends (0, $9626bc9256ce31f7$ex
|
|
|
829
797
|
await (0, $hOLA6$expect)(this.page.getByText(this.dayFormat)).toBeVisible();
|
|
830
798
|
}
|
|
831
799
|
async verifyYearView() {
|
|
832
|
-
await this.page.getByRole("combobox").click();
|
|
800
|
+
await this.page.locator(".tl-header-navigation").getByRole("combobox").click();
|
|
833
801
|
await this.page.getByRole("option", {
|
|
834
802
|
name: "Year"
|
|
835
803
|
}).click();
|
|
@@ -837,11 +805,147 @@ class $3a340a3f4fd8f04d$export$43682cddead1dd78 extends (0, $9626bc9256ce31f7$ex
|
|
|
837
805
|
name: "Today"
|
|
838
806
|
}).click();
|
|
839
807
|
//Verify Page has correct Year format displayed at the page bottom
|
|
840
|
-
await (0, $hOLA6$expect)(this.page.
|
|
808
|
+
await (0, $hOLA6$expect)(this.page.locator(".tl-footer-label").filter({
|
|
809
|
+
hasText: this.yearFormatString
|
|
810
|
+
})).toHaveText(this.yearFormatString);
|
|
811
|
+
}
|
|
812
|
+
async verifyMonthView() {
|
|
813
|
+
await this.page.locator(".tl-header-navigation").getByRole("combobox").click();
|
|
814
|
+
await this.page.getByRole("option", {
|
|
815
|
+
name: "Month"
|
|
816
|
+
}).click();
|
|
817
|
+
await this.page.getByRole("button", {
|
|
818
|
+
name: "Today"
|
|
819
|
+
}).click();
|
|
820
|
+
//Verify Page has correct Year format displayed at the page bottom
|
|
821
|
+
await (0, $hOLA6$expect)(this.page.locator(".tl-footer-label").filter({
|
|
822
|
+
hasText: this.monthFormat
|
|
823
|
+
})).toHaveText(this.monthFormat);
|
|
824
|
+
}
|
|
825
|
+
async verifyPageContent(title) {
|
|
826
|
+
const view_type = [
|
|
827
|
+
"Day",
|
|
828
|
+
"Week",
|
|
829
|
+
"Month",
|
|
830
|
+
"Year"
|
|
831
|
+
];
|
|
832
|
+
for (const view of view_type){
|
|
833
|
+
await this.page.locator(".tl-header-navigation").getByRole("combobox").click();
|
|
834
|
+
await this.page.getByRole("option", {
|
|
835
|
+
name: view
|
|
836
|
+
}).click();
|
|
837
|
+
await this.page.getByRole("button", {
|
|
838
|
+
name: "Today"
|
|
839
|
+
}).click();
|
|
840
|
+
//Verify Page has correct Year format displayed at the page bottom
|
|
841
|
+
await (0, $hOLA6$expect)(this.page.getByText(title)).toBeVisible();
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
async filterReleaseByTitle(title) {
|
|
845
|
+
await this.page.getByPlaceholder("Filter by release title").click();
|
|
846
|
+
await this.page.getByPlaceholder("Filter by release title").fill(title);
|
|
847
|
+
await this.page.getByPlaceholder("Filter by release title").press("Enter");
|
|
848
|
+
//Verify Page has correct Year format displayed at the page bottom
|
|
849
|
+
await this.verifyPageContent(title);
|
|
850
|
+
}
|
|
851
|
+
async filterReleaseByTags(tags, release_title) {
|
|
852
|
+
await this.page.locator(".tl-filter-release-tags").locator(".react-tagsinput").click();
|
|
853
|
+
for (let tag of tags){
|
|
854
|
+
tag = tag.toString();
|
|
855
|
+
await this.page.locator(".tl-filter-release-tags").locator(".react-tagsinput-input").fill(tag);
|
|
856
|
+
await this.page.getByTitle(tag).locator("i").click();
|
|
857
|
+
}
|
|
858
|
+
await this.verifyPageContent(release_title);
|
|
859
|
+
}
|
|
860
|
+
async filterTaskByTags(tags, task_title, release_title) {
|
|
861
|
+
await this.page.locator(".tl-filter-task-tags").locator(".react-tagsinput").click();
|
|
862
|
+
for (let tag of tags){
|
|
863
|
+
tag = tag.toString();
|
|
864
|
+
await this.page.locator(".tl-filter-task-tags").locator(".react-tagsinput-input").fill(tag);
|
|
865
|
+
await this.page.getByTitle(tag).locator("i").click();
|
|
866
|
+
}
|
|
867
|
+
//Make sure task is visible on calnedar page
|
|
868
|
+
await this.verifyPageContent(task_title);
|
|
869
|
+
//Make sure parent release of the selected task is visible on calnedar page
|
|
870
|
+
await this.verifyPageContent(release_title);
|
|
871
|
+
}
|
|
872
|
+
async filterReleaseByStatus(release_status, release_title) {
|
|
873
|
+
if (!await this.page.locator(".tl-filter-advanced").isVisible()) await this.page.getByRole("button", {
|
|
874
|
+
name: "Advanced filters"
|
|
875
|
+
}).click();
|
|
876
|
+
await this.page.locator(".tl-filter-release-status").locator(".react-tagsinput").click();
|
|
877
|
+
await this.page.getByTitle(release_status).locator("i").first().click();
|
|
878
|
+
await this.verifyPageContent(release_title);
|
|
879
|
+
}
|
|
880
|
+
async filterReleaseByRisk(release_risk, release_title) {
|
|
881
|
+
if (!await this.page.locator(".tl-filter-advanced").isVisible()) await this.page.getByRole("button", {
|
|
882
|
+
name: "Advanced filters"
|
|
883
|
+
}).click();
|
|
884
|
+
await this.page.locator(".tl-filter-risk-filter").getByRole("combobox").click();
|
|
885
|
+
await this.page.getByRole("option", {
|
|
886
|
+
name: release_risk
|
|
887
|
+
}).click();
|
|
888
|
+
await this.verifyPageContent(release_title);
|
|
889
|
+
}
|
|
890
|
+
async filterFlaggedRelease(release_title) {
|
|
891
|
+
if (!await this.page.locator(".tl-filter-advanced").isVisible()) await this.page.getByRole("button", {
|
|
892
|
+
name: "Advanced filters"
|
|
893
|
+
}).click();
|
|
894
|
+
if (await this.page.locator(".tl-filter-flag-only.btn.btn-flat.btn-fixed.button-toggle-filter.active").isVisible()) await this.page.getByRole("button", {
|
|
895
|
+
name: " Flagged"
|
|
896
|
+
}).click();
|
|
897
|
+
await this.verifyPageContent(release_title);
|
|
898
|
+
}
|
|
899
|
+
async viewRelease(release_title, release_id) {
|
|
900
|
+
await this.page.locator(".tl-header-navigation").getByRole("combobox").click();
|
|
901
|
+
await this.page.getByRole("option", {
|
|
902
|
+
name: "Day"
|
|
903
|
+
}).click();
|
|
904
|
+
await this.page.getByRole("button", {
|
|
905
|
+
name: "Today"
|
|
906
|
+
}).click();
|
|
907
|
+
await this.page.getByText(release_title).click();
|
|
908
|
+
await this.page.locator(".release-modal-container").locator(".xl-icon.release-icon").click();
|
|
909
|
+
const releaseurl = `/#/releases/${release_id}`;
|
|
910
|
+
const currentURL = await this.page.url();
|
|
911
|
+
// Check if the release name present in redirected URL
|
|
912
|
+
(0, $hOLA6$expect)(currentURL).toContain(releaseurl);
|
|
913
|
+
}
|
|
914
|
+
async viewDependency(source_release, dest_release) {
|
|
915
|
+
const source_text = source_release + "dependencies";
|
|
916
|
+
await this.page.locator(".tl-header-navigation").getByRole("combobox").click();
|
|
917
|
+
await this.page.getByRole("option", {
|
|
918
|
+
name: "Day"
|
|
919
|
+
}).click();
|
|
920
|
+
await this.page.getByRole("button", {
|
|
921
|
+
name: "Today"
|
|
922
|
+
}).click();
|
|
923
|
+
await this.page.getByText(source_release).click();
|
|
924
|
+
await this.page.locator(".release-modal-container").locator(".xl-icon.cluster-dependencies-icon").click();
|
|
925
|
+
await (0, $hOLA6$expect)(this.page.locator(".tl-drawer-navigation-header")).toHaveText(source_text);
|
|
926
|
+
await (0, $hOLA6$expect)(this.page.locator(".tl-drawer-dependency-body-title-text")).toHaveText(dest_release);
|
|
927
|
+
}
|
|
928
|
+
async downloadIcsCalendar(release_title) {
|
|
929
|
+
let downloadCount = 0;
|
|
930
|
+
// Listen to download events
|
|
931
|
+
this.page.on("download", (_download)=>{
|
|
932
|
+
downloadCount++;
|
|
933
|
+
});
|
|
934
|
+
await this.page.locator(".tl-header-navigation").getByRole("combobox").click();
|
|
935
|
+
await this.page.getByRole("option", {
|
|
936
|
+
name: "Day"
|
|
937
|
+
}).click();
|
|
938
|
+
await this.page.getByRole("button", {
|
|
939
|
+
name: "Today"
|
|
940
|
+
}).click();
|
|
941
|
+
await this.page.getByText(release_title).click();
|
|
942
|
+
await this.page.locator(".release-modal-container").locator(".xl-icon.calendar-icon").click();
|
|
943
|
+
return downloadCount;
|
|
841
944
|
}
|
|
842
945
|
}
|
|
843
946
|
|
|
844
947
|
|
|
948
|
+
|
|
845
949
|
class $e72552cbf941ecfa$export$b8a61e5c71402559 {
|
|
846
950
|
constructor(page){
|
|
847
951
|
this.page = page;
|
|
@@ -851,6 +955,7 @@ class $e72552cbf941ecfa$export$b8a61e5c71402559 {
|
|
|
851
955
|
this.applicationPage = new (0, $c313b10398604df2$export$1533b625ec0c75e2)(page);
|
|
852
956
|
this.taskDetailsPage = new (0, $9ca6e63d357957dd$export$922081b54f2ab994)(page);
|
|
853
957
|
this.releaseCalendarPage = new (0, $3a340a3f4fd8f04d$export$43682cddead1dd78)(page);
|
|
958
|
+
this.releaseListPage = new (0, $5359280e98d97ff9$export$a678525e79c4ccc4)(page);
|
|
854
959
|
}
|
|
855
960
|
async openTemplate(id) {
|
|
856
961
|
return this.openReleaseOrTemplate(id, false);
|
|
@@ -865,83 +970,83 @@ class $e72552cbf941ecfa$export$b8a61e5c71402559 {
|
|
|
865
970
|
return new (0, $6720a523bcb1cce0$export$3cac5fd37ae64b91)(this.page).openPersonalAccessTokenPage();
|
|
866
971
|
}
|
|
867
972
|
async gotoFolderPage() {
|
|
868
|
-
await this.page.locator("ul.side-nav li", {
|
|
869
|
-
|
|
973
|
+
await this.page.locator("ul.side-nav li").getByText("Folders", {
|
|
974
|
+
exact: true
|
|
870
975
|
}).click();
|
|
871
976
|
}
|
|
872
977
|
async gotoTaskPage() {
|
|
873
|
-
await this.page.locator("ul.side-nav li", {
|
|
874
|
-
|
|
978
|
+
await this.page.locator("ul.side-nav li").getByText("Tasks", {
|
|
979
|
+
exact: true
|
|
875
980
|
}).click();
|
|
876
981
|
}
|
|
877
982
|
async gotoReleasePage() {
|
|
878
|
-
await this.page.locator("ul.side-nav li", {
|
|
879
|
-
|
|
983
|
+
await this.page.locator("ul.side-nav li").getByText("Releases", {
|
|
984
|
+
exact: true
|
|
880
985
|
}).click();
|
|
881
986
|
}
|
|
882
987
|
async gotoWorkflowCatalogPage() {
|
|
883
|
-
await this.page.locator("ul.side-nav li", {
|
|
884
|
-
|
|
988
|
+
await this.page.locator("ul.side-nav li").getByText("Workflow catalog", {
|
|
989
|
+
exact: true
|
|
885
990
|
}).click();
|
|
886
991
|
}
|
|
887
992
|
async gotoWorkflowsPage() {
|
|
888
|
-
await this.page.locator("ul.side-nav li", {
|
|
889
|
-
|
|
993
|
+
await this.page.locator("ul.side-nav li").getByText("Workflows", {
|
|
994
|
+
exact: true
|
|
890
995
|
}).click();
|
|
891
996
|
}
|
|
892
997
|
async gotoGroupsPage() {
|
|
893
|
-
await this.page.locator("ul.side-nav li", {
|
|
894
|
-
|
|
998
|
+
await this.page.locator("ul.side-nav li").getByText("Groups", {
|
|
999
|
+
exact: true
|
|
895
1000
|
}).click();
|
|
896
1001
|
}
|
|
897
1002
|
async gotoReleaseCalenderPage() {
|
|
898
|
-
await this.page.locator("ul.side-nav li", {
|
|
899
|
-
|
|
1003
|
+
await this.page.locator("ul.side-nav li").getByText("Release calendar", {
|
|
1004
|
+
exact: true
|
|
900
1005
|
}).click();
|
|
901
1006
|
}
|
|
902
1007
|
async gotoDeliveriesPage() {
|
|
903
|
-
await this.page.locator("ul.side-nav li", {
|
|
904
|
-
|
|
1008
|
+
await this.page.locator("ul.side-nav li").getByText("Deliveries", {
|
|
1009
|
+
exact: true
|
|
905
1010
|
}).click();
|
|
906
1011
|
}
|
|
907
1012
|
async gotoTriggersPage() {
|
|
908
|
-
await this.page.locator("ul.side-nav li", {
|
|
909
|
-
|
|
1013
|
+
await this.page.locator("ul.side-nav li").getByText("Triggers", {
|
|
1014
|
+
exact: true
|
|
910
1015
|
}).click();
|
|
911
1016
|
}
|
|
912
1017
|
async gotoDigitalAnalyticsPage() {
|
|
913
|
-
await this.page.locator("ul.side-nav li", {
|
|
914
|
-
|
|
1018
|
+
await this.page.locator("ul.side-nav li").getByText("Digital.ai Analytics", {
|
|
1019
|
+
exact: true
|
|
915
1020
|
}).click();
|
|
916
1021
|
}
|
|
917
1022
|
async gotoReportsPage() {
|
|
918
|
-
await this.page.locator("ul.side-nav li", {
|
|
919
|
-
|
|
1023
|
+
await this.page.locator("ul.side-nav li").getByText("Reports", {
|
|
1024
|
+
exact: true
|
|
920
1025
|
}).click();
|
|
921
1026
|
}
|
|
922
1027
|
async gotoTemplatesPage() {
|
|
923
|
-
await this.page.locator("ul.side-nav li", {
|
|
924
|
-
|
|
1028
|
+
await this.page.locator("ul.side-nav li").getByText("Templates", {
|
|
1029
|
+
exact: true
|
|
925
1030
|
}).click();
|
|
926
1031
|
}
|
|
927
1032
|
async gotoEnvironmentsPage() {
|
|
928
|
-
await this.page.locator("ul.side-nav li", {
|
|
929
|
-
|
|
1033
|
+
await this.page.locator("ul.side-nav li").getByText("Environments", {
|
|
1034
|
+
exact: true
|
|
930
1035
|
}).click();
|
|
931
1036
|
}
|
|
932
1037
|
async gotoEnvironmentsCalenderPage() {
|
|
933
|
-
await this.page.locator("ul.side-nav li", {
|
|
934
|
-
|
|
1038
|
+
await this.page.locator("ul.side-nav li").getByText("Environments calendar", {
|
|
1039
|
+
exact: true
|
|
935
1040
|
}).click();
|
|
936
1041
|
}
|
|
937
1042
|
async gotoGobalVariablesPage() {
|
|
938
|
-
await this.page.locator("ul.side-nav li", {
|
|
939
|
-
|
|
1043
|
+
await this.page.locator("ul.side-nav li").getByText("Global variables", {
|
|
1044
|
+
exact: true
|
|
940
1045
|
}).click();
|
|
941
1046
|
}
|
|
942
1047
|
async gotoConnectionsPage() {
|
|
943
|
-
await this.page.locator("ul.side-nav li", {
|
|
944
|
-
|
|
1048
|
+
await this.page.locator("ul.side-nav li").getByText("Connections", {
|
|
1049
|
+
exact: true
|
|
945
1050
|
}).click();
|
|
946
1051
|
}
|
|
947
1052
|
async openReleaseOrTemplate(id, release) {
|
|
@@ -954,6 +1059,192 @@ class $e72552cbf941ecfa$export$b8a61e5c71402559 {
|
|
|
954
1059
|
|
|
955
1060
|
|
|
956
1061
|
|
|
1062
|
+
|
|
1063
|
+
class $4444bee76761dfb1$export$f14c0e3f98d164c0 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
|
|
1064
|
+
/**
|
|
1065
|
+
* Login with username and password
|
|
1066
|
+
* @param userName
|
|
1067
|
+
* @param password
|
|
1068
|
+
*/ async login(userName, password) {
|
|
1069
|
+
await this.page.goto("./#/login");
|
|
1070
|
+
await (0, $hOLA6$expect)(this.page).toHaveTitle("Digital.ai Release");
|
|
1071
|
+
await this.page.getByPlaceholder("User").fill(userName, {
|
|
1072
|
+
timeout: 1000
|
|
1073
|
+
});
|
|
1074
|
+
await this.page.getByPlaceholder("Password").fill(password, {
|
|
1075
|
+
timeout: 10000
|
|
1076
|
+
});
|
|
1077
|
+
await this.page.getByRole("button", {
|
|
1078
|
+
name: "Log in"
|
|
1079
|
+
}).click({
|
|
1080
|
+
timeout: 10000
|
|
1081
|
+
});
|
|
1082
|
+
await this.page.waitForTimeout(1000);
|
|
1083
|
+
}
|
|
1084
|
+
/**
|
|
1085
|
+
* Logout as authenticated user
|
|
1086
|
+
*/ async logout() {
|
|
1087
|
+
await this.page.locator("button.dot-avatar").click();
|
|
1088
|
+
await this.page.getByText("Log out", {
|
|
1089
|
+
exact: true
|
|
1090
|
+
}).click();
|
|
1091
|
+
}
|
|
1092
|
+
/**
|
|
1093
|
+
* Expect login to be restricted for a user
|
|
1094
|
+
*/ async expectLoginDisallowed() {
|
|
1095
|
+
const val = await this.page.textContent('.error-content span[ng-show="loginInfo.failedStatus == 403"]');
|
|
1096
|
+
(0, $hOLA6$expect)(val).toContain("You do not have 'login' permission.");
|
|
1097
|
+
}
|
|
1098
|
+
/**
|
|
1099
|
+
* Expect the respective user is logged In
|
|
1100
|
+
* @param username
|
|
1101
|
+
*/ async expectToBeLogged(username) {
|
|
1102
|
+
const val = await this.page.locator("top-toolbar .avatar-wrapper span.dot-tooltip").getAttribute("aria-label");
|
|
1103
|
+
(0, $hOLA6$expect)(val).toContain(username);
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
|
|
1108
|
+
|
|
1109
|
+
|
|
1110
|
+
|
|
1111
|
+
|
|
1112
|
+
|
|
1113
|
+
const $f86fbaaa8b4e8c61$export$45f0aca2596a2bb3 = function() {
|
|
1114
|
+
const RELEASE_TYPE = "xlrelease.Release";
|
|
1115
|
+
const PHASE_TYPE = "xlrelease.Phase";
|
|
1116
|
+
const TEAM_TYPE = "xlrelease.Team";
|
|
1117
|
+
const TASK_TYPE = "xlrelease.Task";
|
|
1118
|
+
const COMMENT_TYPE = "xlrelease.Comment";
|
|
1119
|
+
const CONDITION_TYPE = "xlrelease.GateCondition";
|
|
1120
|
+
const DEPENDENCY_TYPE = "xlrelease.Dependency";
|
|
1121
|
+
const LINK_TYPE = "xlrelease.Link";
|
|
1122
|
+
const ATTACHMENT_TYPE = "xlrelease.Attachment";
|
|
1123
|
+
const DASHBOARD_TYPE = "xlrelease.Dashboard";
|
|
1124
|
+
const _TRIGGER_TYPE = "xlrelease.ReleaseTrigger";
|
|
1125
|
+
const JIRA_TYPE = "jira.CreateIssue";
|
|
1126
|
+
const DEFAULT_TASK_OWNER = "Itchy";
|
|
1127
|
+
const processTasks = (task, container, index)=>{
|
|
1128
|
+
if ((0, $hOLA6$lodashisUndefined)(task.type)) task.type = TASK_TYPE;
|
|
1129
|
+
task.id = task.id || `${container.id}/Task${index}`;
|
|
1130
|
+
if ((0, $hOLA6$lodashisUndefined)(task.owner) && task.type !== JIRA_TYPE) task.owner = DEFAULT_TASK_OWNER;
|
|
1131
|
+
if (task.owner === null) delete task.owner;
|
|
1132
|
+
(0, $hOLA6$lodasheach)(task.conditions, function(condition, idx) {
|
|
1133
|
+
condition.type = CONDITION_TYPE;
|
|
1134
|
+
condition.id = `${task.id}/GateCondition${idx}`;
|
|
1135
|
+
});
|
|
1136
|
+
(0, $hOLA6$lodasheach)(task.dependencies, function(dependency, idx) {
|
|
1137
|
+
dependency.type = DEPENDENCY_TYPE;
|
|
1138
|
+
dependency.id = `${task.id}/Dependency${idx}`;
|
|
1139
|
+
});
|
|
1140
|
+
(0, $hOLA6$lodasheach)(task.links, function(link, idx) {
|
|
1141
|
+
link.type = LINK_TYPE;
|
|
1142
|
+
link.id = `${task.id}/Link${idx}`;
|
|
1143
|
+
});
|
|
1144
|
+
(0, $hOLA6$lodasheach)(task.comments, function(comment, idx) {
|
|
1145
|
+
comment.type = COMMENT_TYPE;
|
|
1146
|
+
comment.id = `${task.id}/Comment${idx}`;
|
|
1147
|
+
});
|
|
1148
|
+
(0, $hOLA6$lodasheach)(task.tasks, function(subTask, idx) {
|
|
1149
|
+
processTasks(subTask, task, idx);
|
|
1150
|
+
});
|
|
1151
|
+
(0, $hOLA6$lodasheach)(task.templateVariables, function(variable, idx) {
|
|
1152
|
+
(0, $hOLA6$lodashdefaults)(variable, getVariableEntity(variable.value, variable.key, task.id, idx));
|
|
1153
|
+
});
|
|
1154
|
+
(0, $hOLA6$lodasheach)(task.attachments, function(attachment, idx) {
|
|
1155
|
+
attachment.type = ATTACHMENT_TYPE;
|
|
1156
|
+
attachment.id = `${task.id}/Attachment${idx}`;
|
|
1157
|
+
});
|
|
1158
|
+
if (task.pythonScript) {
|
|
1159
|
+
const pythonScript = task.pythonScript;
|
|
1160
|
+
pythonScript.id = `${task.id}/PythonScript`;
|
|
1161
|
+
pythonScript.customScriptTask = task.id;
|
|
1162
|
+
}
|
|
1163
|
+
};
|
|
1164
|
+
const processPhases = (phase, release, index)=>{
|
|
1165
|
+
phase.type = PHASE_TYPE;
|
|
1166
|
+
phase.id = `${release.id}/Phase${index}`;
|
|
1167
|
+
(0, $hOLA6$lodashforEach)(phase.tasks, (task, idx)=>{
|
|
1168
|
+
processTasks(task, phase, idx);
|
|
1169
|
+
});
|
|
1170
|
+
};
|
|
1171
|
+
const getVariableEntity = (value, key, containerId, index, password)=>{
|
|
1172
|
+
const keyNoSyntax = key.replace("${", "").replace("}", "");
|
|
1173
|
+
return {
|
|
1174
|
+
id: `${containerId}/Variable${index}`,
|
|
1175
|
+
key: keyNoSyntax,
|
|
1176
|
+
requiresValue: true,
|
|
1177
|
+
showOnReleaseStart: true,
|
|
1178
|
+
type: password ? "xlrelease.PasswordStringVariable" : "xlrelease.StringVariable",
|
|
1179
|
+
value: value
|
|
1180
|
+
};
|
|
1181
|
+
};
|
|
1182
|
+
const getValueProviderConfigurationEntity = function(containerId) {
|
|
1183
|
+
return {
|
|
1184
|
+
id: `${containerId}/valueProvider`,
|
|
1185
|
+
variable: containerId
|
|
1186
|
+
};
|
|
1187
|
+
};
|
|
1188
|
+
const getDashboardExtension = (dashboard, releaseId)=>{
|
|
1189
|
+
const dashboardExtension = {
|
|
1190
|
+
id: `${releaseId}/summary`,
|
|
1191
|
+
type: DASHBOARD_TYPE,
|
|
1192
|
+
tiles: []
|
|
1193
|
+
};
|
|
1194
|
+
if (dashboard.tiles) (0, $hOLA6$lodashforEach)(dashboard.tiles, function(tile, index) {
|
|
1195
|
+
dashboardExtension.tiles.push(getTileEntity(tile, `${releaseId}/summary`, index));
|
|
1196
|
+
});
|
|
1197
|
+
return dashboardExtension;
|
|
1198
|
+
};
|
|
1199
|
+
function getTileEntity(tile, containerId, index) {
|
|
1200
|
+
tile.id = tile.id || `${containerId}/Tile${index}`;
|
|
1201
|
+
return tile;
|
|
1202
|
+
}
|
|
1203
|
+
return function(release) {
|
|
1204
|
+
release.type = RELEASE_TYPE;
|
|
1205
|
+
if (release.id.indexOf("Applications/") === -1) release.id = `Applications/${release.id}`;
|
|
1206
|
+
if (release.startDate) release.queryableStartDate = release.startDate;
|
|
1207
|
+
else if (release.scheduledStartDate) release.queryableStartDate = release.scheduledStartDate;
|
|
1208
|
+
if (release.endDate) release.queryableEndDate = release.endDate;
|
|
1209
|
+
else if (release.dueDate) release.queryableEndDate = release.dueDate;
|
|
1210
|
+
if ((0, $hOLA6$lodashisUndefined)(release.owner)) release.owner = "Itchy"; // default release manager
|
|
1211
|
+
(0, $hOLA6$lodashforEach)(release.phases, function(phase, index) {
|
|
1212
|
+
processPhases(phase, release, index);
|
|
1213
|
+
});
|
|
1214
|
+
(0, $hOLA6$lodashforEach)(release.teams, function(team, index) {
|
|
1215
|
+
team.type = TEAM_TYPE;
|
|
1216
|
+
team.id = `${release.id}/Team${index}`;
|
|
1217
|
+
});
|
|
1218
|
+
(0, $hOLA6$lodashforEach)(release.attachments, function(attachment, index) {
|
|
1219
|
+
attachment.type = ATTACHMENT_TYPE;
|
|
1220
|
+
attachment.id = `${release.id}/Attachment${index}`;
|
|
1221
|
+
});
|
|
1222
|
+
(0, $hOLA6$lodashforEach)(release.variables, function(variable, index) {
|
|
1223
|
+
(0, $hOLA6$lodashdefaults)(variable, getVariableEntity(variable.value, variable.key, release.id, index));
|
|
1224
|
+
if (variable.valueProvider) (0, $hOLA6$lodashdefaults)(variable.valueProvider, getValueProviderConfigurationEntity(variable.id));
|
|
1225
|
+
});
|
|
1226
|
+
(0, $hOLA6$lodashforEach)((0, $hOLA6$lodashtoPairs)(release.variableValues), function(keyValue, index) {
|
|
1227
|
+
if (!release.variables) release.variables = [];
|
|
1228
|
+
release.variables.push(getVariableEntity(keyValue[1], keyValue[0], release.id, 1000 + index));
|
|
1229
|
+
release.variableValues = undefined;
|
|
1230
|
+
});
|
|
1231
|
+
(0, $hOLA6$lodashforEach)((0, $hOLA6$lodashtoPairs)(release.passwordVariableValues), function(keyValue, index) {
|
|
1232
|
+
if (!release.variables) release.variables = [];
|
|
1233
|
+
release.variables.push(getVariableEntity(keyValue[1], keyValue[0], release.id, 1500 + index, true));
|
|
1234
|
+
release.passwordVariableValues = undefined;
|
|
1235
|
+
});
|
|
1236
|
+
if (release.summary) {
|
|
1237
|
+
release.extensions = [
|
|
1238
|
+
getDashboardExtension(release.summary, release.id)
|
|
1239
|
+
];
|
|
1240
|
+
release.summary = undefined;
|
|
1241
|
+
}
|
|
1242
|
+
};
|
|
1243
|
+
}();
|
|
1244
|
+
|
|
1245
|
+
|
|
1246
|
+
|
|
1247
|
+
const $80c3ae34677b4324$var$JIRA_ISSUE_API_URL = "https://digitalai.atlassian.net/rest/api/2/issue";
|
|
957
1248
|
const $80c3ae34677b4324$var$adminHeaders = {
|
|
958
1249
|
Authorization: "Basic YWRtaW46YWRtaW4=",
|
|
959
1250
|
Cookie: "XSRF-TOKEN=1;",
|
|
@@ -986,7 +1277,7 @@ class $80c3ae34677b4324$var$Fixtures {
|
|
|
986
1277
|
this.request = request;
|
|
987
1278
|
this.page = page;
|
|
988
1279
|
}
|
|
989
|
-
|
|
1280
|
+
release(release) {
|
|
990
1281
|
this.initDefaults(release);
|
|
991
1282
|
this.releaseIds.push(release.id);
|
|
992
1283
|
return this.deleteRelease(release.id).then(()=>this.deleteArchivedRelease(release.id)).then(()=>this.doPost("fixtures/release", release));
|
|
@@ -1014,6 +1305,12 @@ class $80c3ae34677b4324$var$Fixtures {
|
|
|
1014
1305
|
const releaseId = id.includes("Applications/") ? id : `Applications/${id}`;
|
|
1015
1306
|
return this.doDelete(`fixtures/${releaseId}`);
|
|
1016
1307
|
}
|
|
1308
|
+
deleteUser(username) {
|
|
1309
|
+
return this.doDelete(`fixtures/user/${username}`);
|
|
1310
|
+
}
|
|
1311
|
+
deleteUserProfile(userProfile) {
|
|
1312
|
+
return this.doDelete(`fixtures/userProfile/${userProfile}`);
|
|
1313
|
+
}
|
|
1017
1314
|
deleteTrigger(id) {
|
|
1018
1315
|
return this.doDelete(`fixtures/trigger/${id}`);
|
|
1019
1316
|
}
|
|
@@ -1022,19 +1319,83 @@ class $80c3ae34677b4324$var$Fixtures {
|
|
|
1022
1319
|
id
|
|
1023
1320
|
]);
|
|
1024
1321
|
}
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
for (const
|
|
1030
|
-
for (const
|
|
1031
|
-
for (const
|
|
1322
|
+
activityLogs(releaseId, logs) {
|
|
1323
|
+
return this.doPost(`fixtures/activityLogs/${releaseId}`, logs);
|
|
1324
|
+
}
|
|
1325
|
+
async cleanAll() {
|
|
1326
|
+
for (const username of this.usernames)await this.deleteUser(username);
|
|
1327
|
+
for (const userProfile of this.userProfiles)await this.deleteUserProfile(userProfile);
|
|
1328
|
+
for (const triggerId of this.triggerIds)await this.deleteTrigger(triggerId);
|
|
1329
|
+
for (const releaseId of this.releaseIds.reverse())await this.deleteRelease(releaseId);
|
|
1330
|
+
for (const confId of this.configurationIds)await this.deleteConfiguration(confId);
|
|
1032
1331
|
this.releaseIds = [];
|
|
1033
1332
|
this.triggerIds = [];
|
|
1034
1333
|
this.configurationIds = [];
|
|
1035
1334
|
this.usernames = [];
|
|
1036
1335
|
this.userProfiles = [];
|
|
1037
|
-
|
|
1336
|
+
}
|
|
1337
|
+
async addJiraTask() {
|
|
1338
|
+
const data = {
|
|
1339
|
+
fields: {
|
|
1340
|
+
project: {
|
|
1341
|
+
key: "RIT"
|
|
1342
|
+
},
|
|
1343
|
+
summary: "Test Task",
|
|
1344
|
+
description: "Test task description",
|
|
1345
|
+
issuetype: {
|
|
1346
|
+
name: "Task"
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
};
|
|
1350
|
+
const headers = {
|
|
1351
|
+
Authorization: `Basic ${btoa("xlr-jira-testuser@xebialabs.com:zgsXK6c3oLVkJxrWVJQy9DB7")}`,
|
|
1352
|
+
Origin: "https://digitalai.atlassian.net/"
|
|
1353
|
+
};
|
|
1354
|
+
const response = await this.request.post($80c3ae34677b4324$var$JIRA_ISSUE_API_URL, {
|
|
1355
|
+
data: data,
|
|
1356
|
+
headers: headers
|
|
1357
|
+
});
|
|
1358
|
+
const json = await response.json();
|
|
1359
|
+
return json.key;
|
|
1360
|
+
}
|
|
1361
|
+
async addUser(username, password) {
|
|
1362
|
+
this.usernames.push(username);
|
|
1363
|
+
await this.doPost("fixtures/user", {
|
|
1364
|
+
username: username,
|
|
1365
|
+
password: password
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
async addUserProfile(username, profile) {
|
|
1369
|
+
if (!profile) profile = {};
|
|
1370
|
+
profile.id = username;
|
|
1371
|
+
profile.type = "xlrelease.UserProfile";
|
|
1372
|
+
profile.canonicalId = username.toLowerCase();
|
|
1373
|
+
this.userProfiles.push(profile.canonicalId);
|
|
1374
|
+
await this.doPost("fixtures/userProfile", profile);
|
|
1375
|
+
}
|
|
1376
|
+
async expectJiraTaskStatus(taskId, expectedStatus) {
|
|
1377
|
+
const headers = {
|
|
1378
|
+
Authorization: `Basic ${btoa("xlr-jira-testuser@xebialabs.com:zgsXK6c3oLVkJxrWVJQy9DB7")}`,
|
|
1379
|
+
Origin: "https://digitalai.atlassian.net/"
|
|
1380
|
+
};
|
|
1381
|
+
const response = await this.request.get(`${$80c3ae34677b4324$var$JIRA_ISSUE_API_URL}/${taskId}`, {
|
|
1382
|
+
headers: headers
|
|
1383
|
+
});
|
|
1384
|
+
const json = await response.json();
|
|
1385
|
+
const status = json.fields.status.name;
|
|
1386
|
+
(0, $hOLA6$expect)(status).toBe(expectedStatus);
|
|
1387
|
+
}
|
|
1388
|
+
async expectJiraTaskSummary(taskId, expectedSummary) {
|
|
1389
|
+
const headers = {
|
|
1390
|
+
Authorization: `Basic ${btoa("xlr-jira-testuser@xebialabs.com:zgsXK6c3oLVkJxrWVJQy9DB7")}`,
|
|
1391
|
+
Origin: "https://digitalai.atlassian.net/"
|
|
1392
|
+
};
|
|
1393
|
+
const response = await this.request.get(`${$80c3ae34677b4324$var$JIRA_ISSUE_API_URL}/${taskId}`, {
|
|
1394
|
+
headers: headers
|
|
1395
|
+
});
|
|
1396
|
+
const json = await response.json();
|
|
1397
|
+
const summary = json.fields.summary;
|
|
1398
|
+
(0, $hOLA6$expect)(summary).toBe(expectedSummary);
|
|
1038
1399
|
}
|
|
1039
1400
|
async waitForReleaseStarted(releaseTitle) {
|
|
1040
1401
|
await (0, $hOLA6$expect)(async ()=>{
|
|
@@ -1070,6 +1431,12 @@ class $80c3ae34677b4324$var$Fixtures {
|
|
|
1070
1431
|
getEnvVariable(name) {
|
|
1071
1432
|
return $hOLA6$env[name];
|
|
1072
1433
|
}
|
|
1434
|
+
async archiveRelease(releaseId) {
|
|
1435
|
+
return this.doGet(`fixtures/archive/${releaseId}`);
|
|
1436
|
+
}
|
|
1437
|
+
async preArchiveRelease(releaseId) {
|
|
1438
|
+
return this.doGet(`fixtures/preArchive/${releaseId}`);
|
|
1439
|
+
}
|
|
1073
1440
|
async setFeatures(features) {
|
|
1074
1441
|
return this.doPut("settings/features", features);
|
|
1075
1442
|
}
|
|
@@ -1078,32 +1445,10 @@ class $80c3ae34677b4324$var$Fixtures {
|
|
|
1078
1445
|
{
|
|
1079
1446
|
id: "Configuration/features/xlrelease.TaskDrawer",
|
|
1080
1447
|
type: "xlrelease.TaskDrawer",
|
|
1081
|
-
category: "Stable",
|
|
1082
1448
|
enabled: enabled
|
|
1083
1449
|
}
|
|
1084
1450
|
]);
|
|
1085
1451
|
}
|
|
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
1452
|
doPost(url, body) {
|
|
1108
1453
|
return this.request.post(url, {
|
|
1109
1454
|
data: body,
|