@digital-ai/devops-page-object-release 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.js CHANGED
@@ -24,6 +24,7 @@ class $9626bc9256ce31f7$export$2b65d1d97338f32b {
24
24
 
25
25
  class $5359280e98d97ff9$export$a678525e79c4ccc4 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
26
26
  async expectNumberOfReleases(releaseTitle, amount) {
27
+ await this.filterReleaseByTitle(releaseTitle);
27
28
  if (amount === 1) await (0, $hOLA6$expect)(this.page.locator(".release").getByText(releaseTitle)).toBeVisible({
28
29
  timeout: 5000
29
30
  });
@@ -35,6 +36,12 @@ class $5359280e98d97ff9$export$a678525e79c4ccc4 extends (0, $9626bc9256ce31f7$ex
35
36
  }).click();
36
37
  return new (0, $43cbcdfccb6c2a76$export$f43492e8ac3c566)(this.page);
37
38
  }
39
+ async filterReleaseByTitle(releaseTitle) {
40
+ await this.page.locator(".toggle-search-filter").click();
41
+ await this.page.locator(".searchFilter").fill(releaseTitle);
42
+ await this.page.locator(".searchFilter").press("Enter");
43
+ await (0, $hOLA6$expect)(this.page.locator(".release").getByText(releaseTitle)).toBeVisible();
44
+ }
38
45
  }
39
46
 
40
47
 
