@bigbinary/neeto-playwright-commons 4.8.5 → 4.8.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.
Files changed (3) hide show
  1. package/index.d.ts +8 -0
  2. package/index.js +38 -1
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -4165,6 +4165,8 @@ declare class EditorPage {
4165
4165
  private fixedMenuOptions;
4166
4166
  private moreMenuOptions;
4167
4167
  private verifyFontSize;
4168
+ private verifyFontSizeV1;
4169
+ private verifyFontSizeV2;
4168
4170
  private verifyTextModifiers;
4169
4171
  private verifyTextDeskModifier;
4170
4172
  private openHighlighterContainer;
@@ -7548,6 +7550,11 @@ declare const AUDIT_LOGS_SELECTORS: {
7548
7550
  */
7549
7551
  declare const COMMON_SELECTORS: {
7550
7552
  emailInputError: string;
7553
+ nuiSelectInput: string;
7554
+ customSelectInput: (label: string) => string;
7555
+ tableWrapper: string;
7556
+ phoneCountryPicker: string;
7557
+ phoneCountryPickerSearch: string;
7551
7558
  pane: string;
7552
7559
  sideBar: string;
7553
7560
  copyButton: string;
@@ -7582,6 +7589,7 @@ declare const COMMON_SELECTORS: {
7582
7589
  sheetHeader: string;
7583
7590
  sheetWrapper: string;
7584
7591
  sheetBody: string;
7592
+ sheetFooter: string;
7585
7593
  sheetCloseButton: string;
7586
7594
  dialogHeader: string;
7587
7595
  dialogBody: string;
package/index.js CHANGED
@@ -1034,6 +1034,11 @@ const AUDIT_LOGS_SELECTORS = {
1034
1034
 
1035
1035
  const COMMON_SELECTORS = {
1036
1036
  emailInputError: "email-input-error",
1037
+ nuiSelectInput: "nui-select-input",
1038
+ customSelectInput: (label) => `${hyphenate(label)}-select-input`,
1039
+ tableWrapper: "table-wrapper",
1040
+ phoneCountryPicker: "phonenumber-country-picker",
1041
+ phoneCountryPickerSearch: "phonenumber-country-picker-search",
1037
1042
  pane: "pane-wrapper",
1038
1043
  sideBar: "sidebar",
1039
1044
  copyButton: "copy-button",
@@ -1068,6 +1073,7 @@ const COMMON_SELECTORS = {
1068
1073
  sheetHeader: "sheet-header",
1069
1074
  sheetWrapper: "sheet-wrapper",
1070
1075
  sheetBody: "sheet-body",
1076
+ sheetFooter: "sheet-footer",
1071
1077
  sheetCloseButton: "sheet-close-button",
1072
1078
  dialogHeader: "dialog-header",
1073
1079
  dialogBody: "dialog-body",
@@ -120696,7 +120702,8 @@ class EditorPage {
120696
120702
  await expect(dropdownContainer).toBeHidden();
120697
120703
  return moreMenuButtonLocators;
120698
120704
  };
120699
- verifyFontSize = async () => {
120705
+ verifyFontSize = async () => IS_SHADCN_UI ? this.verifyFontSizeV2() : this.verifyFontSizeV1();
120706
+ verifyFontSizeV1 = async () => {
120700
120707
  const fontsAndTexts = [];
120701
120708
  await this.page
120702
120709
  .getByTestId(NEETO_EDITOR_SELECTORS.neetoEditorFixedMenuFontSize)
@@ -120726,6 +120733,36 @@ class EditorPage {
120726
120733
  }
120727
120734
  return fontsAndTexts;
120728
120735
  };
120736
+ verifyFontSizeV2 = async () => {
120737
+ const fontsAndTexts = [];
120738
+ await this.page
120739
+ .getByTestId(NEETO_EDITOR_SELECTORS.neetoEditorFixedMenuFontSize)
120740
+ .click();
120741
+ const dropdownContainer = this.page.getByTestId(COMMON_SELECTORS.dropdownContainer);
120742
+ const headingMenuItems = await dropdownContainer
120743
+ .getByRole("menuitem")
120744
+ .all();
120745
+ const headingLevels = (await Promise.all(headingMenuItems.map(async (menuItem) => {
120746
+ const dataTestid = await menuItem.getAttribute("data-testid");
120747
+ const headingLevel = dataTestid?.split("-").pop();
120748
+ return /^h[1-5]$/.test(headingLevel || "") ? headingLevel : null;
120749
+ }))).filter(Boolean);
120750
+ const fontSizeDropdown = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.fontSize);
120751
+ await fontSizeDropdown.click();
120752
+ await expect(dropdownContainer).toBeHidden();
120753
+ for (const headingLevel of headingLevels) {
120754
+ const fontKey = headingLevel;
120755
+ const randomText = await this.fillRandomText();
120756
+ await fontSizeDropdown.click();
120757
+ await dropdownContainer.getByTestId(FONT_SIZE_SELECTORS[fontKey]).click();
120758
+ await expect(this.contentField.getByRole("heading", {
120759
+ level: Number(headingLevel?.slice(1)),
120760
+ name: randomText,
120761
+ })).toBeVisible();
120762
+ fontsAndTexts.push({ key: fontKey, value: randomText });
120763
+ }
120764
+ return fontsAndTexts;
120765
+ };
120729
120766
  verifyTextModifiers = async (modifier, isButtonInMoreMenu) => {
120730
120767
  const modifierKey = modifier;
120731
120768
  const textModifierRole = TEXT_MODIFIER_ROLES[modifierKey];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-playwright-commons",
3
- "version": "4.8.5",
3
+ "version": "4.8.6",
4
4
  "description": "A package encapsulating common playwright code across neeto projects.",
5
5
  "repository": "git@github.com:bigbinary/neeto-playwright-commons.git",
6
6
  "license": "apache-2.0",