@digital-ai/devops-page-object-deploy 0.0.4 → 0.0.6

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
@@ -2,8 +2,9 @@ import {test as $lE6ZQ$test, expect as $lE6ZQ$expect} from "@playwright/test";
2
2
  import {split as $lE6ZQ$split, join as $lE6ZQ$join, take as $lE6ZQ$take} from "rambda";
3
3
 
4
4
  class $b464119f5ec5aad0$export$6e2c8f0811a474ce {
5
- constructor(sectionRootLocator){
6
- this.sectionRoot = sectionRootLocator;
5
+ constructor(parentLocator, sectionRootLocator){
6
+ this.parentLocator = parentLocator;
7
+ this.sectionRoot = this.parentLocator.locator(sectionRootLocator);
7
8
  }
8
9
  /**
9
10
  * Get child element in the section "this.sectionRoot" refers to
@@ -16,8 +17,8 @@ class $b464119f5ec5aad0$export$6e2c8f0811a474ce {
16
17
 
17
18
 
18
19
  class $66de4f08dadae772$export$cc4f63927c41742f extends (0, $b464119f5ec5aad0$export$6e2c8f0811a474ce) {
19
- constructor(page){
20
- super(page.getByTestId("primaryNav"));
20
+ constructor(parentLocator, page){
21
+ super(parentLocator, page.getByTestId("primaryNav"));
21
22
  }
22
23
  /**
23
24
  * Click on side navigation links
@@ -28,8 +29,9 @@ class $66de4f08dadae772$export$cc4f63927c41742f extends (0, $b464119f5ec5aad0$ex
28
29
 
29
30
 
30
31
  class $26d8c96bf2341a59$export$110709f040143804 extends (0, $66de4f08dadae772$export$cc4f63927c41742f) {
31
- constructor(page){
32
- super(page);
32
+ static sectionRootLocator = ".Pane vertical Pane1";
33
+ constructor(parentLocator, page){
34
+ super(parentLocator, page);
33
35
  this.backButtonLocator = page.getByTestId("back-button");
34
36
  this.linkExploreLocator = page.locator("p:has-text('Explorer')");
35
37
  this.linkCompareLocator = page.locator("p:has-text('Compare')");
@@ -103,17 +105,18 @@ class $26d8c96bf2341a59$export$110709f040143804 extends (0, $66de4f08dadae772$ex
103
105
 
104
106
 
105
107
  class $7f808a48ced6cace$export$3b4e64e77073e307 extends (0, $b464119f5ec5aad0$export$6e2c8f0811a474ce) {
106
- constructor(page){
107
- super(page.locator(".banner-container"));
108
+ constructor(parentLocator, page){
109
+ super(parentLocator, page.locator(".banner-container"));
108
110
  }
109
111
  }
110
112
 
111
113
 
112
114
  class $5dbb03b38de032e2$export$7c6e2c02157bb7d2 extends (0, $b464119f5ec5aad0$export$6e2c8f0811a474ce) {
113
- constructor(page){
114
- super(page.locator(".Pane.vertical.Pane1"));
115
- this.banner = new (0, $7f808a48ced6cace$export$3b4e64e77073e307)(page);
116
- this.leftPanel = new (0, $26d8c96bf2341a59$export$110709f040143804)(page);
115
+ static sectionRoot = ".app-root";
116
+ constructor(parentLocator, page){
117
+ super(parentLocator, page.locator($5dbb03b38de032e2$export$7c6e2c02157bb7d2.sectionRoot));
118
+ this.banner = new (0, $7f808a48ced6cace$export$3b4e64e77073e307)(page.locator($5dbb03b38de032e2$export$7c6e2c02157bb7d2.sectionRoot), page);
119
+ this.leftPanel = new (0, $26d8c96bf2341a59$export$110709f040143804)(page.locator($5dbb03b38de032e2$export$7c6e2c02157bb7d2.sectionRoot), page);
117
120
  }
118
121
  }
119
122
 
@@ -126,7 +129,7 @@ class $54bcd1bcf08dd053$export$d9b273488cd8ce6f extends (0, $b464119f5ec5aad0$ex
126
129
  * @param menuLinkLocator Menu link locator thats used to open/close the menu
127
130
  * @param menuItemsParentLocator Menu items that opens up when menu link is clicked
128
131
  */ constructor(menuContentRootLocator, menuLinkLocator, menuItemsParentLocator){
129
- super(menuContentRootLocator);
132
+ super($54bcd1bcf08dd053$export$d9b273488cd8ce6f.parentLocator, menuContentRootLocator);
130
133
  this.menuLinkLocator = menuLinkLocator;
131
134
  this.menuItemsParentLocator = menuContentRootLocator.locator(menuItemsParentLocator);
132
135
  }
@@ -208,9 +211,10 @@ class $b4bd429df4806013$export$5929c05a25eed48f extends (0, $54bcd1bcf08dd053$ex
208
211
 
209
212
 
210
213
  class $60e85cd955b64c3b$export$ca8bffe144e51c8 extends (0, $b464119f5ec5aad0$export$6e2c8f0811a474ce) {
211
- constructor(page){
212
- super(page.locator(".dot-branding"));
213
- this.logo = page.getByTestId("primary-logo");
214
+ static sectionRootLocator = ".dot-branding";
215
+ constructor(parentLocator, page){
216
+ super(parentLocator, page.locator($60e85cd955b64c3b$export$ca8bffe144e51c8.sectionRootLocator));
217
+ this.logo = this.findElementInSection(page.getByTestId("primary-logo"));
214
218
  }
215
219
  async clickLogo() {
216
220
  await this.logo.click();
@@ -265,29 +269,37 @@ class $e05e449fbf3516f1$export$1d7840d5cdc861d5 extends (0, $54bcd1bcf08dd053$ex
265
269
 
266
270
 
267
271
 
272
+
268
273
  class $e477fae343f80541$export$f7f58290278dd286 extends (0, $54bcd1bcf08dd053$export$d9b273488cd8ce6f) {
269
274
  constructor(page){
270
- super(page.locator("#context-menu-popover"), page.getByTitle("admin"), page.locator(".dropdown-menu.multi-level.dropdown-menu-0"));
275
+ super(page.locator("#context-menu-popover"), page.getByTitle(".dot-avatar"), page.locator(".dropdown-menu.multi-level.dropdown-menu-0"));
276
+ this.page = page;
271
277
  this.userProfileLocator = page.getByRole("link", {
272
278
  name: "User profile"
273
279
  });
274
280
  this.logoutLocator = page.getByRole("link", {
275
281
  name: "Log out"
276
282
  });
283
+ this.avatarTooltip = page.locator(".avatar-wrapper>.dot-tooltip");
277
284
  }
278
285
  async clickUserProfile() {
279
286
  await this.clickMenuItem(this.userProfileLocator);
280
287
  }
281
- async Logout() {
288
+ async logout() {
282
289
  await this.clickMenuItem(this.logoutLocator);
283
290
  }
291
+ async validateAvatarName(expectedName) {
292
+ (0, $lE6ZQ$expect)(await this.avatarTooltip.getAttribute("title")).toContain(expectedName);
293
+ }
284
294
  }
285
295
 
286
296
 
287
297
  class $7bc68dfa9f2318a7$export$8b251419efc915eb extends (0, $b464119f5ec5aad0$export$6e2c8f0811a474ce) {
288
- constructor(page){
289
- super(page.locator(".main-header-wrapper.logged-in"));
290
- this.brandLogo = new (0, $60e85cd955b64c3b$export$ca8bffe144e51c8)(page);
298
+ static sectionRootLocator = ".main-header-wrapper.logged-in";
299
+ constructor(parentLocator, page){
300
+ super(parentLocator, page.locator($7bc68dfa9f2318a7$export$8b251419efc915eb.sectionRootLocator));
301
+ this.page = page;
302
+ this.brandLogo = new (0, $60e85cd955b64c3b$export$ca8bffe144e51c8)(page.locator(".main-header-wrapper.logged-in"), page);
291
303
  this.helperMenu = new (0, $b4bd429df4806013$export$5929c05a25eed48f)(page);
292
304
  this.settingsMenu = new (0, $e05e449fbf3516f1$export$1d7840d5cdc861d5)(page);
293
305
  this.avatarMenu = new (0, $e477fae343f80541$export$f7f58290278dd286)(page);
@@ -297,8 +309,47 @@ class $7bc68dfa9f2318a7$export$8b251419efc915eb extends (0, $b464119f5ec5aad0$ex
297
309
 
298
310
  class $7d546dcaafadc158$export$2b65d1d97338f32b {
299
311
  constructor(page){
300
- this.header = new (0, $7bc68dfa9f2318a7$export$8b251419efc915eb)(page);
301
- this.content = new (0, $5dbb03b38de032e2$export$7c6e2c02157bb7d2)(page);
312
+ this.header = new (0, $7bc68dfa9f2318a7$export$8b251419efc915eb)(page.locator(".ci-explorer"), page);
313
+ this.content = new (0, $5dbb03b38de032e2$export$7c6e2c02157bb7d2)(page.locator(".ci-explorer"), page);
314
+ }
315
+ }
316
+
317
+
318
+
319
+ class $9f5bc0f6324fb5ea$export$a7fed597f4b8afd8 extends (0, $b464119f5ec5aad0$export$6e2c8f0811a474ce) {
320
+ constructor(parentLocator, mainContentRootLocator){
321
+ super(parentLocator, mainContentRootLocator);
322
+ }
323
+ async fillTextInput(textInput, textValue) {
324
+ await textInput.clear();
325
+ await textInput.fill(textValue);
326
+ }
327
+ }
328
+
329
+
330
+ class $bc332e5dcec2d43b$export$56c2ba9e13461f38 extends (0, $9f5bc0f6324fb5ea$export$a7fed597f4b8afd8) {
331
+ static mainContentRootLocator = ".login-component";
332
+ constructor(parentLocator, page){
333
+ super(parentLocator, page.locator($bc332e5dcec2d43b$export$56c2ba9e13461f38.mainContentRootLocator));
334
+ this.page = page;
335
+ this.username = this.findElementInSection(page.getByPlaceholder("User"));
336
+ this.password = this.findElementInSection(page.getByPlaceholder("Password"));
337
+ this.loginButton = this.findElementInSection(page.getByRole("button", {
338
+ name: "Log in"
339
+ }));
340
+ this.rememberMeCheckbox = this.findElementInSection(page.locator("#rememberMeCheckbox"));
341
+ }
342
+ async enterUserName(username) {
343
+ await this.fillTextInput(this.username, username);
344
+ }
345
+ async enterPassword(password) {
346
+ await this.fillTextInput(this.password, password);
347
+ }
348
+ async clickLogin() {
349
+ await this.loginButton.click();
350
+ }
351
+ async clickRememberMe() {
352
+ await this.rememberMeCheckbox.click();
302
353
  }
303
354
  }
304
355
 
@@ -307,19 +358,15 @@ class $c2c31ea6199a3576$export$f14c0e3f98d164c0 extends (0, $7d546dcaafadc158$ex
307
358
  constructor(page){
308
359
  super(page);
309
360
  this.page = page;
310
- this.username = page.getByPlaceholder("User");
311
- this.password = page.getByPlaceholder("Password");
312
- this.loginButton = page.getByRole("button", {
313
- name: "Log in"
314
- });
315
- this.rememberMeCheckbox = page.locator("#rememberMeCheckbox");
361
+ this.loginForm = new (0, $bc332e5dcec2d43b$export$56c2ba9e13461f38)(page.locator(".login-layout"), page);
316
362
  }
317
363
  async login(user, pwd) {
318
364
  await this.page.goto("/#/login");
319
- await this.username.fill(user);
320
- await this.password.fill(pwd);
321
- await this.loginButton.click();
365
+ await this.loginForm.enterUserName(user);
366
+ await this.loginForm.enterPassword(pwd);
367
+ await this.loginForm.clickLogin();
322
368
  await this.page.locator(".main-layout").waitFor();
369
+ await this.header.avatarMenu.validateAvatarName(user);
323
370
  }
324
371
  }
325
372
 
@@ -333,8 +380,7 @@ class $85032414fe55e0f1$export$7db63d2c950874b5 {
333
380
  /**
334
381
  * Create New directory under applications CI.
335
382
  * @param appDirectoryName
336
- * @param expectedCiType
337
- */ async createNewApplicationDirectory(appDirectoryName, expectedCiType) {
383
+ */ async createNewApplicationDirectory(appDirectoryName) {
338
384
  await this.applicationPage.contextMenu.clickApplicationCi();
339
385
  await this.applicationPage.contextMenu.clickMenuPath([
340
386
  "new",
@@ -343,14 +389,13 @@ class $85032414fe55e0f1$export$7db63d2c950874b5 {
343
389
  await this.applicationPage.form.assertSaveButtonIsDisabled();
344
390
  await this.applicationPage.form.assertSaveAndCloseButtonIsDisabled();
345
391
  await this.applicationPage.form.enterName(appDirectoryName);
346
- await this.applicationPage.tab.assertActiveTabSelector("Create " + expectedCiType);
392
+ await this.applicationPage.tab.assertActiveTabSelector("Create core.directory");
347
393
  await this.applicationPage.form.clickSaveAndClose();
348
394
  }
349
395
  /**
350
396
  * Create new application under Application ci
351
397
  * @param appName
352
- * @param expectedCiType
353
- */ async createNewApplication(appName, expectedCiType) {
398
+ */ async createNewApplication(appName) {
354
399
  await this.applicationPage.contextMenu.clickApplicationCi();
355
400
  await this.applicationPage.contextMenu.clickMenuPath([
356
401
  "new",
@@ -360,7 +405,7 @@ class $85032414fe55e0f1$export$7db63d2c950874b5 {
360
405
  await this.applicationPage.form.assertSaveAndCloseButtonIsDisabled();
361
406
  await this.applicationPage.form.enterName(appName);
362
407
  await this.applicationPage.form.clickSaveAndClose();
363
- await this.applicationPage.tab.assertActiveTabSelector("Create " + expectedCiType);
408
+ await this.applicationPage.tab.assertActiveTabSelector("Create udm.application");
364
409
  }
365
410
  /**
366
411
  * TODO: It is half done just to check on menu path other than new. Need to create as per scenario.
@@ -381,17 +426,44 @@ class $f6d52f442cf07ec8$export$3e41faf802a29e71 extends (0, $7d546dcaafadc158$ex
381
426
  super(page);
382
427
  this.page = page;
383
428
  this.parentTabLocator = this.page.locator(".working-panel-section .xl-react-tab-system");
384
- this.getTabTitleLocator = this.page.locator("li.active .tab-title");
429
+ this.getTabTitleLocator = this.parentTabLocator.locator("li.active .tab-title");
385
430
  this.closeIcon = this.page.locator(".xl-icon.close-ico");
431
+ this.tabSelector = this.parentTabLocator.locator(".tab-pane");
432
+ this.tabTitle = this.parentTabLocator.locator(".tab-title");
386
433
  }
387
- async assertActiveTabSelector(expectedCiType) {
388
- return await (0, $lE6ZQ$expect)(this.parentTabLocator.locator("li.active .tab-title")).toHaveText(expectedCiType, {
434
+ /**
435
+ * Assert active tab title with expected value.
436
+ * @param expectedCiType
437
+ * @returns
438
+ */ async assertActiveTabSelector(expectedCiType) {
439
+ return await (0, $lE6ZQ$expect)(this.getTabTitleLocator).toHaveText(expectedCiType, {
389
440
  ignoreCase: true
390
441
  });
391
442
  }
392
- async closeActiveTabs() {
443
+ /**
444
+ * Close the active tab by clicking close button
445
+ */ async closeActiveTabs() {
393
446
  if (await this.closeIcon.isVisible()) await this.parentTabLocator.locator(".nav .active .close-icon").click();
394
447
  }
448
+ /**
449
+ * Verify there is no tabs are opened.
450
+ */ async noTabsOpened() {
451
+ await (0, $lE6ZQ$expect)(this.tabSelector).not.toBeVisible();
452
+ }
453
+ /**
454
+ * Expect the given tab title is present in tab opened
455
+ * @param tabTitle
456
+ * @returns
457
+ */ async expectTabOpened(tabTitle) {
458
+ return await (0, $lE6ZQ$expect)(this.tabTitle).toHaveText(tabTitle);
459
+ }
460
+ /**
461
+ * Expect the given tab title is not present in tab opened
462
+ * @param tabTitle
463
+ * @returns
464
+ */ async expectTabNotOpened(tabTitle) {
465
+ return await (0, $lE6ZQ$expect)(this.tabTitle).not.toHaveText(tabTitle);
466
+ }
395
467
  }
396
468
 
397
469
 
@@ -431,20 +503,9 @@ class $6d0b1fc17db4a5fb$export$133beb65adbc45a3 extends (0, $54bcd1bcf08dd053$ex
431
503
 
432
504
 
433
505
 
434
- class $9f5bc0f6324fb5ea$export$a7fed597f4b8afd8 extends (0, $b464119f5ec5aad0$export$6e2c8f0811a474ce) {
435
- constructor(mainContentRootLocator){
436
- super(mainContentRootLocator);
437
- }
438
- async fillTextInput(textInput, textValue) {
439
- await textInput.clear();
440
- await textInput.fill(textValue);
441
- }
442
- }
443
-
444
-
445
506
  class $4baf6ba7e224a0ed$export$13ee474454c1948e extends (0, $9f5bc0f6324fb5ea$export$a7fed597f4b8afd8) {
446
- constructor(page){
447
- super(page.locator(".dip-view-body"));
507
+ constructor(parentLocator, page){
508
+ super(parentLocator, page.locator(".dip-view-body"));
448
509
  this.page = page;
449
510
  this.inputName = page.locator('input[name="name"]');
450
511
  this.inputLatestVersion = page.locator('input[name="lastVersion"]');
@@ -462,6 +523,8 @@ class $4baf6ba7e224a0ed$export$13ee474454c1948e extends (0, $9f5bc0f6324fb5ea$ex
462
523
  });
463
524
  this.errorMessage = page.locator(".error");
464
525
  this.formSection = page.locator(".xl-react-components.xl-react-dip-dynamic-form");
526
+ this.refreshButton = page.locator("i.refresh");
527
+ this.inputRename = page.locator(".infinite-tree-rename-input");
465
528
  }
466
529
  /**
467
530
  * Enter name in name field of the application form
@@ -530,8 +593,8 @@ class $4baf6ba7e224a0ed$export$13ee474454c1948e extends (0, $9f5bc0f6324fb5ea$ex
530
593
 
531
594
 
532
595
  class $1f57a739e2592b82$export$2b77a92f1a5ad772 extends (0, $b464119f5ec5aad0$export$6e2c8f0811a474ce) {
533
- constructor(page){
534
- super(page.locator(".xl-react-modal-content"));
596
+ constructor(parentLocator, page){
597
+ super(parentLocator, page.locator(".xl-react-modal-content"));
535
598
  this.header = page.locator(".modal-header");
536
599
  this.body = page.locator(".modal-body");
537
600
  this.footer = page.locator(".modal-footer");
@@ -540,8 +603,8 @@ class $1f57a739e2592b82$export$2b77a92f1a5ad772 extends (0, $b464119f5ec5aad0$ex
540
603
 
541
604
 
542
605
  class $9a8685efb2ff62b1$export$bd6452a745ffdb18 extends (0, $1f57a739e2592b82$export$2b77a92f1a5ad772) {
543
- constructor(page){
544
- super(page);
606
+ constructor(parentLocator, page){
607
+ super(parentLocator, page);
545
608
  this.deleteButton = page.getByRole("button", {
546
609
  name: "Delete",
547
610
  exact: true
@@ -550,6 +613,10 @@ class $9a8685efb2ff62b1$export$bd6452a745ffdb18 extends (0, $1f57a739e2592b82$ex
550
613
  name: "Cancel",
551
614
  exact: true
552
615
  });
616
+ this.moveButton = page.getByRole("button", {
617
+ name: "Move",
618
+ exact: true
619
+ });
553
620
  }
554
621
  async clickDelete() {
555
622
  await this.footer.locator(this.deleteButton).click();
@@ -557,6 +624,9 @@ class $9a8685efb2ff62b1$export$bd6452a745ffdb18 extends (0, $1f57a739e2592b82$ex
557
624
  async clickCancel() {
558
625
  await this.footer.locator(this.cancelButton).click();
559
626
  }
627
+ async clickMove() {
628
+ await this.footer.locator(this.moveButton).click();
629
+ }
560
630
  }
561
631
 
562
632
 
@@ -565,13 +635,14 @@ class $9a8685efb2ff62b1$export$bd6452a745ffdb18 extends (0, $1f57a739e2592b82$ex
565
635
 
566
636
 
567
637
 
638
+
568
639
  class $0ced90cc8a4c42e6$export$5a20f96f6e2d29e9 {
569
640
  constructor(page){
570
641
  this.page = page;
571
642
  this.contextMenu = new (0, $6d0b1fc17db4a5fb$export$133beb65adbc45a3)(page);
572
643
  this.tab = new (0, $f6d52f442cf07ec8$export$3e41faf802a29e71)(page);
573
- this.form = new (0, $4baf6ba7e224a0ed$export$13ee474454c1948e)(page);
574
- this.modal = new (0, $9a8685efb2ff62b1$export$bd6452a745ffdb18)(page);
644
+ this.form = new (0, $4baf6ba7e224a0ed$export$13ee474454c1948e)(page.locator(".Pane.vertical.Pane2"), page);
645
+ this.modal = new (0, $9a8685efb2ff62b1$export$bd6452a745ffdb18)(page.locator(".xl-react-modal-open"), page);
575
646
  }
576
647
  /**
577
648
  * Create new ci under any explorer package by providing following parameters.
@@ -594,16 +665,20 @@ class $0ced90cc8a4c42e6$export$5a20f96f6e2d29e9 {
594
665
  * Expand the ci path tree toggler.
595
666
  * @param pathnode
596
667
  */ async expandNode(pathnode) {
597
- if (await this.page.locator('div[data-id="' + pathnode + '"] a.infinite-tree-toggler.infinite-tree-closed').isVisible()) await this.page.locator('div[data-id="' + pathnode + '"] a').click();
668
+ const nodeLocator = await this.page.locator('div[data-id="' + pathnode + '"] a.infinite-tree-toggler.infinite-tree-closed').isVisible();
669
+ if (nodeLocator) await this.page.locator('div[data-id="' + pathnode + '"] a.infinite-tree-toggler.infinite-tree-closed').click();
598
670
  }
599
671
  /**
600
672
  * expands the path of CI by separating path from "/"
601
673
  * @param parentNodeId
602
674
  */ async expandNodePath(parentNodeId) {
603
- const nodeIdParts = $lE6ZQ$split("/", parentNodeId);
604
- for(let ind = 0; ind < nodeIdParts.length; ind += 1){
605
- const path = $lE6ZQ$join("/", $lE6ZQ$take(ind + 1, nodeIdParts));
606
- this.expandNode(path);
675
+ const ci = await this.page.isVisible('div[data-id="' + parentNodeId + '"]');
676
+ if (!ci) {
677
+ const nodeIdParts = $lE6ZQ$split("/", parentNodeId);
678
+ for(let ind = 0; ind < nodeIdParts.length; ind++){
679
+ const path = $lE6ZQ$join("/", $lE6ZQ$take(ind + 1, nodeIdParts));
680
+ await this.expandNode(path);
681
+ }
607
682
  }
608
683
  }
609
684
  /**
@@ -616,7 +691,12 @@ class $0ced90cc8a4c42e6$export$5a20f96f6e2d29e9 {
616
691
  * Delete the ci
617
692
  * @param node
618
693
  */ async deleteCi(node) {
619
- await this.page.locator('div[data-id="' + node + '"]').click();
694
+ const cipath = this.page.locator('div[data-id="' + node + '"]');
695
+ if (await cipath.isVisible()) await this.page.locator('div[data-id="' + node + '"]').click();
696
+ else {
697
+ await this.expandNodePath(node);
698
+ await this.page.locator('div[data-id="' + node + '"]').click();
699
+ }
620
700
  await this.page.locator('i[data-id="' + node + '"].context-menu-button').click();
621
701
  await this.contextMenu.clickMenuPath([
622
702
  "delete"
@@ -644,14 +724,107 @@ class $0ced90cc8a4c42e6$export$5a20f96f6e2d29e9 {
644
724
  await this.form.assertSaveAndCloseButtonIsDisabled();
645
725
  await this.tab.assertActiveTabSelector("Create " + expectedCiType + "");
646
726
  }
727
+ /**
728
+ * Duplicate the CI node in explorer using context-menu
729
+ * @param nodeId
730
+ */ async duplicate(nodeId) {
731
+ await this.expandNodePath(nodeId);
732
+ await this.page.locator('div[data-id="' + nodeId + '"]').click();
733
+ await this.page.locator('i[data-id="' + nodeId + '"].context-menu-button').click();
734
+ await this.contextMenu.clickMenuPath([
735
+ "duplicate"
736
+ ]);
737
+ }
738
+ /**
739
+ * Validate the given node ID is visible in the page
740
+ * @param nodeId
741
+ */ async validateNodeExists(nodeId) {
742
+ await (0, $lE6ZQ$expect)(this.page.locator('div[data-id="' + nodeId + '"]')).toBeVisible();
743
+ }
744
+ /**
745
+ * Validate the given node does not exists in the list.
746
+ * @param nodeId
747
+ */ async validateNodeDoesNotExists(nodeId) {
748
+ await (0, $lE6ZQ$expect)(this.page.locator('div[data-id="' + nodeId + '"]')).not.toBeVisible();
749
+ }
750
+ /**
751
+ * Rename the node Id with new string in CI.
752
+ * @param nodeId
753
+ * @param renamedValue
754
+ */ async inlineRename(nodeId, renamedValue) {
755
+ await this.expandNodePath(nodeId);
756
+ await this.page.locator('div[data-id="' + nodeId + '"]').click();
757
+ await this.page.locator('i[data-id="' + nodeId + '"].context-menu-button').click();
758
+ await this.contextMenu.clickMenuPath([
759
+ "rename"
760
+ ]);
761
+ await this.form.inputRename.waitFor();
762
+ await this.form.inputRename.fill(renamedValue);
763
+ await this.form.refreshButton.click();
764
+ await (0, $lE6ZQ$expect)(this.page.locator('div[data-id="' + nodeId + '"]')).not.toBeVisible();
765
+ }
766
+ /**
767
+ * Open CI from explorer
768
+ * @param nodeId
769
+ */ async openCi(nodeId) {
770
+ if (await this.page.locator('.infinite-tree-item[data-id="' + nodeId + '"]').isVisible()) await this.page.locator('.infinite-tree-item[data-id="' + nodeId + '"]').dblclick();
771
+ else {
772
+ await this.expandNodePath(nodeId);
773
+ await this.page.waitForSelector('.infinite-tree-item[data-id="' + nodeId + '"]');
774
+ await this.page.locator('.infinite-tree-item[data-id="' + nodeId + '"]').dblclick();
775
+ }
776
+ }
777
+ /**
778
+ * Select the CI which need to get deleted.
779
+ * @param nodeId
780
+ */ async selectDeleteCi(nodeId) {
781
+ const cipath = this.page.locator('div[data-id="' + nodeId + '"]');
782
+ if (await cipath.isVisible()) await this.page.locator('div[data-id="' + nodeId + '"]').click();
783
+ else {
784
+ await this.expandNodePath(nodeId);
785
+ await this.page.locator('div[data-id="' + nodeId + '"]').click();
786
+ }
787
+ await this.page.locator('i[data-id="' + nodeId + '"].context-menu-button').click();
788
+ await this.contextMenu.clickMenuPath([
789
+ "delete"
790
+ ]);
791
+ }
792
+ /**
793
+ * Click cancel button on modal window to cancel deletion.
794
+ */ async clickCancelAndWait() {
795
+ await this.modal.clickCancel();
796
+ }
797
+ /**
798
+ * Click Delete button on modal window to delete the CI
799
+ */ async clickConfirmAndWait() {
800
+ await this.modal.clickDelete();
801
+ }
802
+ /**
803
+ * Move ci
804
+ * @param source_path
805
+ * @param target_path
806
+ */ async moveCi(source_path, target_path) {
807
+ const source_cipath = this.page.locator('div[data-id="' + source_path + '"]');
808
+ const target_cipath = this.page.locator('div[data-id="' + target_path + '"]');
809
+ await this.expandNodePath(source_path);
810
+ //TODO: Find a better way to make sure target can be expanded without error, current implementation is workaround
811
+ await this.page.locator('div[data-id="' + target_path + '"]').textContent();
812
+ await this.expandNodePath(target_path);
813
+ await source_cipath.dragTo(target_cipath);
814
+ }
815
+ /**
816
+ * Click Move button on modal window to Move the CIs
817
+ */ async clickMoveAndWait() {
818
+ await this.modal.clickMove();
819
+ }
647
820
  }
648
821
 
649
822
 
650
823
 
651
824
 
652
825
  class $6cefee8b9be33b2d$export$60413e28724d3abd extends (0, $9f5bc0f6324fb5ea$export$a7fed597f4b8afd8) {
653
- constructor(page){
654
- super(page.locator(".dip-view-body"));
826
+ constructor(parentLocator, page){
827
+ super(parentLocator, page.locator(".dip-view-body"));
655
828
  this.page = page;
656
829
  this.inputName = page.locator('input[name="name"]');
657
830
  this.inputLatestVersion = page.locator('input[name="lastVersion"]');
@@ -668,6 +841,7 @@ class $6cefee8b9be33b2d$export$60413e28724d3abd extends (0, $9f5bc0f6324fb5ea$ex
668
841
  exact: true
669
842
  });
670
843
  this.formSection = page.locator(".xl-react-components.xl-react-dip-dynamic-form");
844
+ this.addButton = page.locator(".xl-btn-add");
671
845
  }
672
846
  /**
673
847
  * Enter name in name field of the application form
@@ -713,6 +887,29 @@ class $6cefee8b9be33b2d$export$60413e28724d3abd extends (0, $9f5bc0f6324fb5ea$ex
713
887
  */ async assertSaveAndCloseButtonIsDisabled() {
714
888
  return await (0, $lE6ZQ$expect)(this.findElementInSection(this.saveAndCloseButton)).toBeDisabled();
715
889
  }
890
+ /**
891
+ * Enter Field Values using its label value around application forms
892
+ * @param fieldName
893
+ * @param expectedValue
894
+ * @returns
895
+ */ async addFieldValue(fieldName, expectedValue) {
896
+ const label = this.formSection.locator('//label[text()="' + fieldName + '"]/parent::div/parent::div');
897
+ const input = label.locator(".xl-react-components-input input");
898
+ await input.fill(expectedValue);
899
+ await input.press("Enter");
900
+ const result = await input.getAttribute("value");
901
+ return (0, $lE6ZQ$expect)(result).toEqual(expectedValue);
902
+ }
903
+ async addOrchestrator(fieldValue) {
904
+ const label = this.formSection.locator('//label[text()="Orchestrator"]/parent::div/parent::div');
905
+ const input = label.locator(".xl-react-components-input input");
906
+ await input.fill(fieldValue);
907
+ await this.addButton.click();
908
+ await this.saveButton.waitFor();
909
+ await this.saveButton.click();
910
+ const result = await this.page.locator("span.text-container").getAttribute("title");
911
+ return (0, $lE6ZQ$expect)(result).toEqual(fieldValue);
912
+ }
716
913
  }
717
914
 
718
915
 
@@ -720,12 +917,12 @@ class $4e7e9f7ca5788871$export$bf4a5dd3be690f6b extends (0, $7d546dcaafadc158$ex
720
917
  constructor(page){
721
918
  super(page);
722
919
  this.contextMenu = new (0, $6d0b1fc17db4a5fb$export$133beb65adbc45a3)(page);
723
- this.form = new (0, $4baf6ba7e224a0ed$export$13ee474454c1948e)(page);
920
+ this.form = new (0, $4baf6ba7e224a0ed$export$13ee474454c1948e)(page.locator(".Pane.vertical.Pane2"), page);
724
921
  this.tab = new (0, $f6d52f442cf07ec8$export$3e41faf802a29e71)(page);
725
922
  this.util = new (0, $85032414fe55e0f1$export$7db63d2c950874b5)(this, page);
726
- this.modal = new (0, $9a8685efb2ff62b1$export$bd6452a745ffdb18)(page);
923
+ this.modal = new (0, $9a8685efb2ff62b1$export$bd6452a745ffdb18)(page.locator(".xl-react-modal-open"), page);
727
924
  this.commonUtil = new (0, $0ced90cc8a4c42e6$export$5a20f96f6e2d29e9)(page);
728
- this.appForm = new (0, $6cefee8b9be33b2d$export$60413e28724d3abd)(page);
925
+ this.appForm = new (0, $6cefee8b9be33b2d$export$60413e28724d3abd)(page.locator(".Pane.vertical.Pane2"), page);
729
926
  }
730
927
  }
731
928
 
@@ -749,8 +946,8 @@ class $736a7a3b2d786796$export$36d69433c4f81145 extends (0, $7d546dcaafadc158$ex
749
946
 
750
947
 
751
948
  class $07a0aa0673096895$export$855563f8bdb36207 extends (0, $9f5bc0f6324fb5ea$export$a7fed597f4b8afd8) {
752
- constructor(page){
753
- super(page.locator(".dip-view-body"));
949
+ constructor(parentLocator, page){
950
+ super(parentLocator, page.locator(".dip-view-body"));
754
951
  this.page = page;
755
952
  this.inputName = page.locator('input[name="name"]');
756
953
  this.inputLatestVersion = page.locator('input[name="lastVersion"]');
@@ -883,11 +1080,11 @@ class $c4efd1bbc33bdc4e$export$8ef81de2d4ebb0b9 extends (0, $7d546dcaafadc158$ex
883
1080
  constructor(page){
884
1081
  super(page);
885
1082
  this.contextMenu = new (0, $6d0b1fc17db4a5fb$export$133beb65adbc45a3)(page);
886
- this.form = new (0, $4baf6ba7e224a0ed$export$13ee474454c1948e)(page);
1083
+ this.form = new (0, $4baf6ba7e224a0ed$export$13ee474454c1948e)(page.locator(".Pane.vertical.Pane2"), page);
887
1084
  this.tab = new (0, $f6d52f442cf07ec8$export$3e41faf802a29e71)(page);
888
- this.modal = new (0, $9a8685efb2ff62b1$export$bd6452a745ffdb18)(page);
1085
+ this.modal = new (0, $9a8685efb2ff62b1$export$bd6452a745ffdb18)(page.locator(".xl-react-modal-open"), page);
889
1086
  this.commonUtil = new (0, $0ced90cc8a4c42e6$export$5a20f96f6e2d29e9)(page);
890
- this.configForm = new (0, $07a0aa0673096895$export$855563f8bdb36207)(page);
1087
+ this.configForm = new (0, $07a0aa0673096895$export$855563f8bdb36207)(page.locator(".Pane.vertical.Pane2"), page);
891
1088
  this.util = new (0, $e0ba9f6e7147a59d$export$ad55ec59bf82c4fc)(this, page);
892
1089
  }
893
1090
  }
@@ -902,8 +1099,8 @@ class $c4efd1bbc33bdc4e$export$8ef81de2d4ebb0b9 extends (0, $7d546dcaafadc158$ex
902
1099
 
903
1100
 
904
1101
  class $6bd08aebb33e3379$export$21cde1e6a73cf500 extends (0, $9f5bc0f6324fb5ea$export$a7fed597f4b8afd8) {
905
- constructor(page){
906
- super(page.locator(".dip-view-body"));
1102
+ constructor(parentLocator, page){
1103
+ super(parentLocator, page.locator(".dip-view-body"));
907
1104
  this.page = page;
908
1105
  this.formSection = page.locator(".xl-react-components.xl-react-dip-dynamic-form");
909
1106
  this.inputName = page.locator('input[name="name"]');
@@ -997,11 +1194,11 @@ class $5a95c11425d050d8$export$2c95c5c5be4fb9b0 extends (0, $7d546dcaafadc158$ex
997
1194
  constructor(page){
998
1195
  super(page);
999
1196
  this.contextMenu = new (0, $6d0b1fc17db4a5fb$export$133beb65adbc45a3)(page);
1000
- this.form = new (0, $4baf6ba7e224a0ed$export$13ee474454c1948e)(page);
1197
+ this.form = new (0, $4baf6ba7e224a0ed$export$13ee474454c1948e)(page.locator(".Pane.vertical.Pane2"), page);
1001
1198
  this.tab = new (0, $f6d52f442cf07ec8$export$3e41faf802a29e71)(page);
1002
- this.modal = new (0, $9a8685efb2ff62b1$export$bd6452a745ffdb18)(page);
1199
+ this.modal = new (0, $9a8685efb2ff62b1$export$bd6452a745ffdb18)(page.locator(".xl-react-modal-open"), page);
1003
1200
  this.commonUtil = new (0, $0ced90cc8a4c42e6$export$5a20f96f6e2d29e9)(page);
1004
- this.envForm = new (0, $6bd08aebb33e3379$export$21cde1e6a73cf500)(page);
1201
+ this.envForm = new (0, $6bd08aebb33e3379$export$21cde1e6a73cf500)(page.locator(".xl-react-modal-open"), page);
1005
1202
  this.util = new (0, $31f14a5153b274ab$export$b8a8d62f66d27fa1)(this, page);
1006
1203
  }
1007
1204
  }
@@ -1017,9 +1214,9 @@ class $bf1ec3be2f174e87$export$1f6beddb119e759b extends (0, $7d546dcaafadc158$ex
1017
1214
  constructor(page){
1018
1215
  super(page);
1019
1216
  this.contextMenu = new (0, $6d0b1fc17db4a5fb$export$133beb65adbc45a3)(page);
1020
- this.form = new (0, $4baf6ba7e224a0ed$export$13ee474454c1948e)(page);
1217
+ this.form = new (0, $4baf6ba7e224a0ed$export$13ee474454c1948e)(page.locator(".Pane.vertical.Pane2"), page);
1021
1218
  this.tab = new (0, $f6d52f442cf07ec8$export$3e41faf802a29e71)(page);
1022
- this.modal = new (0, $9a8685efb2ff62b1$export$bd6452a745ffdb18)(page);
1219
+ this.modal = new (0, $9a8685efb2ff62b1$export$bd6452a745ffdb18)(page.locator(".xl-react-modal-open"), page);
1023
1220
  this.commonUtil = new (0, $0ced90cc8a4c42e6$export$5a20f96f6e2d29e9)(page);
1024
1221
  }
1025
1222
  }