@@ -215,7 +222,57 @@ class $3fa741329d8067d5$export$d4865631ba74f3e2 extends (0, $9626bc9256ce31f7$ex
215
222
  class $90bb70a7e909e500$export$519356f6c50361f7 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
216
223
  constructor(page){
217
224
  super(page);
218
- this.railLocator = this.page.locator("task-drawer .dot-drawer .task-drawer-content");
225
+ this.railLocator = this.page.locator("task-drawer .dot-drawer .task-drawer-content");
226
+ this.dependency = new $90bb70a7e909e500$export$fbbf45eff21470e3(page);
227
+ }
228
+ async openInputProperties() {
229
+ await this.railLocator.locator(".task-config-header").getByText("Input properties").click();
230
+ }
231
+ async openOutputProperties() {
232
+ await this.railLocator.locator(".task-config-header").getByText("Output properties").click();
233
+ }
234
+ async getValueFromCi(propertyName) {
235
+ return this.railLocator.locator(`input[id="${propertyName}"]`).inputValue();
236
+ }
237
+ async getAllOptionsFromCi(propertyName) {
238
+ await this.railLocator.locator(`input[id="${propertyName}"]`).click();
239
+ return this.railLocator.locator(`.dot-popper ul li`).allInnerTexts();
240
+ }
241
+ async setValueFromCi(propertyName, value) {
242
+ await this.railLocator.locator(`input[id="${propertyName}"]`).clear();
243
+ await this.railLocator.locator(`input[id="${propertyName}"]`).click();
244
+ await this.railLocator.locator(`.dot-popper ul li`, {
245
+ hasText: value
246
+ }).click();
247
+ }
248
+ async getValueFromString(propertyName) {
249
+ await this.railLocator.locator(`.input-scalar-fake-input[id="${propertyName}"]`).focus();
250
+ return this.railLocator.locator(`input[id="${propertyName}"]`).inputValue();
251
+ }
252
+ async setValueFromString(propertyName, value) {
253
+ await this.railLocator.locator(`.input-scalar-fake-input[id="${propertyName}"]`).focus();
254
+ await this.railLocator.locator(`input[id="${propertyName}"]`).fill(value);
255
+ }
256
+ async setValueFromLargeString(propertyName, value) {
257
+ await this.railLocator.locator(`.input-scalar-fake-input[id="${propertyName}"]`).focus();
258
+ await this.railLocator.locator(`textarea[id="${propertyName}"]`).fill(value);
259
+ }
260
+ async setValueFromPassword(propertyName, value) {
261
+ await this.railLocator.locator(`input[id="${propertyName}"]`).fill(value);
262
+ }
263
+ async setAndCreateVariable(propertyName, variableName) {
264
+ await this.railLocator.locator(`input[id="${propertyName}"]`).clear();
265
+ await this.railLocator.locator(`input[id="${propertyName}"]`).click();
266
+ await this.railLocator.locator(`input[id="${propertyName}"]`).fill(variableName);
267
+ await this.railLocator.locator(`.dot-popper button`, {
268
+ hasText: variableName
269
+ }).click();
270
+ }
271
+ async setVariable(propertyName, variableName) {
272
+ return this.setValueFromCi(propertyName, variableName);
273
+ }
274
+ async expectValueFromString(propertyName, propertyValue) {
275
+ return await (0, $hOLA6$expect)(this.railLocator.locator(`.input-scalar-fake-input[id="${propertyName}"]`)).toHaveText(propertyValue);
219
276
  }
220
277
  async setValueFromMap(propertyName, key, value) {
221
278
  await this.railLocator.locator(`.input-with-map[data-test-id="${propertyName}"] button.add-new-button`).click();
@@ -231,12 +288,174 @@ class $90bb70a7e909e500$export$519356f6c50361f7 extends (0, $9626bc9256ce31f7$ex
231
288
  async expectScriptToContain(script) {
232
289
  await (0, $hOLA6$expect)(this.page.locator(".code-editor .ace_content")).toContainText(script);
233
290
  }
291
+ async enterScriptForAutoComplete(script) {
292
+ await this.page.locator(".code-editor textarea.ace_text-input").clear();
293
+ await this.page.locator(".code-editor textarea.ace_text-input").fill(script);
294
+ await this.page.locator(".code-editor textarea.ace_text-input").press(".");
295
+ }
296
+ async openScriptEditorInSeparateWindow() {
297
+ await this.page.getByTestId("fullscreen-enter-btn").click();
298
+ (0, $hOLA6$expect)(this.page.locator("#dialogTitle")).toBeVisible();
299
+ }
300
+ async closeFullscreenScriptWindowWithESC() {
301
+ await this.page.locator("#dialogTitle").press("Escape");
302
+ (0, $hOLA6$expect)(this.page.locator("#dialogTitle")).not.toBeVisible();
303
+ }
304
+ async closeFullscreenScriptWindow() {
305
+ await this.page.getByTestId("fullscreen-exit-btn").click();
306
+ (0, $hOLA6$expect)(this.page.locator("#dialogTitle")).not.toBeVisible();
307
+ }
234
308
  async abort(comment) {
235
309
  await this.page.getByTestId("single-action-button").click();
236
310
  await this.page.getByTestId("task-action-comment").click();
237
311
  await this.page.getByTestId("task-action-comment").fill(comment);
238
312
  await this.page.getByTestId("task-action-confirm").click();
239
313
  }
314
+ async expectDependenciesDisplayed(dependencies) {
315
+ await this.railLocator.locator(".gate-task-dependencies").waitFor();
316
+ for(let i = 0; i < dependencies.length; i++)await (0, $hOLA6$expect)(this.page.locator(".dependency").filter({
317
+ hasText: dependencies[i]
318
+ })).toBeVisible();
319
+ }
320
+ async expectCanDeleteDependency(title, canDelete = true) {
321
+ if (canDelete) {
322
+ const locat = this.page.locator(".dependency").filter({
323
+ has: this.page.getByRole("link", {
324
+ name: title,
325
+ exact: true
326
+ })
327
+ }).locator(".icon-options");
328
+ await locat.isVisible();
329
+ await locat.click();
330
+ await (0, $hOLA6$expect)(this.railLocator.getByRole("menuitem", {
331
+ name: "Remove"
332
+ })).toBeVisible();
333
+ } else await (0, $hOLA6$expect)(this.page.locator(".dependency").filter({
334
+ has: this.page.getByRole("link", {
335
+ name: title,
336
+ exact: true
337
+ })
338
+ }).locator(".icon-options")).not.toBeVisible();
339
+ }
340
+ async getDependencyCount() {
341
+ await (0, $hOLA6$expect)(this.railLocator.locator(".gate-task-dependencies")).toBeVisible();
342
+ const count = await this.railLocator.locator(".gate-task-dependencies .dependency").count();
343
+ return count;
344
+ }
345
+ async addDependency() {
346
+ await (0, $hOLA6$expect)(this.railLocator.locator(".add-dependency-btn")).toBeVisible();
347
+ await this.railLocator.locator(".add-dependency-btn").click();
348
+ }
349
+ async expectDependencyText(dependencies) {
350
+ await (0, $hOLA6$expect)(this.railLocator.locator(".gate-task-dependencies")).toBeVisible();
351
+ await (0, $hOLA6$expect)(this.page.getByRole("link", {
352
+ name: dependencies,
353
+ exact: true
354
+ }).first()).toBeVisible();
355
+ }
356
+ async clickEditDependency(dependencies) {
357
+ const locat = this.page.locator(".dependency").filter({
358
+ has: this.page.getByRole("link", {
359
+ name: dependencies,
360
+ exact: true
361
+ })
362
+ }).locator(".icon-options");
363
+ await locat.isVisible();
364
+ await locat.click();
365
+ const frame = this.page.getByTestId("undefined-menu");
366
+ if (await frame.isVisible()) await this.railLocator.getByRole("menuitem", {
367
+ name: "Edit"
368
+ }).click();
369
+ else {
370
+ await locat.nth(1).click();
371
+ await this.railLocator.getByRole("menuitem", {
372
+ name: "Edit"
373
+ }).click();
374
+ }
375
+ }
376
+ }
377
+ class $90bb70a7e909e500$export$fbbf45eff21470e3 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
378
+ constructor(page){
379
+ super(page);
380
+ this.dependencyLocator = page.locator(".gate-task-dependencies .dependency-selector-component");
381
+ this.release = this.dependencyLocator.locator("#release-dependency");
382
+ this.phase = this.dependencyLocator.locator("#phase-dependency");
383
+ this.task = this.dependencyLocator.locator("#task-dependency");
384
+ }
385
+ async getRelease() {
386
+ await this.release.isVisible();
387
+ const releaseValue = await this.release.getAttribute("value");
388
+ return releaseValue;
389
+ }
390
+ async getPhase() {
391
+ await this.phase.isVisible();
392
+ const phaseValue = await this.phase.getAttribute("value");
393
+ return phaseValue;
394
+ }
395
+ async getTask() {
396
+ await this.task.isVisible();
397
+ const taskValue = await this.task.getAttribute("value");
398
+ return taskValue;
399
+ }
400
+ async setRelease(releaseTitle) {
401
+ await this.release.click();
402
+ await this.release.fill(releaseTitle);
403
+ await this.page.getByRole("option", {
404
+ name: releaseTitle
405
+ }).click();
406
+ }
407
+ async save() {
408
+ await (0, $hOLA6$expect)(this.dependencyLocator.getByRole("button", {
409
+ name: "OK"
410
+ })).toBeEnabled();
411
+ await this.dependencyLocator.getByRole("button", {
412
+ name: "OK"
413
+ }).click();
414
+ }
415
+ async setPhase(phaseTitle) {
416
+ await this.phase.click();
417
+ await this.phase.fill("");
418
+ await this.page.getByRole("option", {
419
+ name: phaseTitle
420
+ }).click();
421
+ }
422
+ async setTask(taskTitle) {
423
+ await this.task.click();
424
+ await this.task.fill("");
425
+ await this.page.getByRole("option", {
426
+ name: taskTitle
427
+ }).click();
428
+ }
429
+ async clearPhase() {
430
+ await this.phase.clear();
431
+ }
432
+ async expectVariableModeEnabled(mode) {
433
+ await (0, $hOLA6$expect)(this.dependencyLocator.getByLabel("input-variable")).toBeVisible();
434
+ const variablemode = await this.dependencyLocator.getByLabel("input-variable").getAttribute("aria-pressed");
435
+ (0, $hOLA6$expect)(variablemode).toBe("" + mode + "");
436
+ }
437
+ async clickVariable() {
438
+ await this.dependencyLocator.getByLabel("input-variable").click();
439
+ }
440
+ //TODO: getAttribute('value') is not working as expected. Need to be fixed with better alternative.
441
+ async expectMinimumOptions(options) {
442
+ await this.dependencyLocator.getByPlaceholder("Please select a variable of").click();
443
+ for(let i = 0; i < options.length; i++){
444
+ const option = await this.dependencyLocator.locator("#mui-30-option-" + i).getAttribute("value");
445
+ (0, $hOLA6$expect)(options[i]).toContain(option);
446
+ }
447
+ }
448
+ async enterNewVariable(variablename) {
449
+ await this.page.getByLabel("Please select a variable of").click();
450
+ await this.page.getByLabel("Please select a variable of").fill(variablename);
451
+ await this.page.getByTestId("dot-action-item-btn").click();
452
+ }
453
+ async selectVariable(variablename) {
454
+ await this.page.getByLabel("Please select a variable of").click();
455
+ await this.page.getByRole("option", {
456
+ name: variablename
457
+ }).click();
458
+ }
240
459
  }
241
460
 
242
461
 
@@ -257,9 +476,44 @@ class $9c357602b6f466e7$export$aa59788fdecae2f2 extends (0, $9626bc9256ce31f7$ex
257
476
  await test.isVisible();
258
477
  await (0, $hOLA6$expect)(test).toContainText(filename);
259
478
  }
479
+ async getAttachmentsListCount() {
480
+ return await this.page.locator(".file-upload-list div").count();
481
+ }
482
+ async uploadFile(filePath) {
483
+ const fileChooserPromise = this.page.waitForEvent("filechooser");
484
+ await this.page.getByRole("button", {
485
+ name: "Select file(s)"
486
+ }).click();
487
+ const fileChooser = await fileChooserPromise;
488
+ await fileChooser.setFiles(filePath);
489
+ }
490
+ async downloadFile(filename) {
491
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
492
+ this.page.on("download", ()=>{});
493
+ const downloadPromise = this.page.waitForEvent("download");
494
+ await this.page.locator("li").filter({
495
+ hasText: "" + filename + ""
496
+ }).click();
497
+ await downloadPromise;
498
+ }
499
+ async deleteAttachment(fileName) {
500
+ await this.page.locator("li").filter({
501
+ hasText: fileName
502
+ }).click();
503
+ await this.page.getByLabel("delete file").click();
504
+ await this.page.getByRole("button", {
505
+ name: "Delete"
506
+ }).click();
507
+ }
508
+ async expectWithNoAttachment(tempFile) {
509
+ const test = await this.page.locator(".task-attachments-grid .file-item-text").isVisible();
510
+ if (test) await (0, $hOLA6$expect)(this.page.locator(".task-attachments-grid .file-item-text")).not.toContainText(tempFile);
511
+ else await (0, $hOLA6$expect)(this.page.locator(".task-attachments-grid .file-item-text")).not.toBeVisible();
512
+ }
260
513
  }
