@digital-ai/devops-page-object-release 0.0.84 → 0.0.86

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
@@ -204,7 +204,7 @@ class $b34a21212642e54d$export$7034f81075184002 extends (0, $9626bc9256ce31f7$ex
204
204
  return this;
205
205
  }
206
206
  async clearAllFilters() {
207
- await this.page.locator(`${this.getHeaderSelector()} .release-list-filter-row button[data-testid="clear-all-btn"]`).click();
207
+ await this.page.locator(`${this.getHeaderSelector()} .filter-row button[data-testid="clear-all-btn"]`).click();
208
208
  return this;
209
209
  }
210
210
  async clearAllStatusFilters() {
@@ -2932,6 +2932,97 @@ class $96c6280ff1c47b81$export$3bc3e140e0dcb075 extends (0, $9626bc9256ce31f7$ex
2932
2932
  hasText: userName
2933
2933
  })).toBeVisible();
2934
2934
  }
2935
+ async openSubPage(subpage) {
2936
+ await this.page.locator("ul.side-nav li", {
2937
+ hasText: subpage
2938
+ }).click();
2939
+ }
2940
+ async expectMembersToHavePermission(permission, ...roles) {
2941
+ const row = this.page.locator("tr", {
2942
+ has: this.page.locator("td", {
2943
+ hasText: permission
2944
+ })
2945
+ });
2946
+ for (const roleName of roles){
2947
+ const roleLocator = row.locator("li.tag", {
2948
+ hasText: roleName
2949
+ });
2950
+ await (0, $hOLA6$expect)(roleLocator.first(), `Expected role "${roleName}" for permission "${permission}"`).toBeVisible();
2951
+ }
2952
+ }
2953
+ async expectMembersNotToHavePermission(permission, ...roles) {
2954
+ const row = this.page.locator("tr", {
2955
+ has: this.page.locator("td", {
2956
+ hasText: permission
2957
+ })
2958
+ });
2959
+ for (const roleName of roles){
2960
+ const roleLocator = row.locator("li.tag", {
2961
+ hasText: roleName
2962
+ });
2963
+ await (0, $hOLA6$expect)(roleLocator.first(), `Expected role "${roleName}" for permission "${permission}"`).not.toBeVisible();
2964
+ }
2965
+ }
2966
+ async save() {
2967
+ const saveButton = this.page.getByRole("button", {
2968
+ name: "Save",
2969
+ exact: true
2970
+ });
2971
+ await saveButton.click();
2972
+ }
2973
+ async grantPermissionToRoles(permission, ...roles) {
2974
+ const row = this.page.locator("tr", {
2975
+ has: this.page.locator("td", {
2976
+ hasText: permission
2977
+ })
2978
+ });
2979
+ for (const roleName of roles){
2980
+ const roleLocator = row.locator('input[placeholder="Add..."]');
2981
+ await roleLocator.first().click();
2982
+ await roleLocator.fill(roleName);
2983
+ await roleLocator.press("Enter");
2984
+ await (0, $hOLA6$expect)(roleLocator.first(), `Expected role "${roleName}" for permission "${permission}"`).toBeVisible();
2985
+ }
2986
+ }
2987
+ async revokeMembersPermission(permission, ...roles) {
2988
+ const row = this.page.locator("tr", {
2989
+ has: this.page.locator("td", {
2990
+ hasText: permission
2991
+ })
2992
+ });
2993
+ for (const roleName of roles){
2994
+ const roleLocator = row.locator("li.tag", {
2995
+ hasText: roleName
2996
+ });
2997
+ const closeBtn = roleLocator.locator("a.tag-close, .tag-close, a > .xl-icon.close-icon, i.xl-icon.close-icon").first();
2998
+ await (0, $hOLA6$expect)(closeBtn, `Expected close button for role "${roleName}" to be visible`).toBeVisible();
2999
+ await closeBtn.click();
3000
+ await (0, $hOLA6$expect)(roleLocator.first(), `Expected role "${roleName}" for permission "${permission}"`).not.toBeVisible();
3001
+ }
3002
+ }
3003
+ async expectResetIsEnabled(expected) {
3004
+ const resetButton = this.page.getByRole("button", {
3005
+ name: "Reset"
3006
+ });
3007
+ if (expected) await (0, $hOLA6$expect)(resetButton).toBeEnabled();
3008
+ else await (0, $hOLA6$expect)(resetButton).toBeDisabled();
3009
+ }
3010
+ async expectPermissionsTableCount(locatorName) {
3011
+ const table = this.page.locator(locatorName);
3012
+ await (0, $hOLA6$expect)(table).toHaveCount(1);
3013
+ }
3014
+ async openEditor() {
3015
+ await this.openSubPage("Flow");
3016
+ return this;
3017
+ }
3018
+ async reset() {
3019
+ const resetButton = this.page.getByRole("button", {
3020
+ name: "Reset",
3021
+ exact: true
3022
+ });
3023
+ await resetButton.click();
3024
+ return this;
3025
+ }
2935
3026
  }
2936
3027
 
2937
3028
 
@@ -3533,92 +3624,6 @@ class $43cbcdfccb6c2a76$export$f43492e8ac3c566 extends (0, $9626bc9256ce31f7$exp
3533
3624
  await this.util.openSideNavMenu("Teams & Permissions");
3534
3625
  await (0, $hOLA6$expect)(this.page.getByLabel("breadcrumb").getByText("Teams & Permissions")).toBeVisible();
3535
3626
  }
