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

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
@@ -3343,7 +3343,6 @@ class $43cbcdfccb6c2a76$export$f43492e8ac3c566 extends (0, $9626bc9256ce31f7$exp
3343
3343
  }
3344
3344
  async refresh() {
3345
3345
  await this.page.reload();
3346
- await this.page.waitForSelector("#release");
3347
3346
  }
3348
3347
  async start() {
3349
3348
  await this.page.getByTestId("start-btn").click();
@@ -3534,6 +3533,92 @@ class $43cbcdfccb6c2a76$export$f43492e8ac3c566 extends (0, $9626bc9256ce31f7$exp
3534
3533
  await this.util.openSideNavMenu("Teams & Permissions");
3535
3534
  await (0, $hOLA6$expect)(this.page.getByLabel("breadcrumb").getByText("Teams & Permissions")).toBeVisible();
3536
3535
  }
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
+ }
3537
3622
  async openDashboard() {
3538
3623
  await this.util.openSideNavMenu("Dashboard");
3539
3624
  await (0, $hOLA6$expect)(this.page.getByLabel("breadcrumb").getByText("Dashboard")).toBeVisible();