@digital-ai/devops-page-object-release 0.0.6 → 0.0.8

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/dist/module.js CHANGED
@@ -15,6 +15,141 @@ 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
+
18
153
  class $9626bc9256ce31f7$export$2b65d1d97338f32b {
19
154
  constructor(page){
20
155
  this.page = page;
@@ -22,7 +157,47 @@ class $9626bc9256ce31f7$export$2b65d1d97338f32b {
22
157
  }
23
158
 
24
159
 
25
- class $5359280e98d97ff9$export$a678525e79c4ccc4 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
160
+ class $4444bee76761dfb1$export$f14c0e3f98d164c0 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
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.locator("#inputLogin").fill(userName);
170
+ await this.page.locator("#inputPassword").fill(password);
171
+ await this.page.locator("button[type='submit']").click();
172
+ }
173
+ /**
174
+ * Logout as authenticated user
175
+ */ async logout() {
176
+ await this.page.locator("button.dot-avatar").click();
177
+ await this.page.getByText("Log out").click();
178
+ }
179
+ /**
180
+ * Expect login to be restricted for a user
181
+ */ async expectLoginDisallowed() {
182
+ const val = await this.page.textContent('.error-content span[ng-show="loginInfo.failedStatus == 403"]');
183
+ (0, $hOLA6$expect)(val).toContain("You do not have 'login' permission.");
184
+ }
185
+ /**
186
+ * Expect the respective user is logged In
187
+ * @param username
188
+ */ async expectToBeLogged(username) {
189
+ const val = await this.page.locator("top-toolbar .avatar-wrapper span.dot-tooltip").getAttribute("aria-label");
190
+ (0, $hOLA6$expect)(val).toContain(username);
191
+ }
192
+ }
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+ class $d2ac4753e13169c7$export$a678525e79c4ccc4 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
26
201
  async expectNumberOfReleases(releaseTitle, amount) {
27
202
  if (amount === 1) await (0, $hOLA6$expect)(this.page.locator(".release").getByText(releaseTitle)).toBeVisible();
28
203
  else await (0, $hOLA6$expect)(this.page.locator(".release").getByText(releaseTitle).count()).toBe(amount);
@@ -31,7 +206,7 @@ class $5359280e98d97ff9$export$a678525e79c4ccc4 extends (0, $9626bc9256ce31f7$ex
31
206
  await this.page.locator(".release-line .row-wrapper .release-title-wrapper a", {
32
207
  hasText: releaseTitle
33
208
  }).click();
34
- return new (0, $6100b25ffc426db0$export$f43492e8ac3c566)(this.page);
209
+ return new (0, $43cbcdfccb6c2a76$export$f43492e8ac3c566)(this.page);
35
210
  }
36
211
  }
37
212
 
@@ -43,7 +218,7 @@ class $862f65268e488e83$export$fb932093f944abe4 extends (0, $9626bc9256ce31f7$ex
43
218
  await this.page.locator(".popover-content xlr-context-menu a", {
44
219
  hasText: "View releases"
45
220
  }).click();
46
- return new (0, $5359280e98d97ff9$export$a678525e79c4ccc4)(this.page);
221
+ return new (0, $d2ac4753e13169c7$export$a678525e79c4ccc4)(this.page);
47
222
  }
