@digital-ai/devops-page-object-release 0.0.85 → 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/CHANGELOG.md +6 -0
- package/dist/main.js +91 -86
- package/dist/main.js.map +1 -1
- package/dist/module.js +91 -86
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +9 -9
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/module.js
CHANGED
|
@@ -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();
|