3536
- async expectMembersToHavePermission(permission, ...roles) {
3537
- const row = this.page.locator("tr", {
3538
- has: this.page.locator("td", {
3539
- hasText: permission
3540
- })
3541
- });
3542
- for (const roleName of roles){
3543
- const roleLocator = row.locator("li.tag", {
3544
- hasText: roleName
3545
- });
3546
- await (0, $hOLA6$expect)(roleLocator.first(), `Expected role "${roleName}" for permission "${permission}"`).toBeVisible();
3547
- }
3548
- }
3549
- async expectMembersNotToHavePermission(permission, ...roles) {
3550
- const row = this.page.locator("tr", {
3551
- has: this.page.locator("td", {
3552
- hasText: permission
3553
- })
3554
- });
3555
- for (const roleName of roles){
3556
- const roleLocator = row.locator("li.tag", {
3557
- hasText: roleName
3558
- });
3559
- await (0, $hOLA6$expect)(roleLocator.first(), `Expected role "${roleName}" for permission "${permission}"`).not.toBeVisible();
3560
- }
3561
- }
3562
- async save() {
3563
- const saveButton = this.page.getByRole("button", {
3564
- name: "Save",
3565
- exact: true
3566
- });
3567
- await saveButton.click();
3568
- }
3569
- async grantPermissionToRoles(permission, ...roles) {
3570
- const row = this.page.locator("tr", {
3571
- has: this.page.locator("td", {
3572
- hasText: permission
3573
- })
3574
- });
3575
- for (const roleName of roles){
3576
- const roleLocator = row.locator('input[placeholder="Add..."]');
3577
- await roleLocator.first().click();
3578
- await roleLocator.fill(roleName);
3579
- await roleLocator.press("Enter");
3580
- await (0, $hOLA6$expect)(roleLocator.first(), `Expected role "${roleName}" for permission "${permission}"`).toBeVisible();
3581
- }
3582
- }
3583
- async revokeMembersPermission(permission, ...roles) {
3584
- const row = this.page.locator("tr", {
3585
- has: this.page.locator("td", {
3586
- hasText: permission
3587
- })
3588
- });
3589
- for (const roleName of roles){
3590
- const roleLocator = row.locator("li.tag", {
3591
- hasText: roleName
3592
- });
3593
- const closeBtn = roleLocator.locator("a.tag-close, .tag-close, a > .xl-icon.close-icon, i.xl-icon.close-icon").first();
3594
- await (0, $hOLA6$expect)(closeBtn, `Expected close button for role "${roleName}" to be visible`).toBeVisible();
3595
- await closeBtn.click();
3596
- await (0, $hOLA6$expect)(roleLocator.first(), `Expected role "${roleName}" for permission "${permission}"`).not.toBeVisible();
3597
- }
3598
- }
3599
- async expectResetIsEnabled(expected) {
3600
- const resetButton = this.page.getByRole("button", {
3601
- name: "Reset"
3602
- });
3603
- if (expected) await (0, $hOLA6$expect)(resetButton).toBeEnabled();
3604
- else await (0, $hOLA6$expect)(resetButton).toBeDisabled();
3605
- }
3606
- async expectPermissionsTableCount(locatorName) {
3607
- const table = this.page.locator(locatorName);
3608
- await (0, $hOLA6$expect)(table).toHaveCount(1);
3609
- }
3610
- async openEditor() {
3611
- await this.openSubPage("Flow");
3612
- return this;
3613
- }
3614
- async reset() {
3615
- const resetButton = this.page.getByRole("button", {
3616
- name: "Reset",
3617
- exact: true
3618
- });
3619
- await resetButton.click();
3620
- return this;
3621
- }
3622
3627
  async openDashboard() {
3623
3628
  await this.util.openSideNavMenu("Dashboard");
3624
3629
  await (0, $hOLA6$expect)(this.page.getByLabel("breadcrumb").getByText("Dashboard")).toBeVisible();
@@ -7532,8 +7537,8 @@ class $171d52b372748c0b$export$7e1d435fa474ee21 extends (0, $9626bc9256ce31f7$ex
7532
7537
  await this.page.goto(url);
7533
7538
  }
7534
7539
  async searchBy(criteria) {
7535
- await this.page.locator(".searchFilter").clear();
7536
- await this.page.locator(".searchFilter").fill(criteria);
7540
+ await this.page.locator("input#title-filter").clear();
7541
+ await this.page.locator("input#title-filter").fill(criteria);
7537
7542
  }
7538
7543
  async copy(originTitle, targetTitle) {
7539
7544
  await this.page.locator(".title").filter({
@@ -7660,15 +7665,7 @@ class $171d52b372748c0b$export$7e1d435fa474ee21 extends (0, $9626bc9256ce31f7$ex
7660
7665
  await (0, $hOLA6$expect)(this.page.getByLabel("breadcrumb").getByText("Flow")).toBeVisible();
7661
7666
  }
7662
7667
  async filterByTitle(templateName) {
7663
- await this.page.getByPlaceholder("Filter by title...", {
7664
- exact: true
7665
- }).click();
7666
- await this.page.getByPlaceholder("Filter by title...", {
7667
- exact: true
7668
- }).fill(templateName);
7669
- await this.page.getByPlaceholder("Filter by title...", {
7670
- exact: true
7671
- }).press("Enter");
7668
+ await this.searchBy(templateName);
7672
7669
  }
7673
7670
  }
7674
7671