@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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @digital-ai/devops-page-object-deploy
2
2
 
3
+ ## 0.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 95c5229: Pages updated with parentLocators and with dataGrid class
8
+ This PR holds revamp of the pages with its parentLocator.
9
+ - 512af21: Added Move-Ci function, optimized application util methods
10
+
11
+ ## 0.0.5
12
+
13
+ ### Patch Changes
14
+
15
+ - e68ca43: Created methods for validating duplicate context-menu
16
+ inlineRename() method is created to rename CI's
17
+ duplicate() method is created to duplicate the CI's
18
+ Fixed the conditional check on expanding node path which was not working with isVisible method.
19
+ - 518605e: Fixed pages for context-menu delete ci scenario's
20
+ Pages to work with delete context-menu is created newly.
21
+ Methods for tab verification is added in Tab page file.
22
+
3
23
  ## 0.0.4
4
24
 
5
25
  ### Patch Changes
package/dist/main.js CHANGED
@@ -7,8 +7,9 @@ function $parcel$export(e, n, v, s) {
7
7
 
8
8
  $parcel$export(module.exports, "test", () => $3352700e95ddc19e$export$e0969da9b8fb378d);
9
9
  class $b031bda8df4df200$export$6e2c8f0811a474ce {
10
- constructor(sectionRootLocator){
11
- this.sectionRoot = sectionRootLocator;
10
+ constructor(parentLocator, sectionRootLocator){
11
+ this.parentLocator = parentLocator;
12
+ this.sectionRoot = this.parentLocator.locator(sectionRootLocator);
12
13
  }
13
14
  /**
14
15
  * Get child element in the section "this.sectionRoot" refers to
@@ -21,8 +22,8 @@ class $b031bda8df4df200$export$6e2c8f0811a474ce {
21
22
 
22
23
 
23
24
  class $beb748f674227a72$export$cc4f63927c41742f extends (0, $b031bda8df4df200$export$6e2c8f0811a474ce) {
24
- constructor(page){
25
- super(page.getByTestId("primaryNav"));
25
+ constructor(parentLocator, page){
26
+ super(parentLocator, page.getByTestId("primaryNav"));
26
27
  }
27
28
  /**
28
29
  * Click on side navigation links
@@ -33,8 +34,9 @@ class $beb748f674227a72$export$cc4f63927c41742f extends (0, $b031bda8df4df200$ex
33
34
 
34
35
 
35
36
  class $7c2e5bae754cf9e5$export$110709f040143804 extends (0, $beb748f674227a72$export$cc4f63927c41742f) {
36
- constructor(page){
37
- super(page);
37
+ static sectionRootLocator = ".Pane vertical Pane1";
38
+ constructor(parentLocator, page){
39
+ super(parentLocator, page);
38
40
  this.backButtonLocator = page.getByTestId("back-button");
39
41
  this.linkExploreLocator = page.locator("p:has-text('Explorer')");
40
42
  this.linkCompareLocator = page.locator("p:has-text('Compare')");
@@ -108,17 +110,18 @@ class $7c2e5bae754cf9e5$export$110709f040143804 extends (0, $beb748f674227a72$ex
108
110
 
109
111
 
110
112
  class $4a9d9a80e54af555$export$3b4e64e77073e307 extends (0, $b031bda8df4df200$export$6e2c8f0811a474ce) {
111
- constructor(page){
112
- super(page.locator(".banner-container"));
113
+ constructor(parentLocator, page){
114
+ super(parentLocator, page.locator(".banner-container"));
113
115
  }
114
116
  }
115
117
 
116
118
 
117
119
  class $9d59b5ce8284c3bf$export$7c6e2c02157bb7d2 extends (0, $b031bda8df4df200$export$6e2c8f0811a474ce) {
118
- constructor(page){
119
- super(page.locator(".Pane.vertical.Pane1"));
120
- this.banner = new (0, $4a9d9a80e54af555$export$3b4e64e77073e307)(page);
121
- this.leftPanel = new (0, $7c2e5bae754cf9e5$export$110709f040143804)(page);
120
+ static sectionRoot = ".app-root";
121
+ constructor(parentLocator, page){
122
+ super(parentLocator, page.locator($9d59b5ce8284c3bf$export$7c6e2c02157bb7d2.sectionRoot));
123
+ this.banner = new (0, $4a9d9a80e54af555$export$3b4e64e77073e307)(page.locator($9d59b5ce8284c3bf$export$7c6e2c02157bb7d2.sectionRoot), page);
124
+ this.leftPanel = new (0, $7c2e5bae754cf9e5$export$110709f040143804)(page.locator($9d59b5ce8284c3bf$export$7c6e2c02157bb7d2.sectionRoot), page);
122
125
  }
123
126
  }
124
127
 
@@ -131,7 +134,7 @@ class $7149ac56b8ddfcf1$export$d9b273488cd8ce6f extends (0, $b031bda8df4df200$ex
131
134
  * @param menuLinkLocator Menu link locator thats used to open/close the menu
132
135
  * @param menuItemsParentLocator Menu items that opens up when menu link is clicked
133
136
  */ constructor(menuContentRootLocator, menuLinkLocator, menuItemsParentLocator){
134
- super(menuContentRootLocator);
137
+ super($7149ac56b8ddfcf1$export$d9b273488cd8ce6f.parentLocator, menuContentRootLocator);
135
138
  this.menuLinkLocator = menuLinkLocator;
136
139
  this.menuItemsParentLocator = menuContentRootLocator.locator(menuItemsParentLocator);
137
140
  }
@@ -213,9 +216,10 @@ class $8a1acfec011ab8c3$export$5929c05a25eed48f extends (0, $7149ac56b8ddfcf1$ex
213
216
 
214
217
 
215
218
  class $f9e40ff7c3e0c582$export$ca8bffe144e51c8 extends (0, $b031bda8df4df200$export$6e2c8f0811a474ce) {
216
- constructor(page){
217
- super(page.locator(".dot-branding"));
218
- this.logo = page.getByTestId("primary-logo");
219
+ static sectionRootLocator = ".dot-branding";
220
+ constructor(parentLocator, page){
221
+ super(parentLocator, page.locator($f9e40ff7c3e0c582$export$ca8bffe144e51c8.sectionRootLocator));
222
+ this.logo = this.findElementInSection(page.getByTestId("primary-logo"));
219
223
  }
220
224
  async clickLogo() {
221
225
  await this.logo.click();
@@ -270,29 +274,37 @@ class $70698a74230ac35b$export$1d7840d5cdc861d5 extends (0, $7149ac56b8ddfcf1$ex
270
274
 
271
275
 
272
276
 
277
+
273
278
  class $0cc6e6068d8adf21$export$f7f58290278dd286 extends (0, $7149ac56b8ddfcf1$export$d9b273488cd8ce6f) {
274
279
  constructor(page){
275
- super(page.locator("#context-menu-popover"), page.getByTitle("admin"), page.locator(".dropdown-menu.multi-level.dropdown-menu-0"));
280
+ super(page.locator("#context-menu-popover"), page.getByTitle(".dot-avatar"), page.locator(".dropdown-menu.multi-level.dropdown-menu-0"));
281
+ this.page = page;
276
282
  this.userProfileLocator = page.getByRole("link", {
277
283
  name: "User profile"
278
284
  });
279
285
  this.logoutLocator = page.getByRole("link", {
280
286
  name: "Log out"
281
287
  });
288
+ this.avatarTooltip = page.locator(".avatar-wrapper>.dot-tooltip");
282
289
  }
283
290
  async clickUserProfile() {
284
291
  await this.clickMenuItem(this.userProfileLocator);
285
292
  }
286
- async Logout() {
293
+ async logout() {
287
294
  await this.clickMenuItem(this.logoutLocator);
288
295
  }
296
+ async validateAvatarName(expectedName) {
297
+ (0, $1UEKj$playwrighttest.expect)(await this.avatarTooltip.getAttribute("title")).toContain(expectedName);
298
+ }
289
299
  }
290
300
 
291
301
 
292
302
  class $ae9e523da565a5a8$export$8b251419efc915eb extends (0, $b031bda8df4df200$export$6e2c8f0811a474ce) {
293
- constructor(page){
294
- super(page.locator(".main-header-wrapper.logged-in"));
295
- this.brandLogo = new (0, $f9e40ff7c3e0c582$export$ca8bffe144e51c8)(page);
303
+ static sectionRootLocator = ".main-header-wrapper.logged-in";
304
+ constructor(parentLocator, page){
305
+ super(parentLocator, page.locator($ae9e523da565a5a8$export$8b251419efc915eb.sectionRootLocator));
306
+ this.page = page;
307
+ this.brandLogo = new (0, $f9e40ff7c3e0c582$export$ca8bffe144e51c8)(page.locator(".main-header-wrapper.logged-in"), page);
296
308
  this.helperMenu = new (0, $8a1acfec011ab8c3$export$5929c05a25eed48f)(page);
297
309
  this.settingsMenu = new (0, $70698a74230ac35b$export$1d7840d5cdc861d5)(page);
298
310
  this.avatarMenu = new (0, $0cc6e6068d8adf21$export$f7f58290278dd286)(page);
@@ -302,8 +314,47 @@ class $ae9e523da565a5a8$export$8b251419efc915eb extends (0, $b031bda8df4df200$ex
302
314
 
303
315
  class $ae23b16684112d0b$export$2b65d1d97338f32b {
304
316
  constructor(page){
305
- this.header = new (0, $ae9e523da565a5a8$export$8b251419efc915eb)(page);
306
- this.content = new (0, $9d59b5ce8284c3bf$export$7c6e2c02157bb7d2)(page);
317
+ this.header = new (0, $ae9e523da565a5a8$export$8b251419efc915eb)(page.locator(".ci-explorer"), page);
318
+ this.content = new (0, $9d59b5ce8284c3bf$export$7c6e2c02157bb7d2)(page.locator(".ci-explorer"), page);
319
+ }
320
+ }
321
+
322
+
323
+
324
+ class $50f6953b9762c03c$export$a7fed597f4b8afd8 extends (0, $b031bda8df4df200$export$6e2c8f0811a474ce) {
325
+ constructor(parentLocator, mainContentRootLocator){
326
+ super(parentLocator, mainContentRootLocator);
327
+ }
328
+ async fillTextInput(textInput, textValue) {
329
+ await textInput.clear();
330
+ await textInput.fill(textValue);
331
+ }
332
+ }
333
+
334
+
335
+ class $5ca595492af22d0d$export$56c2ba9e13461f38 extends (0, $50f6953b9762c03c$export$a7fed597f4b8afd8) {
336
+ static mainContentRootLocator = ".login-component";
337
+ constructor(parentLocator, page){
338
+ super(parentLocator, page.locator($5ca595492af22d0d$export$56c2ba9e13461f38.mainContentRootLocator));
339
+ this.page = page;
340
+ this.username = this.findElementInSection(page.getByPlaceholder("User"));
341
+ this.password = this.findElementInSection(page.getByPlaceholder("Password"));
342
+ this.loginButton = this.findElementInSection(page.getByRole("button", {
343
+ name: "Log in"
344
+ }));
345
+ this.rememberMeCheckbox = this.findElementInSection(page.locator("#rememberMeCheckbox"));
346
+ }
347
+ async enterUserName(username) {
348
+ await this.fillTextInput(this.username, username);
349
+ }
350
+ async enterPassword(password) {
351
+ await this.fillTextInput(this.password, password);
352
+ }
353
+ async clickLogin() {
354
+ await this.loginButton.click();
355
+ }
356
+ async clickRememberMe() {
357
+ await this.rememberMeCheckbox.click();
307
358
  }
308
359
  }
309
360
 
@@ -312,19 +363,15 @@ class $7dcee016eeec0e08$export$f14c0e3f98d164c0 extends (0, $ae23b16684112d0b$ex
312
363
  constructor(page){
313
364
  super(page);
314
365
  this.page = page;
315
- this.username = page.getByPlaceholder("User");
316
- this.password = page.getByPlaceholder("Password");
317
- this.loginButton = page.getByRole("button", {
318
- name: "Log in"
319
- });
320
- this.rememberMeCheckbox = page.locator("#rememberMeCheckbox");
366
+ this.loginForm = new (0, $5ca595492af22d0d$export$56c2ba9e13461f38)(page.locator(".login-layout"), page);
321
367
  }
322
368
  async login(user, pwd) {
323
369
  await this.page.goto("/#/login");
324
- await this.username.fill(user);
325
- await this.password.fill(pwd);
326
- await this.loginButton.click();
370
+ await this.loginForm.enterUserName(user);
371
+ await this.loginForm.enterPassword(pwd);
372
+ await this.loginForm.clickLogin();
327
373
  await this.page.locator(".main-layout").waitFor();
374
+ await this.header.avatarMenu.validateAvatarName(user);
328
375
  }
329
376
  }
330
377
 
@@ -338,8 +385,7 @@ class $dcea22adf7bc9211$export$7db63d2c950874b5 {
338
385
  /**
339
386
  * Create New directory under applications CI.
340
387
  * @param appDirectoryName
341
- * @param expectedCiType
342
- */ async createNewApplicationDirectory(appDirectoryName, expectedCiType) {
388
+ */ async createNewApplicationDirectory(appDirectoryName) {
343
389
  await this.applicationPage.contextMenu.clickApplicationCi();
344
390
  await this.applicationPage.contextMenu.clickMenuPath([
345
391
  "new",
@@ -348,14 +394,13 @@ class $dcea22adf7bc9211$export$7db63d2c950874b5 {
348
394
  await this.applicationPage.form.assertSaveButtonIsDisabled();
349
395
  await this.applicationPage.form.assertSaveAndCloseButtonIsDisabled();
350
396
  await this.applicationPage.form.enterName(appDirectoryName);
351
- await this.applicationPage.tab.assertActiveTabSelector("Create " + expectedCiType);
397
+ await this.applicationPage.tab.assertActiveTabSelector("Create core.directory");
352
398
  await this.applicationPage.form.clickSaveAndClose();
353
399
  }
354
400
  /**
355
401
  * Create new application under Application ci
356
402
  * @param appName
357
- * @param expectedCiType
358
- */ async createNewApplication(appName, expectedCiType) {
403
+ */ async createNewApplication(appName) {
359
404
  await this.applicationPage.contextMenu.clickApplicationCi();
360
405
  await this.applicationPage.contextMenu.clickMenuPath([
361
406
  "new",
@@ -365,7 +410,7 @@ class $dcea22adf7bc9211$export$7db63d2c950874b5 {
365
410
  await this.applicationPage.form.assertSaveAndCloseButtonIsDisabled();
366
411
  await this.applicationPage.form.enterName(appName);
367
412
  await this.applicationPage.form.clickSaveAndClose();
368
- await this.applicationPage.tab.assertActiveTabSelector("Create " + expectedCiType);
413
+ await this.applicationPage.tab.assertActiveTabSelector("Create udm.application");
369
414
  }
370
415
  /**
371
416
  * TODO: It is half done just to check on menu path other than new. Need to create as per scenario.
@@ -386,17 +431,44 @@ class $0a8f56f4ec9e6ec3$export$3e41faf802a29e71 extends (0, $ae23b16684112d0b$ex
386
431
  super(page);
387
432
  this.page = page;
388
433
  this.parentTabLocator = this.page.locator(".working-panel-section .xl-react-tab-system");
389
- this.getTabTitleLocator = this.page.locator("li.active .tab-title");
434
+ this.getTabTitleLocator = this.parentTabLocator.locator("li.active .tab-title");
390
435
  this.closeIcon = this.page.locator(".xl-icon.close-ico");
436
+ this.tabSelector = this.parentTabLocator.locator(".tab-pane");
437
+ this.tabTitle = this.parentTabLocator.locator(".tab-title");
391
438
  }
392
- async assertActiveTabSelector(expectedCiType) {
393
- return await (0, $1UEKj$playwrighttest.expect)(this.parentTabLocator.locator("li.active .tab-title")).toHaveText(expectedCiType, {
439
+ /**
440
+ * Assert active tab title with expected value.
441
+ * @param expectedCiType
442
+ * @returns
443
+ */ async assertActiveTabSelector(expectedCiType) {
444
+ return await (0, $1UEKj$playwrighttest.expect)(this.getTabTitleLocator).toHaveText(expectedCiType, {
394
445
  ignoreCase: true
395
446
  });
396
447
  }
397
- async closeActiveTabs() {
448
+ /**
449
+ * Close the active tab by clicking close button
450
+ */ async closeActiveTabs() {
398
451
  if (await this.closeIcon.isVisible()) await this.parentTabLocator.locator(".nav .active .close-icon").click();
399
452
  }
453
+ /**
454
+ * Verify there is no tabs are opened.
455
+ */ async noTabsOpened() {
456
+ await (0, $1UEKj$playwrighttest.expect)(this.tabSelector).not.toBeVisible();
457
+ }
458
+ /**
459
+ * Expect the given tab title is present in tab opened
460
+ * @param tabTitle
461
+ * @returns
462
+ */ async expectTabOpened(tabTitle) {
463
+ return await (0, $1UEKj$playwrighttest.expect)(this.tabTitle).toHaveText(tabTitle);
464
+ }
465
+ /**
466
+ * Expect the given tab title is not present in tab opened
467
+ * @param tabTitle
468
+ * @returns
469
+ */ async expectTabNotOpened(tabTitle) {
470
+ return await (0, $1UEKj$playwrighttest.expect)(this.tabTitle).not.toHaveText(tabTitle);
471
+ }
400
472
  }
401
473
 
402
474
 
@@ -436,20 +508,9 @@ class $9dd8dd888e812fd7$export$133beb65adbc45a3 extends (0, $7149ac56b8ddfcf1$ex
436
508
 
437
509
 
438
510
 
439
- class $50f6953b9762c03c$export$a7fed597f4b8afd8 extends (0, $b031bda8df4df200$export$6e2c8f0811a474ce) {
440
- constructor(mainContentRootLocator){
441
- super(mainContentRootLocator);
442
- }
443
- async fillTextInput(textInput, textValue) {
444
- await textInput.clear();
445
- await textInput.fill(textValue);
446
- }
447
- }
448
-
449
-
450
511
  class $f0e8ecb73642aac7$export$13ee474454c1948e extends (0, $50f6953b9762c03c$export$a7fed597f4b8afd8) {
451
- constructor(page){
452
- super(page.locator(".dip-view-body"));
512
+ constructor(parentLocator, page){
513
+ super(parentLocator, page.locator(".dip-view-body"));
453
514
  this.page = page;
454
515
  this.inputName = page.locator('input[name="name"]');
455
516
  this.inputLatestVersion = page.locator('input[name="lastVersion"]');
@@ -467,6 +528,8 @@ class $f0e8ecb73642aac7$export$13ee474454c1948e extends (0, $50f6953b9762c03c$ex
467
528
  });
468
529
  this.errorMessage = page.locator(".error");
469
530
  this.formSection = page.locator(".xl-react-components.xl-react-dip-dynamic-form");
531
+ this.refreshButton = page.locator("i.refresh");
532
+ this.inputRename = page.locator(".infinite-tree-rename-input");
470
533
  }
471
534
  /**
472
535
  * Enter name in name field of the application form
@@ -535,8 +598,8 @@ class $f0e8ecb73642aac7$export$13ee474454c1948e extends (0, $50f6953b9762c03c$ex
535
598
 
536
599
 
537
600
  class $749097e2d65c1527$export$2b77a92f1a5ad772 extends (0, $b031bda8df4df200$export$6e2c8f0811a474ce) {
538
- constructor(page){
539
- super(page.locator(".xl-react-modal-content"));
601
+ constructor(parentLocator, page){
602
+ super(parentLocator, page.locator(".xl-react-modal-content"));
540
603
  this.header = page.locator(".modal-header");
541
604
  this.body = page.locator(".modal-body");
542
605
  this.footer = page.locator(".modal-footer");
@@ -545,8 +608,8 @@ class $749097e2d65c1527$export$2b77a92f1a5ad772 extends (0, $b031bda8df4df200$ex
545
608
 
546
609
 
547
610
  class $1b7c532a5b0861f3$export$bd6452a745ffdb18 extends (0, $749097e2d65c1527$export$2b77a92f1a5ad772) {
548
- constructor(page){
549
- super(page);
611
+ constructor(parentLocator, page){
612
+ super(parentLocator, page);
550
613
  this.deleteButton = page.getByRole("button", {
551
614
  name: "Delete",
552
615
  exact: true
@@ -555,6 +618,10 @@ class $1b7c532a5b0861f3$export$bd6452a745ffdb18 extends (0, $749097e2d65c1527$ex
555
618
  name: "Cancel",
556
619
  exact: true
557
620
  });
621
+ this.moveButton = page.getByRole("button", {
622
+ name: "Move",
623
+ exact: true
624
+ });
558
625
  }
559
626
  async clickDelete() {
560
627
  await this.footer.locator(this.deleteButton).click();
@@ -562,6 +629,9 @@ class $1b7c532a5b0861f3$export$bd6452a745ffdb18 extends (0, $749097e2d65c1527$ex
562
629
  async clickCancel() {
563
630
  await this.footer.locator(this.cancelButton).click();
564
631
  }
632
+ async clickMove() {
633
+ await this.footer.locator(this.moveButton).click();
634
+ }
565
635
  }
566
636
 
567
637
 
@@ -570,13 +640,14 @@ class $1b7c532a5b0861f3$export$bd6452a745ffdb18 extends (0, $749097e2d65c1527$ex
570
640
 
571
641
 
572
642
 
643
+
573
644
  class $26b4a6e9a3909559$export$5a20f96f6e2d29e9 {
574
645
  constructor(page){
575
646
  this.page = page;
576
647
  this.contextMenu = new (0, $9dd8dd888e812fd7$export$133beb65adbc45a3)(page);
577
648
  this.tab = new (0, $0a8f56f4ec9e6ec3$export$3e41faf802a29e71)(page);
578
- this.form = new (0, $f0e8ecb73642aac7$export$13ee474454c1948e)(page);
579
- this.modal = new (0, $1b7c532a5b0861f3$export$bd6452a745ffdb18)(page);
649
+ this.form = new (0, $f0e8ecb73642aac7$export$13ee474454c1948e)(page.locator(".Pane.vertical.Pane2"), page);
650
+ this.modal = new (0, $1b7c532a5b0861f3$export$bd6452a745ffdb18)(page.locator(".xl-react-modal-open"), page);
580
651
  }
581
652
  /**
582
653
  * Create new ci under any explorer package by providing following parameters.
@@ -599,16 +670,20 @@ class $26b4a6e9a3909559$export$5a20f96f6e2d29e9 {
599
670
  * Expand the ci path tree toggler.
600
671
  * @param pathnode
601
672
  */ async expandNode(pathnode) {
602
- 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();
673
+ const nodeLocator = await this.page.locator('div[data-id="' + pathnode + '"] a.infinite-tree-toggler.infinite-tree-closed').isVisible();
674
+ if (nodeLocator) await this.page.locator('div[data-id="' + pathnode + '"] a.infinite-tree-toggler.infinite-tree-closed').click();
603
675
  }
604
676
  /**
605
677
  * expands the path of CI by separating path from "/"
606
678
  * @param parentNodeId
607
679
  */ async expandNodePath(parentNodeId) {
608
- const nodeIdParts = $1UEKj$rambda.split("/", parentNodeId);
609
- for(let ind = 0; ind < nodeIdParts.length; ind += 1){
610
- const path = $1UEKj$rambda.join("/", $1UEKj$rambda.take(ind + 1, nodeIdParts));
611
- this.expandNode(path);
680
+ const ci = await this.page.isVisible('div[data-id="' + parentNodeId + '"]');
681
+ if (!ci) {
682
+ const nodeIdParts = $1UEKj$rambda.split("/", parentNodeId);
683
+ for(let ind = 0; ind < nodeIdParts.length; ind++){
684
+ const path = $1UEKj$rambda.join("/", $1UEKj$rambda.take(ind + 1, nodeIdParts));
685
+ await this.expandNode(path);
686
+ }
612
687
  }
613
688
  }
614
689
  /**
@@ -621,7 +696,12 @@ class $26b4a6e9a3909559$export$5a20f96f6e2d29e9 {
621
696
  * Delete the ci
622
697
  * @param node
623
698
  */ async deleteCi(node) {
624
- await this.page.locator('div[data-id="' + node + '"]').click();
699
+ const cipath = this.page.locator('div[data-id="' + node + '"]');
700
+ if (await cipath.isVisible()) await this.page.locator('div[data-id="' + node + '"]').click();
701
+ else {
702
+ await this.expandNodePath(node);
703
+ await this.page.locator('div[data-id="' + node + '"]').click();
704
+ }
625
705
  await this.page.locator('i[data-id="' + node + '"].context-menu-button').click();
626
706
  await this.contextMenu.clickMenuPath([
627
707
  "delete"
@@ -649,14 +729,107 @@ class $26b4a6e9a3909559$export$5a20f96f6e2d29e9 {
649
729
  await this.form.assertSaveAndCloseButtonIsDisabled();
650
730
  await this.tab.assertActiveTabSelector("Create " + expectedCiType + "");
651
731
  }
732
+ /**
733
+ * Duplicate the CI node in explorer using context-menu
734
+ * @param nodeId
735
+ */ async duplicate(nodeId) {
736
+ await this.expandNodePath(nodeId);
737
+ await this.page.locator('div[data-id="' + nodeId + '"]').click();
738
+ await this.page.locator('i[data-id="' + nodeId + '"].context-menu-button').click();
739
+ await this.contextMenu.clickMenuPath([
740
+ "duplicate"
741
+ ]);
742
+ }
743
+ /**
744
+ * Validate the given node ID is visible in the page
745
+ * @param nodeId
746
+ */ async validateNodeExists(nodeId) {
747
+ await (0, $1UEKj$playwrighttest.expect)(this.page.locator('div[data-id="' + nodeId + '"]')).toBeVisible();
748
+ }
749
+ /**
750
+ * Validate the given node does not exists in the list.
751
+ * @param nodeId
752
+ */ async validateNodeDoesNotExists(nodeId) {
753
+ await (0, $1UEKj$playwrighttest.expect)(this.page.locator('div[data-id="' + nodeId + '"]')).not.toBeVisible();
754
+ }
755
+ /**
756
+ * Rename the node Id with new string in CI.
757
+ * @param nodeId
758
+ * @param renamedValue
759
+ */ async inlineRename(nodeId, renamedValue) {
760
+ await this.expandNodePath(nodeId);
761
+ await this.page.locator('div[data-id="' + nodeId + '"]').click();
762
+ await this.page.locator('i[data-id="' + nodeId + '"].context-menu-button').click();
763
+ await this.contextMenu.clickMenuPath([
764
+ "rename"
765
+ ]);
766
+ await this.form.inputRename.waitFor();
767
+ await this.form.inputRename.fill(renamedValue);
768
+ await this.form.refreshButton.click();
769
+ await (0, $1UEKj$playwrighttest.expect)(this.page.locator('div[data-id="' + nodeId + '"]')).not.toBeVisible();
770
+ }
771
+ /**
772
+ * Open CI from explorer
773
+ * @param nodeId
774
+ */ async openCi(nodeId) {
775
+ if (await this.page.locator('.infinite-tree-item[data-id="' + nodeId + '"]').isVisible()) await this.page.locator('.infinite-tree-item[data-id="' + nodeId + '"]').dblclick();
776
+ else {
777
+ await this.expandNodePath(nodeId);
778
+ await this.page.waitForSelector('.infinite-tree-item[data-id="' + nodeId + '"]');
779
+ await this.page.locator('.infinite-tree-item[data-id="' + nodeId + '"]').dblclick();
780
+ }
781
+ }
782
+ /**
783
+ * Select the CI which need to get deleted.
784
+ * @param nodeId
785
+ */ async selectDeleteCi(nodeId) {
786
+ const cipath = this.page.locator('div[data-id="' + nodeId + '"]');
787
+ if (await cipath.isVisible()) await this.page.locator('div[data-id="' + nodeId + '"]').click();
788
+ else {
789
+ await this.expandNodePath(nodeId);
790
+ await this.page.locator('div[data-id="' + nodeId + '"]').click();
791
+ }
792
+ await this.page.locator('i[data-id="' + nodeId + '"].context-menu-button').click();
793
+ await this.contextMenu.clickMenuPath([
794
+ "delete"
795
+ ]);
796
+ }
797
+ /**
798
+ * Click cancel button on modal window to cancel deletion.
799
+ */ async clickCancelAndWait() {
800
+ await this.modal.clickCancel();
801
+ }
802
+ /**
803
+ * Click Delete button on modal window to delete the CI
804
+ */ async clickConfirmAndWait() {
805
+ await this.modal.clickDelete();
806
+ }
807
+ /**
808
+ * Move ci
809
+ * @param source_path
810
+ * @param target_path
811
+ */ async moveCi(source_path, target_path) {
812
+ const source_cipath = this.page.locator('div[data-id="' + source_path + '"]');
813
+ const target_cipath = this.page.locator('div[data-id="' + target_path + '"]');
814
+ await this.expandNodePath(source_path);
815
+ //TODO: Find a better way to make sure target can be expanded without error, current implementation is workaround
816
+ await this.page.locator('div[data-id="' + target_path + '"]').textContent();
817
+ await this.expandNodePath(target_path);
818
+ await source_cipath.dragTo(target_cipath);
819
+ }
820
+ /**
821
+ * Click Move button on modal window to Move the CIs
822
+ */ async clickMoveAndWait() {
823
+ await this.modal.clickMove();
824
+ }
652
825
  }
653
826
 
654
827
 
655
828
 
656
829
 
657
830
  class $b90c33a29683027b$export$60413e28724d3abd extends (0, $50f6953b9762c03c$export$a7fed597f4b8afd8) {
658
- constructor(page){
659
- super(page.locator(".dip-view-body"));
831
+ constructor(parentLocator, page){
832
+ super(parentLocator, page.locator(".dip-view-body"));
660
833
  this.page = page;
661
834
  this.inputName = page.locator('input[name="name"]');
662
835
  this.inputLatestVersion = page.locator('input[name="lastVersion"]');
@@ -673,6 +846,7 @@ class $b90c33a29683027b$export$60413e28724d3abd extends (0, $50f6953b9762c03c$ex
673
846
  exact: true
674
847
  });
675
848
  this.formSection = page.locator(".xl-react-components.xl-react-dip-dynamic-form");
849
+ this.addButton = page.locator(".xl-btn-add");
676
850
  }
677
851
  /**
678
852
  * Enter name in name field of the application form
@@ -718,6 +892,29 @@ class $b90c33a29683027b$export$60413e28724d3abd extends (0, $50f6953b9762c03c$ex
718
892
  */ async assertSaveAndCloseButtonIsDisabled() {
719
893
  return await (0, $1UEKj$playwrighttest.expect)(this.findElementInSection(this.saveAndCloseButton)).toBeDisabled();
720
894
  }
895
+ /**
896
+ * Enter Field Values using its label value around application forms
897
+ * @param fieldName
898
+ * @param expectedValue
899
+ * @returns
900
+ */ async addFieldValue(fieldName, expectedValue) {
901
+ const label = this.formSection.locator('//label[text()="' + fieldName + '"]/parent::div/parent::div');
902
+ const input = label.locator(".xl-react-components-input input");
903
+ await input.fill(expectedValue);
904
+ await input.press("Enter");
905
+ const result = await input.getAttribute("value");
906
+ return (0, $1UEKj$playwrighttest.expect)(result).toEqual(expectedValue);
907
+ }
908
+ async addOrchestrator(fieldValue) {
909
+ const label = this.formSection.locator('//label[text()="Orchestrator"]/parent::div/parent::div');
910
+ const input = label.locator(".xl-react-components-input input");
911
+ await input.fill(fieldValue);
912
+ await this.addButton.click();
913
+ await this.saveButton.waitFor();
914
+ await this.saveButton.click();
915
+ const result = await this.page.locator("span.text-container").getAttribute("title");
916
+ return (0, $1UEKj$playwrighttest.expect)(result).toEqual(fieldValue);
917
+ }
721
918
  }
722
919
 
723
920
 
@@ -725,12 +922,12 @@ class $1fae0b7de3d21f52$export$bf4a5dd3be690f6b extends (0, $ae23b16684112d0b$ex
725
922
  constructor(page){
726
923
  super(page);
727
924
  this.contextMenu = new (0, $9dd8dd888e812fd7$export$133beb65adbc45a3)(page);
728
- this.form = new (0, $f0e8ecb73642aac7$export$13ee474454c1948e)(page);
925
+ this.form = new (0, $f0e8ecb73642aac7$export$13ee474454c1948e)(page.locator(".Pane.vertical.Pane2"), page);
729
926
  this.tab = new (0, $0a8f56f4ec9e6ec3$export$3e41faf802a29e71)(page);
730
927
  this.util = new (0, $dcea22adf7bc9211$export$7db63d2c950874b5)(this, page);
731
- this.modal = new (0, $1b7c532a5b0861f3$export$bd6452a745ffdb18)(page);
928
+ this.modal = new (0, $1b7c532a5b0861f3$export$bd6452a745ffdb18)(page.locator(".xl-react-modal-open"), page);
732
929
  this.commonUtil = new (0, $26b4a6e9a3909559$export$5a20f96f6e2d29e9)(page);
733
- this.appForm = new (0, $b90c33a29683027b$export$60413e28724d3abd)(page);
930
+ this.appForm = new (0, $b90c33a29683027b$export$60413e28724d3abd)(page.locator(".Pane.vertical.Pane2"), page);
734
931
  }
735
932
  }
736
933
 
@@ -754,8 +951,8 @@ class $114862ed97d76403$export$36d69433c4f81145 extends (0, $ae23b16684112d0b$ex
754
951
 
755
952
 
756
953
  class $465c25c02ae34e1f$export$855563f8bdb36207 extends (0, $50f6953b9762c03c$export$a7fed597f4b8afd8) {
757
- constructor(page){
758
- super(page.locator(".dip-view-body"));
954
+ constructor(parentLocator, page){
955
+ super(parentLocator, page.locator(".dip-view-body"));
759
956
  this.page = page;
760
957
  this.inputName = page.locator('input[name="name"]');
761
958
  this.inputLatestVersion = page.locator('input[name="lastVersion"]');
@@ -888,11 +1085,11 @@ class $0b66c9d41a4ba704$export$8ef81de2d4ebb0b9 extends (0, $ae23b16684112d0b$ex
888
1085
  constructor(page){
889
1086
  super(page);
890
1087
  this.contextMenu = new (0, $9dd8dd888e812fd7$export$133beb65adbc45a3)(page);
891
- this.form = new (0, $f0e8ecb73642aac7$export$13ee474454c1948e)(page);
1088
+ this.form = new (0, $f0e8ecb73642aac7$export$13ee474454c1948e)(page.locator(".Pane.vertical.Pane2"), page);
892
1089
  this.tab = new (0, $0a8f56f4ec9e6ec3$export$3e41faf802a29e71)(page);
893
- this.modal = new (0, $1b7c532a5b0861f3$export$bd6452a745ffdb18)(page);
1090
+ this.modal = new (0, $1b7c532a5b0861f3$export$bd6452a745ffdb18)(page.locator(".xl-react-modal-open"), page);
894
1091
  this.commonUtil = new (0, $26b4a6e9a3909559$export$5a20f96f6e2d29e9)(page);
895
- this.configForm = new (0, $465c25c02ae34e1f$export$855563f8bdb36207)(page);
1092
+ this.configForm = new (0, $465c25c02ae34e1f$export$855563f8bdb36207)(page.locator(".Pane.vertical.Pane2"), page);
896
1093
  this.util = new (0, $168ec5e952b92f0d$export$ad55ec59bf82c4fc)(this, page);
897
1094
  }
898
1095
  }
@@ -907,8 +1104,8 @@ class $0b66c9d41a4ba704$export$8ef81de2d4ebb0b9 extends (0, $ae23b16684112d0b$ex
907
1104
 
908
1105
 
909
1106
  class $fef9a424af55e937$export$21cde1e6a73cf500 extends (0, $50f6953b9762c03c$export$a7fed597f4b8afd8) {
910
- constructor(page){
911
- super(page.locator(".dip-view-body"));
1107
+ constructor(parentLocator, page){
1108
+ super(parentLocator, page.locator(".dip-view-body"));
912
1109
  this.page = page;
913
1110
  this.formSection = page.locator(".xl-react-components.xl-react-dip-dynamic-form");
914
1111
  this.inputName = page.locator('input[name="name"]');
@@ -1002,11 +1199,11 @@ class $6d811907766c6ed0$export$2c95c5c5be4fb9b0 extends (0, $ae23b16684112d0b$ex
1002
1199
  constructor(page){
1003
1200
  super(page);
1004
1201
  this.contextMenu = new (0, $9dd8dd888e812fd7$export$133beb65adbc45a3)(page);
1005
- this.form = new (0, $f0e8ecb73642aac7$export$13ee474454c1948e)(page);
1202
+ this.form = new (0, $f0e8ecb73642aac7$export$13ee474454c1948e)(page.locator(".Pane.vertical.Pane2"), page);
1006
1203
  this.tab = new (0, $0a8f56f4ec9e6ec3$export$3e41faf802a29e71)(page);
1007
- this.modal = new (0, $1b7c532a5b0861f3$export$bd6452a745ffdb18)(page);
1204
+ this.modal = new (0, $1b7c532a5b0861f3$export$bd6452a745ffdb18)(page.locator(".xl-react-modal-open"), page);
1008
1205
  this.commonUtil = new (0, $26b4a6e9a3909559$export$5a20f96f6e2d29e9)(page);
1009
- this.envForm = new (0, $fef9a424af55e937$export$21cde1e6a73cf500)(page);
1206
+ this.envForm = new (0, $fef9a424af55e937$export$21cde1e6a73cf500)(page.locator(".xl-react-modal-open"), page);
1010
1207
  this.util = new (0, $46c3ae45662ff7ad$export$b8a8d62f66d27fa1)(this, page);
1011
1208
  }
1012
1209
  }
@@ -1022,9 +1219,9 @@ class $2176608eec52f17d$export$1f6beddb119e759b extends (0, $ae23b16684112d0b$ex
1022
1219
  constructor(page){
1023
1220
  super(page);
1024
1221
  this.contextMenu = new (0, $9dd8dd888e812fd7$export$133beb65adbc45a3)(page);
1025
- this.form = new (0, $f0e8ecb73642aac7$export$13ee474454c1948e)(page);
1222
+ this.form = new (0, $f0e8ecb73642aac7$export$13ee474454c1948e)(page.locator(".Pane.vertical.Pane2"), page);
1026
1223
  this.tab = new (0, $0a8f56f4ec9e6ec3$export$3e41faf802a29e71)(page);
1027
- this.modal = new (0, $1b7c532a5b0861f3$export$bd6452a745ffdb18)(page);
1224
+ this.modal = new (0, $1b7c532a5b0861f3$export$bd6452a745ffdb18)(page.locator(".xl-react-modal-open"), page);
1028
1225
  this.commonUtil = new (0, $26b4a6e9a3909559$export$5a20f96f6e2d29e9)(page);
1029
1226
  }
1030
1227
  }