261
514
 
262
515
 
516
+
263
517
  class $8e39246218b802fc$export$e946776eae644790 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
264
518
  constructor(page){
265
519
  super(page);
@@ -320,6 +574,9 @@ class $8e39246218b802fc$export$e946776eae644790 extends (0, $9626bc9256ce31f7$ex
320
574
  await this.commentBox.fill(comment);
321
575
  await this.confirm.click();
322
576
  }
577
+ async expectTaskTitle(taskTitle) {
578
+ (0, $hOLA6$expect)(await this.page.locator(".task-drawer .task-title-input .dot-view-mode-typography").innerText()).toContain(taskTitle);
579
+ }
323
580
  }
324
581
 
325
582
 
@@ -613,17 +870,16 @@ class $6720a523bcb1cce0$export$3cac5fd37ae64b91 extends (0, $9626bc9256ce31f7$ex
613
870
 
614
871
 
615
872
 
873
+
616
874
  class $21185a378c23589e$export$e2e2e1ffdce20c30 extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
617
875
  constructor(page){
618
876
  super(page);
619
877
  this.userName = page.locator("#username");
620
- this.name = page.locator("#full-name");
878
+ this.name = page.locator("#fullName");
621
879
  this.email = page.locator("#email");
622
- this.password = page.locator('[data-test="password-input"]');
623
- this.cnfPassword = page.locator("#passwordConfirmation");
624
- this.saveButton = page.getByRole("button", {
625
- name: "Save"
626
- });
880
+ this.password = page.locator("#password");
881
+ this.cnfPassword = page.locator("#confirmPassword");
882
+ this.saveButton = page.getByTestId("save-btn");
627
883
  this.cancelButton = page.getByRole("button", {
628
884
  name: "Cancel"
629
885
  });
@@ -647,6 +903,9 @@ class $21185a378c23589e$export$e2e2e1ffdce20c30 extends (0, $9626bc9256ce31f7$ex
647
903
  return await this.cnfPassword.fill(cnfPassword);
648
904
  }
649
905
  async save() {
906
+ await this.saveButton.isEnabled();
907
+ await (0, $hOLA6$expect)(this.saveButton).not.toBeDisabled();
908
+ await this.saveButton.focus();
650
909
  await this.saveButton.click();
651
910
  }
652
911
  async cancel() {
@@ -673,8 +932,10 @@ class $2cb6a6ac6b17e85f$export$107317390f5aa598 extends (0, $9626bc9256ce31f7$ex
673
932
  async toggleLoginPermission(username) {
674
933
  await this.page.getByRole("row", {
675
934
  name: "" + username + ""
676
- }).getByRole("checkbox").check();
677
- //await this.page.locator(`tr:contains('${username}') .login-permission input`).click();
935
+ }).getByRole("checkbox").click();
936
+ await (0, $hOLA6$expect)(this.page.getByRole("row", {
937
+ name: "" + username + ""
938
+ }).locator(".Mui-checked")).toBeChecked();
678
939
  }
679
940
  async addUser() {
680
941
  await this.newUserButton.click();
@@ -1268,9 +1529,12 @@ const $80c3ae34677b4324$export$e0969da9b8fb378d = (0, $hOLA6$test).extend({
1268
1529
  }
1269
1530
  });
1270
1531
  class $80c3ae34677b4324$var$Fixtures {
1532
+ archivedReleaseIds = [];
1271
1533
  releaseIds = [];
1272
1534
  triggerIds = [];
1273
1535
  configurationIds = [];
1536
+ globalVariableIds = [];
1537
+ folderIds = [];
1274
1538
  usernames = [];
1275
1539
  userProfiles = [];
1276
1540
  constructor(request, page){
@@ -1282,15 +1546,29 @@ class $80c3ae34677b4324$var$Fixtures {
1282
1546
  this.releaseIds.push(release.id);
1283
1547
  return this.deleteRelease(release.id).then(()=>this.deleteArchivedRelease(release.id)).then(()=>this.doPost("fixtures/release", release));
1284
1548
  }
1549
+ archivedRelease(release) {
1550
+ this.initDefaults(release);
1551
+ this.archivedReleaseIds.push(release.id);
1552
+ return this.doPost("fixtures/archived", release);
1553
+ }
1285
1554
  configuration(ci) {
1286
1555
  this.configurationIds.push(ci.id);
1287
1556
  return this.doPost("fixtures/shared", [
1288
1557
  ci
1289
1558
  ]);
1290
1559
  }
1291
- trigger(trigger) {
1292
- this.triggerIds.push(trigger.id);
1293
- return this.doPost("fixtures/trigger", trigger);
1560
+ getParentId(id) {
1561
+ return id.substring(0, id.lastIndexOf("/"));
1562
+ }
1563
+ folder(folder) {
1564
+ const parentId = this.getParentId(folder.id);
1565
+ //ToDo: Add system teams
1566
+ /* eslint-disable @typescript-eslint/no-unused-vars */ const teams = folder.teams;
1567
+ delete folder.teams;
1568
+ //ToDo: Add Children
1569
+ const children = folder.children || [];
1570
+ delete folder.children;
1571
+ /* eslint-disable @typescript-eslint/no-unused-vars */ return this.doPost(`api/v1/folders/${parentId}`, folder);
1294
1572
  }
1295
1573
  deleteArchivedRelease(id) {
1296
1574
  const releaseId = id.includes("Applications/") ? id : `Applications/${id}`;
@@ -1319,8 +1597,19 @@ class $80c3ae34677b4324$var$Fixtures {
1319
1597
  id
1320
1598
  ]);
1321
1599
  }
1322
- activityLogs(releaseId, logs) {
1323
- return this.doPost(`fixtures/activityLogs/${releaseId}`, logs);
1600
+ deleteFolder(folderId) {
1601
+ const id = this.doGet(`api/v1/folders/${folderId}`);
1602
+ return this.doDelete(`api/v1/folders/${id}`);
1603
+ }
1604
+ activityLogs(id, logs) {
1605
+ return this.doPost(`fixtures/activityLogs/${id}`, logs);
1606
+ }
1607
+ globalVariable(variable) {
1608
+ variable.id = variable.id || `Configuration/variables/global/Variable_${variable.key}`;
1609
+ this.globalVariableIds.push(variable.id);
1610
+ variable.requiresValue = false;
1611
+ variable.showOnReleaseStart = false;
1612
+ return this.doPost("api/v1/config/Configuration/variables/global", variable);
1324
1613
  }
1325
1614
  async cleanAll() {
1326
1615
  for (const username of this.usernames)await this.deleteUser(username);
@@ -1328,6 +1617,8 @@ class $80c3ae34677b4324$var$Fixtures {
1328
1617
  for (const triggerId of this.triggerIds)await this.deleteTrigger(triggerId);
1329
1618
  for (const releaseId of this.releaseIds.reverse())await this.deleteRelease(releaseId);
1330
1619
  for (const confId of this.configurationIds)await this.deleteConfiguration(confId);
1620
+ for (const folderId of this.folderIds.reverse())await this.deleteFolder(folderId);
1621
+ this.folderIds = [];
1331
1622
  this.releaseIds = [];
1332
1623
  this.triggerIds = [];
1333
1624
  this.configurationIds = [];