@bigbinary/neeto-playwright-commons 1.21.0 → 1.21.1
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/index.cjs.js +14 -19
- package/index.cjs.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +14 -19
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -3486,7 +3486,7 @@ declare class RolesPage {
|
|
|
3486
3486
|
roleApis: RoleApis;
|
|
3487
3487
|
t: TFunction;
|
|
3488
3488
|
constructor(page: Page, neetoPlaywrightUtilities: CustomCommands);
|
|
3489
|
-
getPermissionIds: (targetPermissions: string[]) => Promise<
|
|
3489
|
+
getPermissionIds: (targetPermissions: string[]) => Promise<any[]>;
|
|
3490
3490
|
getRoleIdAndOrganizationId: (roleName: string) => Promise<{
|
|
3491
3491
|
roleId: string;
|
|
3492
3492
|
organizationId: string;
|
package/index.js
CHANGED
|
@@ -192000,32 +192000,27 @@ class EditorPage {
|
|
|
192000
192000
|
};
|
|
192001
192001
|
this.verifyFontSize = async () => {
|
|
192002
192002
|
const fontsAndTexts = [];
|
|
192003
|
-
|
|
192004
|
-
|
|
192005
|
-
|
|
192006
|
-
const allButtons = await this.page
|
|
192003
|
+
const fontSizeDropdownButton = this.page.getByTestId(NEETO_EDITOR_SELECTORS.neetoEditorFixedMenuFontSize);
|
|
192004
|
+
await fontSizeDropdownButton.click();
|
|
192005
|
+
const headingButtons = await this.page
|
|
192007
192006
|
.getByTestId(COMMON_SELECTORS.dropdownContainer)
|
|
192008
192007
|
.getByRole("button")
|
|
192009
192008
|
.all();
|
|
192010
|
-
const
|
|
192009
|
+
const headingLevels = (await Promise.all(headingButtons.map(async (button) => {
|
|
192011
192010
|
const dataCy = await button.getAttribute("data-cy");
|
|
192012
|
-
|
|
192013
|
-
|
|
192014
|
-
: null;
|
|
192011
|
+
const headingLevel = dataCy === null || dataCy === void 0 ? void 0 : dataCy.split("-").pop();
|
|
192012
|
+
return /^h[1-5]$/.test(headingLevel || "") ? headingLevel : null;
|
|
192015
192013
|
}))).filter(Boolean);
|
|
192016
|
-
|
|
192017
|
-
|
|
192018
|
-
const fontKey =
|
|
192019
|
-
if (!fontKey)
|
|
192020
|
-
continue;
|
|
192021
|
-
const headingLevel = Number(fontKey.slice(1));
|
|
192014
|
+
const fontSizeDropdown = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.fontSize);
|
|
192015
|
+
for (const headingLevel of headingLevels) {
|
|
192016
|
+
const fontKey = headingLevel;
|
|
192022
192017
|
const randomText = await this.fillRandomText();
|
|
192023
|
-
await
|
|
192024
|
-
|
|
192018
|
+
await fontSizeDropdown.click();
|
|
192019
|
+
await this.editorWrapper
|
|
192020
|
+
.getByTestId(FONT_SIZE_SELECTORS[fontKey])
|
|
192025
192021
|
.click();
|
|
192026
|
-
await button.click();
|
|
192027
192022
|
await expect(this.contentField.getByRole("heading", {
|
|
192028
|
-
level: headingLevel,
|
|
192023
|
+
level: Number(headingLevel === null || headingLevel === void 0 ? void 0 : headingLevel.slice(1)),
|
|
192029
192024
|
name: randomText,
|
|
192030
192025
|
})).toBeVisible();
|
|
192031
192026
|
fontsAndTexts.push({
|
|
@@ -193233,7 +193228,7 @@ class RolesPage {
|
|
|
193233
193228
|
const { permissions } = await this.roleApis
|
|
193234
193229
|
.fetch("permissions")
|
|
193235
193230
|
.then(response => response === null || response === void 0 ? void 0 : response.json());
|
|
193236
|
-
const permissionObjects = targetPermissions.
|
|
193231
|
+
const permissionObjects = targetPermissions.flatMap(permission => permissions.filter((p) => p.category === permission));
|
|
193237
193232
|
return pluck("id", permissionObjects);
|
|
193238
193233
|
};
|
|
193239
193234
|
this.getRoleIdAndOrganizationId = async (roleName) => {
|