48
223
  async openContextMenu(title) {
49
224
  await (0, $hOLA6$expect)(async ()=>{
@@ -59,58 +234,6 @@ class $862f65268e488e83$export$fb932093f944abe4 extends (0, $9626bc9256ce31f7$ex
59
234
 
60
235
 
61
236
 
62
- class $1b3e547d6616178c$export$90ba71b7d7997728 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
63
- constructor(page){
64
- super(page);
65
- this.taskModalLocator = this.page.locator(".modal-content.task-details");
66
- }
67
- async close() {
68
- await this.taskModalLocator.locator(".modal-header button.close").click();
69
- }
70
- }
71
-
72
-
73
- class $aaf14e80ae835616$export$b66cc3708c7bd4a4 extends (0, $1b3e547d6616178c$export$90ba71b7d7997728) {
74
- async expectFieldNotEmpty(field) {
75
- await (0, $hOLA6$expect)(this.taskModalLocator.locator(`#${field} .display`).textContent).toBeDefined();
76
- }
77
- async setSelectField(propertyName, value) {
78
- await this.focusOnField(propertyName);
79
- await this.taskModalLocator.locator(`select[name="${propertyName}"]`).selectOption(value);
80
- }
81
- async setTextField(propertyName, value) {
82
- await this.focusOnField(propertyName);
83
- await this.taskModalLocator.locator(`input[name="${propertyName}"]`).fill(value);
84
- }
85
- async setAutocompleteField(propertyName, value) {
86
- await this.focusOnAutocompleteField(propertyName);
87
- await this.taskModalLocator.locator(`#${propertyName} ul li`).getByText(value).click();
88
- }
89
- async expectOutputValueToBe(propertyName, value) {
90
- await (0, $hOLA6$expect)(this.taskModalLocator.locator(`#${propertyName} .field-readonly span`)).toContainText(value);
91
- }
92
- // TODO move this to a new inline-editor
93
- async focusOnField(propertyName) {
94
- await (0, $hOLA6$expect)(async ()=>{
95
- await this.taskModalLocator.locator(`#${propertyName} .display`).click({
96
- force: true
97
- });
98
- await (0, $hOLA6$expect)(this.taskModalLocator.locator(`#${propertyName} label.edit`)).toBeVisible();
99
- }).toPass();
100
- }
101
- async focusOnAutocompleteField(propertyName) {
102
- await (0, $hOLA6$expect)(async ()=>{
103
- await this.taskModalLocator.locator(`#${propertyName} input`).click({
104
- force: true
105
- });
106
- await (0, $hOLA6$expect)(this.taskModalLocator.locator(`#${propertyName} ul`)).toBeVisible();
107
- }).toPass();
108
- }
109
- }
110
-
111
-
112
-
113
-
114
237
  async function $251ce8153733e46f$export$a0f926f04148e5d2(locators) {
115
238
  const res = await Promise.all([
116
239
  ...locators.map(async (locator, index)=>{
@@ -134,13 +257,13 @@ async function $251ce8153733e46f$export$a0f926f04148e5d2(locators) {
134
257
  }
135
258
 
136
259
 
137
- class $2d8ab26bb7c4ceb5$export$a87f0ae8695e74be extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
260
+ class $f48771b486a3eb8f$export$a87f0ae8695e74be extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
138
261
  async openVariable(variableKey) {
139
262
  await this.page.locator(`.variables-list .variable`).getByText(variableKey).click();
140
- return new $2d8ab26bb7c4ceb5$var$ReleaseVariableModal(this.page);
263
+ return new $f48771b486a3eb8f$var$ReleaseVariableModal(this.page);
141
264
  }
142
265
  }
143
- class $2d8ab26bb7c4ceb5$var$ReleaseVariableModal extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
266
+ class $f48771b486a3eb8f$var$ReleaseVariableModal extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
144
267
  async expectValue(locators, expectFn) {
145
268
  const [index, locator] = await (0, $251ce8153733e46f$export$a0f926f04148e5d2)(locators);
146
269
  await expectFn[index](locator);
@@ -175,26 +298,10 @@ class $2d8ab26bb7c4ceb5$var$ReleaseVariableModal extends (0, $9626bc9256ce31f7$e
175
298
 
176
299
 
177
300
 
178
- class $e50eb8e8657a3113$export$e946776eae644790 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
301
+ class $e44e9af564fb00f7$export$64c93bc7fb9ca44e extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
179
302
  constructor(page){
180
303
  super(page);
181
- this.taskDrawerLocator = this.page.locator("task-drawer .dot-drawer");
182
- }
183
- async openConfigRail() {
184
- await this.openRail("Config");
185
- return new $e50eb8e8657a3113$var$ConfigRail(this.page);
186
- }
187
- async openRail(rail) {
188
- await this.taskDrawerLocator.locator(".task-navigation-rail").getByText(rail).click();
189
- }
190
- async close() {
191
- await this.taskDrawerLocator.locator(".task-drawer-header").getByTestId("close-btn").click();
192
- }
193
- }
194
- class $e50eb8e8657a3113$var$ConfigRail extends $e50eb8e8657a3113$export$e946776eae644790 {
195
- constructor(page){
196
- super(page);
197
- this.railLocator = this.taskDrawerLocator.locator(".task-config");
304
+ this.railLocator = this.page.locator("task-drawer .dot-drawer .task-config");
198
305
  }
199
306
  async openInputProperties() {
200
307
  await this.railLocator.locator(".task-config-header").getByText("Input properties").click();
@@ -248,7 +355,99 @@ class $e50eb8e8657a3113$var$ConfigRail extends $e50eb8e8657a3113$export$e946776e
248
355
  }
249
356
 
250
357
 
251
- class $6100b25ffc426db0$export$f43492e8ac3c566 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
358
+
359
+
360
+
361
+ class $3fa741329d8067d5$export$d4865631ba74f3e2 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
362
+ constructor(page){
363
+ super(page);
364
+ this.railLocator = this.page.locator("task-drawer .dot-drawer .task-conditions");
365
+ this.preconditionToggle = page.getByLabel("Enable precondition");
366
+ this.textEditor = page.getByRole("textbox");
367
+ this.saveButton = page.getByTestId("save-btn");
368
+ }
369
+ async enablePrecondition() {
370
+ (0, $hOLA6$expect)(await this.preconditionToggle.isChecked()).toBe(false);
371
+ await this.preconditionToggle.check();
372
+ }
373
+ async disablePrecondition() {
374
+ (0, $hOLA6$expect)(await this.preconditionToggle.isChecked()).toBe(true);
375
+ await this.preconditionToggle.uncheck();
376
+ }
377
+ async setPrecondition(script) {
378
+ await this.enablePrecondition();
379
+ await this.textEditor.fill(script);
380
+ await this.saveButton.dblclick();
381
+ await this.page.waitForTimeout(1000);
382
+ }
383
+ }
384
+
385
+
386
+ class $8e39246218b802fc$export$e946776eae644790 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
387
+ constructor(page){
388
+ super(page);
389
+ this.taskDrawerLocator = this.page.locator("task-drawer .dot-drawer");
390
+ this.retryButton = this.page.getByRole("button", {
391
+ name: "Retry"
392
+ });
393
+ this.cancelButton = this.page.getByTestId("task-action-cancel");
394
+ this.commentBox = this.page.getByTestId("task-action-comment");
395
+ this.confirm = this.page.getByTestId("task-action-confirm");
396
+ this.config = new (0, $e44e9af564fb00f7$export$64c93bc7fb9ca44e)(page);
397
+ this.condition = new (0, $3fa741329d8067d5$export$d4865631ba74f3e2)(page);
398
+ this.skipMenu = this.page.getByRole("menuitem", {
399
+ name: "Skip"
400
+ });
401
+ }
402
+ async openOverviewRail() {
403
+ await this.openRail("Overview");
404
+ }
405
+ async openActivityRail() {
406
+ await this.openRail("Activity");
407
+ }
408
+ async openSchedulingRail() {
409
+ await this.openRail("Scheduling");
410
+ }
411
+ async openConditionRail() {
412
+ await this.openRail("Conditions");
413
+ }
414
+ async openAttributesRail() {
415
+ await this.openRail("Attributes");
416
+ }
417
+ async openAttachRail() {
418
+ await this.openRail("Attach");
419
+ }
420
+ async openTagsRail() {
421
+ await this.openRail("Tags");
422
+ }
423
+ async openRail(rail) {
424
+ await this.taskDrawerLocator.locator(".task-navigation-rail").getByText(rail).click();
425
+ }
426
+ async close() {
427
+ await this.taskDrawerLocator.locator(".task-drawer-header").getByTestId("close-btn").click();
428
+ }
429
+ async retryTask(comment) {
430
+ await this.retryButton.click();
431
+ await this.commentBox.fill(comment);
432
+ await this.confirm.click();
433
+ }
434
+ async skipTask(comment) {
435
+ await this.page.getByRole("button", {
436
+ name: "arrow-down icon",
437
+ exact: true
438
+ }).click();
439
+ await this.skipMenu.click();
440
+ await this.commentBox.fill(comment);
441
+ await this.confirm.click();
442
+ }
443
+ }
444
+
445
+
446
+ class $43cbcdfccb6c2a76$export$f43492e8ac3c566 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
447
+ constructor(page){
448
+ super(page);
449
+ this.taskDrawer = new (0, $8e39246218b802fc$export$e946776eae644790)(page);
450
+ }
252
451
  async openTriggers() {
253
452
  await this.openSubPage("Triggers");
254
453
  return new (0, $862f65268e488e83$export$fb932093f944abe4)(this.page);
@@ -261,13 +460,13 @@ class $6100b25ffc426db0$export$f43492e8ac3c566 extends (0, $9626bc9256ce31f7$exp
261
460
  await this.page.locator(".modal .continue").click();
262
461
  }
263
462
  getPhase(phaseName) {
264
- return new $6100b25ffc426db0$var$Phase(this.page, phaseName);
463
+ return new $43cbcdfccb6c2a76$var$Phase(this.page, phaseName);
265
464
  }
266
465
  async start() {
267
- await this.page.locator("action-toolbar button", {
268
- hasText: "Start"
466
+ await this.page.getByTestId("start-btn").click();
467
+ await this.page.getByRole("button", {
468
+ name: "Start"
269
469
  }).click();
270
- await this.page.locator(".modal button.primary").click();
271
470
  }
272
471
  async waitForTaskCompleted(taskTitle) {
273
472
  await (0, $hOLA6$expect)(this.page.locator(".task.completed").getByText(taskTitle, {
@@ -279,24 +478,33 @@ class $6100b25ffc426db0$export$f43492e8ac3c566 extends (0, $9626bc9256ce31f7$exp
279
478
  exact: true
280
479
  })).toBeVisible();
281
480
  }
481
+ async waitForTaskSkipped(taskTitle) {
482
+ await (0, $hOLA6$expect)(this.page.locator(".task.skipped").getByText(taskTitle, {
483
+ exact: true
484
+ })).toBeVisible();
485
+ }
486
+ async waitForTaskAborted(taskTitle) {
487
+ await (0, $hOLA6$expect)(this.page.locator(".task.aborted").getByText(taskTitle, {
488
+ exact: true
489
+ })).toBeVisible();
490
+ }
282
491
  async waitForStatusLine(statusLine) {
283
492
  await (0, $hOLA6$expect)(this.page.locator(".task .status-line").getByText(statusLine, {
284
493
  exact: true
285
494
  })).toBeVisible();
286
495
  }
287
- /**
288
- * @deprecated Don't use this, use new TaskDrawer
289
- */ async openCustomScriptTaskModal(taskName) {
290
- await this.page.locator(".task-header").getByText(taskName).click();
291
- return new (0, $aaf14e80ae835616$export$b66cc3708c7bd4a4)(this.page);
496
+ async waitForTaskStarted(taskTitle) {
497
+ await (0, $hOLA6$expect)(this.page.locator(".task.in_progress").getByTitle(taskTitle, {
498
+ exact: true
499
+ })).toBeVisible();
292
500
  }
293
501
  async openTaskDrawer(taskName) {
294
502
  await this.page.locator(".task-header").getByText(taskName).click();
295
- return new (0, $e50eb8e8657a3113$export$e946776eae644790)(this.page);
503
+ return this.taskDrawer;
296
504
  }
297
505
  async openVariables() {
298
506
  await this.openReleaseMenu("Variables");
299
- return new (0, $2d8ab26bb7c4ceb5$export$a87f0ae8695e74be)(this.page);
507
+ return new (0, $f48771b486a3eb8f$export$a87f0ae8695e74be)(this.page);
300
508
  }
301
509
  async openReleaseMenu(menuItem) {
302
510
  await this.page.locator(`navigation-sidebar ul li`).getByText(menuItem, {
@@ -308,8 +516,33 @@ class $6100b25ffc426db0$export$f43492e8ac3c566 extends (0, $9626bc9256ce31f7$exp
308
516
  hasText: subpage
309
517
  }).click();
310
518
  }
519
+ async openTask(taskName) {
520
+ await this.page.getByTitle(taskName, {
521
+ exact: true
522
+ }).click();
523
+ }
524
+ async collapseAllTaskView() {
525
+ const icCollapseTreeview1 = this.page.locator("div.pull-left.expander.ng-scope i.xl-icon.arrow-down-icon");
526
+ for (const element of (await icCollapseTreeview1.all())){
527
+ const blnVal = await element.isVisible();
528
+ if (blnVal) {
529
+ await element.click();
530
+ await this.collapseAllTaskView();
531
+ }
532
+ }
533
+ }
534
+ async expandAllTaskView() {
535
+ const icExpandTreeview1 = this.page.locator("div.pull-left.expander.ng-scope i.xl-icon.arrow-right-icon");
536
+ for (const element of (await icExpandTreeview1.all())){
537
+ const blnVal = await element.isVisible();
538
+ if (blnVal) {
539
+ await element.click();
540
+ await this.expandAllTaskView();
541
+ }
542
+ }
543
+ }
311
544
  }
312
- class $6100b25ffc426db0$var$Phase extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
545
+ class $43cbcdfccb6c2a76$var$Phase extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
313
546
  constructor(page, phaseName){
314
547
  super(page);
315
548
  this.phaseLocator = page.locator(".phase", {
@@ -336,43 +569,6 @@ class $6100b25ffc426db0$var$Phase extends (0, $9626bc9256ce31f7$export$2b65d1d97
336
569
  }
337
570
 
338
571
 
339
- class $e72552cbf941ecfa$export$b8a61e5c71402559 {
340
- constructor(page){
341
- this.page = page;
342
- }
343
- async openTemplate(id) {
344
- return this.openReleaseOrTemplate(id, false);
345
- }
346
- async openRelease(id) {
347
- return this.openReleaseOrTemplate(id, true);
348
- }
349
- async openReleaseOrTemplate(id, release) {
350
- const url = release ? "releases" : "templates";
351
- await this.page.goto(`./#/${url}/${id}`);
352
- await this.page.waitForSelector("#release");
353
- return new (0, $6100b25ffc426db0$export$f43492e8ac3c566)(this.page);
354
- }
355
- }
356
-
357
-
358
-
359
-
360
- class $ccd46c191f81b177$export$f14c0e3f98d164c0 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
361
- async login(userName, password) {
362
- await this.page.goto("./");
363
- await (0, $hOLA6$expect)(this.page).toHaveTitle("Digital.ai Release");
364
- await this.page.locator("#inputLogin").fill(userName);
365
- await this.page.locator("#inputPassword").fill(password);
366
- await this.page.locator("button[type='submit']").click();
367
- await (0, $hOLA6$expect)(this.page.locator("#releases-content")).toBeVisible();
368
- }
369
- async logout() {
370
- await this.page.locator("button.dot-avatar").click();
371
- await this.page.getByText("Log out").click();
372
- }
373
- }
374
-
375
-
376
572
 
377
573
 
378
574
  class $c313b10398604df2$export$1533b625ec0c75e2 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
@@ -425,139 +621,199 @@ class $6720a523bcb1cce0$export$3cac5fd37ae64b91 extends (0, $9626bc9256ce31f7$ex
425
621
 
426
622
 
427
623
 
428
-
429
-
430
- const $f86fbaaa8b4e8c61$export$45f0aca2596a2bb3 = function() {
431
- const RELEASE_TYPE = "xlrelease.Release";
432
- const PHASE_TYPE = "xlrelease.Phase";
433
- const TEAM_TYPE = "xlrelease.Team";
434
- const TASK_TYPE = "xlrelease.Task";
435
- const COMMENT_TYPE = "xlrelease.Comment";
436
- const CONDITION_TYPE = "xlrelease.GateCondition";
437
- const DEPENDENCY_TYPE = "xlrelease.Dependency";
438
- const LINK_TYPE = "xlrelease.Link";
439
- const ATTACHMENT_TYPE = "xlrelease.Attachment";
440
- const DASHBOARD_TYPE = "xlrelease.Dashboard";
441
- const _TRIGGER_TYPE = "xlrelease.ReleaseTrigger";
442
- const JIRA_TYPE = "jira.CreateIssue";
443
- const DEFAULT_TASK_OWNER = "Itchy";
444
- const processTasks = (task, container, index)=>{
445
- if ((0, $hOLA6$lodashisUndefined)(task.type)) task.type = TASK_TYPE;
446
- task.id = task.id || `${container.id}/Task${index}`;
447
- if ((0, $hOLA6$lodashisUndefined)(task.owner) && task.type !== JIRA_TYPE) task.owner = DEFAULT_TASK_OWNER;
448
- if (task.owner === null) delete task.owner;
449
- (0, $hOLA6$lodasheach)(task.conditions, function(condition, idx) {
450
- condition.type = CONDITION_TYPE;
451
- condition.id = `${task.id}/GateCondition${idx}`;
452
- });
453
- (0, $hOLA6$lodasheach)(task.dependencies, function(dependency, idx) {
454
- dependency.type = DEPENDENCY_TYPE;
455
- dependency.id = `${task.id}/Dependency${idx}`;
456
- });
457
- (0, $hOLA6$lodasheach)(task.links, function(link, idx) {
458
- link.type = LINK_TYPE;
459
- link.id = `${task.id}/Link${idx}`;
460
- });
461
- (0, $hOLA6$lodasheach)(task.comments, function(comment, idx) {
462
- comment.type = COMMENT_TYPE;
463
- comment.id = `${task.id}/Comment${idx}`;
464
- });
465
- (0, $hOLA6$lodasheach)(task.tasks, function(subTask, idx) {
466
- processTasks(subTask, task, idx);
624
+ class $21185a378c23589e$export$e2e2e1ffdce20c30 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
625
+ constructor(page){
626
+ super(page);
627
+ this.userName = page.locator("#username");
628
+ this.name = page.locator("#full-name");
629
+ this.email = page.locator("#email");
630
+ this.password = page.locator('[data-test="password-input"]');
631
+ this.cnfPassword = page.locator("#passwordConfirmation");
632
+ this.saveButton = page.getByRole("button", {
633
+ name: "Save"
467
634
  });
468
- (0, $hOLA6$lodasheach)(task.templateVariables, function(variable, idx) {
469
- (0, $hOLA6$lodashdefaults)(variable, getVariableEntity(variable.value, variable.key, task.id, idx));
635
+ this.cancelButton = page.getByRole("button", {
636
+ name: "Cancel"
470
637
  });
471
- (0, $hOLA6$lodasheach)(task.attachments, function(attachment, idx) {
472
- attachment.type = ATTACHMENT_TYPE;
473
- attachment.id = `${task.id}/Attachment${idx}`;
474
- });
475
- if (task.pythonScript) {
476
- const pythonScript = task.pythonScript;
477
- pythonScript.id = `${task.id}/PythonScript`;
478
- pythonScript.customScriptTask = task.id;
479
- }
480
- };
481
- const processPhases = (phase, release, index)=>{
482
- phase.type = PHASE_TYPE;
483
- phase.id = `${release.id}/Phase${index}`;
484
- (0, $hOLA6$lodashforEach)(phase.tasks, (task, idx)=>{
485
- processTasks(task, phase, idx);
638
+ this.deleteButton = page.getByRole("button", {
639
+ name: "Delete"
486
640
  });
487
- };
488
- const getVariableEntity = (value, key, containerId, index, password)=>{
489
- const keyNoSyntax = key.replace("${", "").replace("}", "");
490
- return {
491
- id: `${containerId}/Variable${index}`,
492
- key: keyNoSyntax,
493
- requiresValue: true,
494
- showOnReleaseStart: true,
495
- type: password ? "xlrelease.PasswordStringVariable" : "xlrelease.StringVariable",
496
- value: value
497
- };
498
- };
499
- const getValueProviderConfigurationEntity = function(containerId) {
500
- return {
501
- id: `${containerId}/valueProvider`,
502
- variable: containerId
503
- };
504
- };
505
- const getDashboardExtension = (dashboard, releaseId)=>{
506
- const dashboardExtension = {
507
- id: `${releaseId}/summary`,
508
- type: DASHBOARD_TYPE,
509
- tiles: []
510
- };
511
- if (dashboard.tiles) (0, $hOLA6$lodashforEach)(dashboard.tiles, function(tile, index) {
512
- dashboardExtension.tiles.push(getTileEntity(tile, `${releaseId}/summary`, index));
513
- });
514
- return dashboardExtension;
515
- };
516
- function getTileEntity(tile, containerId, index) {
517
- tile.id = tile.id || `${containerId}/Tile${index}`;
518
- return tile;
519
641
  }
520
- return function(release) {
521
- release.type = RELEASE_TYPE;
522
- if (release.id.indexOf("Applications/") === -1) release.id = `Applications/${release.id}`;
523
- if (release.startDate) release.queryableStartDate = release.startDate;
524
- else if (release.scheduledStartDate) release.queryableStartDate = release.scheduledStartDate;
525
- if (release.endDate) release.queryableEndDate = release.endDate;
526
- else if (release.dueDate) release.queryableEndDate = release.dueDate;
527
- if ((0, $hOLA6$lodashisUndefined)(release.owner)) release.owner = "Itchy"; // default release manager
528
- (0, $hOLA6$lodashforEach)(release.phases, function(phase, index) {
529
- processPhases(phase, release, index);
530
- });
531
- (0, $hOLA6$lodashforEach)(release.teams, function(team, index) {
532
- team.type = TEAM_TYPE;
533
- team.id = `${release.id}/Team${index}`;
534
- });
535
- (0, $hOLA6$lodashforEach)(release.attachments, function(attachment, index) {
536
- attachment.type = ATTACHMENT_TYPE;
537
- attachment.id = `${release.id}/Attachment${index}`;
538
- });
539
- (0, $hOLA6$lodashforEach)(release.variables, function(variable, index) {
540
- (0, $hOLA6$lodashdefaults)(variable, getVariableEntity(variable.value, variable.key, release.id, index));
541
- if (variable.valueProvider) (0, $hOLA6$lodashdefaults)(variable.valueProvider, getValueProviderConfigurationEntity(variable.id));
542
- });
543
- (0, $hOLA6$lodashforEach)((0, $hOLA6$lodashtoPairs)(release.variableValues), function(keyValue, index) {
544
- if (!release.variables) release.variables = [];
545
- release.variables.push(getVariableEntity(keyValue[1], keyValue[0], release.id, 1000 + index));
546
- release.variableValues = undefined;
642
+ async setUserName(username) {
643
+ return await this.userName.fill(username);
644
+ }
645
+ async setFullName(fullName) {
646
+ return await this.name.fill(fullName);
647
+ }
648
+ async setEmail(email) {
649
+ return await this.email.fill(email);
650
+ }
651
+ async setPassword(password) {
652
+ return await this.password.fill(password);
653
+ }
654
+ async setConfirmPassword(cnfPassword) {
655
+ return await this.cnfPassword.fill(cnfPassword);
656
+ }
657
+ async save() {
658
+ await this.saveButton.click();
659
+ }
660
+ async cancel() {
661
+ await this.cancelButton.click();
662
+ }
663
+ async delete() {
664
+ await this.deleteButton.click();
665
+ }
666
+ }
667
+
668
+
669
+ class $2cb6a6ac6b17e85f$export$107317390f5aa598 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
670
+ constructor(page){
671
+ super(page);
672
+ this.page = page;
673
+ this.newUserButton = this.page.getByTestId("new-user-btn");
674
+ this.modal = new (0, $21185a378c23589e$export$e2e2e1ffdce20c30)(page);
675
+ }
676
+ async openUsersPage() {
677
+ this.page.goto("/#/users", {
678
+ timeout: 1000
547
679
  });
548
- (0, $hOLA6$lodashforEach)((0, $hOLA6$lodashtoPairs)(release.passwordVariableValues), function(keyValue, index) {
549
- if (!release.variables) release.variables = [];
550
- release.variables.push(getVariableEntity(keyValue[1], keyValue[0], release.id, 1500 + index, true));
551
- release.passwordVariableValues = undefined;
680
+ }
681
+ async toggleLoginPermission(username) {
682
+ await this.page.getByRole("row", {
683
+ name: "" + username + ""
684
+ }).getByRole("checkbox").check();
685
+ //await this.page.locator(`tr:contains('${username}') .login-permission input`).click();
686
+ }
687
+ async addUser() {
688
+ await this.newUserButton.click();
689
+ }
690
+ async createUser(username, password) {
691
+ await this.modal.setUserName(username);
692
+ await this.modal.setFullName(username);
693
+ await this.modal.setEmail("testuser@company.com");
694
+ await this.modal.setPassword(password);
695
+ await this.modal.setConfirmPassword(password);
696
+ await this.modal.save();
697
+ }
698
+ async expectToHaveLoginPermission(username) {
699
+ return await (0, $hOLA6$expect)(this.page.getByRole("row", {
700
+ name: "" + username + ""
701
+ }).getByRole("checkbox")).toBeChecked();
702
+ }
703
+ async deleteUser(username) {
704
+ await this.page.getByRole("row", {
705
+ name: "" + username + ""
706
+ }).locator("i").nth(1).click();
707
+ await this.modal.delete();
708
+ }
709
+ }
710
+
711
+
712
+
713
+ class $f1bf370bb7f683ca$export$1d7840d5cdc861d5 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
714
+ constructor(page){
715
+ super(page);
716
+ this.settingsIcon = this.page.getByRole("button", {
717
+ name: "Settings"
552
718
  });
553
- if (release.summary) {
554
- release.extensions = [
555
- getDashboardExtension(release.summary, release.id)
556
- ];
557
- release.summary = undefined;
558
- }
559
- };
560
- }();
719
+ this.usersAndPermissionMenu = this.page.getByTestId("undefined-menu").getByText("Users and permissions");
720
+ this.managePluginMenu = this.page.getByText("Manage plugins");
721
+ }
722
+ async openUsersAndPermissions() {
723
+ await this.settingsIcon.click();
724
+ await this.page.getByTestId("undefined-menu").getByText("Users and permissions").click();
725
+ }
726
+ async openManagePlugin() {
727
+ await this.settingsIcon.click();
728
+ await this.managePluginMenu.click();
729
+ }
730
+ }
731
+
732
+
733
+
734
+ class $9ca6e63d357957dd$export$922081b54f2ab994 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
735
+ constructor(page){
736
+ super(page);
737
+ }
738
+ }
739
+
740
+
741
+ class $e72552cbf941ecfa$export$b8a61e5c71402559 {
742
+ constructor(page){
743
+ this.page = page;
744
+ this.releasePage = new (0, $43cbcdfccb6c2a76$export$f43492e8ac3c566)(page);
745
+ this.settingsMenu = new (0, $f1bf370bb7f683ca$export$1d7840d5cdc861d5)(page);
746
+ this.usersPage = new (0, $2cb6a6ac6b17e85f$export$107317390f5aa598)(page);
747
+ this.applicationPage = new (0, $c313b10398604df2$export$1533b625ec0c75e2)(page);
748
+ this.taskDetailsPage = new (0, $9ca6e63d357957dd$export$922081b54f2ab994)(page);
749
+ }
750
+ async openTemplate(id) {
751
+ return this.openReleaseOrTemplate(id, false);
752
+ }
753
+ async openRelease(id) {
754
+ return this.openReleaseOrTemplate(id, true);
755
+ }
756
+ async openApplicationsPage() {
757
+ return new (0, $c313b10398604df2$export$1533b625ec0c75e2)(this.page).goToApplicationsPage();
758
+ }
759
+ async openPersonalAccessTokenPage() {
760
+ return new (0, $6720a523bcb1cce0$export$3cac5fd37ae64b91)(this.page).openPersonalAccessTokenPage();
761
+ }
762
+ async gotoFolderPage() {
763
+ await this.page.getByText("Folders").click();
764
+ }
765
+ async gotoTaskPage() {
766
+ await this.page.getByTestId("sideNav-item-3").getByText("Tasks").click();
767
+ }
768
+ async gotoReleasePage() {
769
+ await this.page.getByText("Releases").click();
770
+ }
771
+ async gotoWorkflowCatalogPage() {
772
+ await this.page.getByText("Workflow catalog").click();
773
+ }
774
+ async gotoWorkflowsPage() {
775
+ await this.page.getByTestId("sideNav-item-6").getByText("Workflows").click();
776
+ }
777
+ async gotoGroupsPage() {
778
+ await this.page.getByText("Groups").click();
779
+ }
780
+ async gotoReleaseCalenderPage() {
781
+ await this.page.getByText("Release calendar").click();
782
+ }
783
+ async gotoDeliveriesPage() {
784
+ await this.page.getByText("Deliveries").click();
785
+ }
786
+ async gotoTriggersPage() {
787
+ await this.page.getByText("Triggers").click();
788
+ }
789
+ async gotoDigitalAnalyticsPage() {
790
+ await this.page.getByText("Digital.ai Analytics").click();
791
+ }
792
+ async gotoReportsPage() {
793
+ await this.page.getByText("Reports").click();
794
+ }
795
+ async gotoTemplatesPage() {
796
+ await this.page.getByText("Templates").click();
797
+ }
798
+ async gotoEnvironmentsPage() {
799
+ await this.page.getByText("Environments").click();
800
+ }
801
+ async gotoEnvironmentsCalenderPage() {
802
+ await this.page.getByText("Environments calendar").click();
803
+ }
804
+ async gotoGobalVariablesPage() {
805
+ await this.page.getByText("Global variables").click();
806
+ }
807
+ async gotoConnectionsPage() {
808
+ await this.page.getByText("Connections").click();
809
+ }
810
+ async openReleaseOrTemplate(id, release) {
811
+ const url = release ? "releases" : "templates";
812
+ await this.page.goto(`./#/${url}/${id}`);
813
+ await this.page.waitForSelector("#release");
814
+ return new (0, $43cbcdfccb6c2a76$export$f43492e8ac3c566)(this.page);
815
+ }
816
+ }
561
817
 
562
818
 
563
819
 
@@ -573,20 +829,10 @@ const $80c3ae34677b4324$export$e0969da9b8fb378d = (0, $hOLA6$test).extend({
573
829
  return fixtures;
574
830
  },
575
831
  loginPage: async ({ page: page }, use)=>{
576
- const loginPage = new (0, $ccd46c191f81b177$export$f14c0e3f98d164c0)(page);
832
+ const loginPage = new (0, $4444bee76761dfb1$export$f14c0e3f98d164c0)(page);
577
833
  await use(loginPage);
578
834
  return loginPage;
579
835
  },
580
- applicationPage: async ({ page: page }, use)=>{
581
- const applicationPage = new (0, $c313b10398604df2$export$1533b625ec0c75e2)(page);
582
- await use(applicationPage);
583
- return applicationPage;
584
- },
585
- personalAccessTokenPage: async ({ page: page }, use)=>{
586
- const personalAccessTokenPage = new (0, $6720a523bcb1cce0$export$3cac5fd37ae64b91)(page);
587
- await use(personalAccessTokenPage);
588
- return personalAccessTokenPage;
589
- },
590
836
  navigation: async ({ page: page }, use)=>{
591
837
  const navigationPage = new (0, $e72552cbf941ecfa$export$b8a61e5c71402559)(page);
592
838
  await use(navigationPage);
@@ -597,6 +843,8 @@ class $80c3ae34677b4324$var$Fixtures {
597
843
  releaseIds = [];
598
844
  triggerIds = [];
599
845
  configurationIds = [];
846
+ usernames = [];
847
+ userProfiles = [];
600
848
  constructor(request, page){
601
849
  this.request = request;
602
850
  this.page = page;
@@ -642,9 +890,13 @@ class $80c3ae34677b4324$var$Fixtures {
642
890
  for (const releaseId of this.releaseIds.reverse())promises.push(this.deleteRelease(releaseId));
643
891
  for (const triggerId of this.triggerIds)promises.push(this.deleteTrigger(triggerId));
644
892
  for (const confId of this.configurationIds)promises.push(this.deleteConfiguration(confId));
893
+ for (const usernames of this.usernames)promises.push(this.deleteUser(usernames));
894
+ for (const userProfiles of this.userProfiles)promises.push(this.deleteUserProfile(userProfiles));
645
895
  this.releaseIds = [];
646
896
  this.triggerIds = [];
647
897
  this.configurationIds = [];
898
+ this.usernames = [];
899
+ this.userProfiles = [];
648
900
  return Promise.all(promises);
649
901
  }
650
902
  async waitForReleaseStarted(releaseTitle) {
@@ -694,6 +946,27 @@ class $80c3ae34677b4324$var$Fixtures {
694
946
  }
695
947
  ]);
696
948
  }
949
+ async addUser(username, password) {
950
+ this.usernames.push(username);
951
+ return await this.doPost("fixtures/user", {
952
+ username: username,
953
+ password: password
954
+ });
955
+ }
956
+ async addUserProfile(username, profile) {
957
+ if (!profile) profile = {};
958
+ profile.id = username;
959
+ profile.type = "xlrelease.UserProfile";
960
+ profile.canonicalId = username.toLowerCase();
961
+ this.userProfiles.push(profile.canonicalId);
962
+ return await this.doPost("fixtures/userProfile", profile);
963
+ }
964
+ async deleteUser(username) {
965
+ return await this.request.delete(`fixtures/user/${username}`);
966
+ }
967
+ async deleteUserProfile(username) {
968
+ return await this.request.delete(`fixtures/userProfile/${username}`);
969
+ }
697
970
  doPost(url, body) {
698
971
  return this.request.post(url, {
699
972
  data: body,