@bigbinary/neeto-playwright-commons 1.20.2 → 1.20.3

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.d.ts CHANGED
@@ -4896,6 +4896,7 @@ declare const THANK_YOU_SELECTORS: {
4896
4896
  linkInputField: string;
4897
4897
  previewImage: string;
4898
4898
  thankYouMessageEditor: string;
4899
+ thankYouMessageWrapper: string;
4899
4900
  };
4900
4901
  /**
4901
4902
  *
@@ -5023,6 +5024,7 @@ declare const NEETO_EDITOR_SELECTORS: {
5023
5024
  editorMenuWrapper: string;
5024
5025
  editorMediaUploaderTab: string;
5025
5026
  dynamicVariableSelector: (variable: string) => string;
5027
+ neetoEditorFixedMenuFontSize: string;
5026
5028
  };
5027
5029
  declare const NEETO_TEXT_MODIFIER_SELECTORS: {
5028
5030
  strike: string;
package/index.js CHANGED
@@ -203,6 +203,7 @@ const THANK_YOU_SELECTORS = {
203
203
  linkInputField: "link-input-field",
204
204
  previewImage: "preview-image",
205
205
  thankYouMessageEditor: "thank-you-message-editor",
206
+ thankYouMessageWrapper: "thank-you-message-wrapper",
206
207
  };
207
208
 
208
209
  const ENVIRONMENT = {
@@ -399,6 +400,7 @@ const NEETO_EDITOR_SELECTORS = {
399
400
  editorMenuWrapper: "neeto-editor-fixed-menu-wrapper",
400
401
  editorMediaUploaderTab: "neeto-editor-media-uploader-local-tab",
401
402
  dynamicVariableSelector: (variable) => `dynamic-variables-list-item-${joinHyphenCase(variable)}`,
403
+ neetoEditorFixedMenuFontSize: 'neeto-editor-fixed-menu-font-size-option',
402
404
  };
403
405
  const NEETO_TEXT_MODIFIER_SELECTORS = {
404
406
  strike: optionSelector("strike"),
@@ -188491,7 +188493,7 @@ class ThankYouPage {
188491
188493
  await this.page
188492
188494
  .getByTestId(NEETO_EDITOR_SELECTORS.contentField)
188493
188495
  .fill(thankYouMessage);
188494
- await expect(this.page.getByTestId(THANK_YOU_SELECTORS.previewEditorContent)).toContainText(thankYouMessage);
188496
+ await expect(this.page.getByTestId(THANK_YOU_SELECTORS.thankYouMessageWrapper).getByTestId(NEETO_EDITOR_SELECTORS.contentField)).toContainText(thankYouMessage);
188495
188497
  };
188496
188498
  this.addRedirectUrl = async (customRedirectUrl) => {
188497
188499
  await this.page
@@ -191835,17 +191837,32 @@ class EditorPage {
191835
191837
  };
191836
191838
  this.verifyFontSize = async () => {
191837
191839
  const fontsAndTexts = [];
191838
- const fontSizeDropdown = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.fontSize);
191839
- const fontSize = Object.keys(FONT_SIZE_SELECTORS);
191840
- for (const font of fontSize) {
191841
- const fontKey = font;
191840
+ await this.page
191841
+ .getByTestId(NEETO_EDITOR_SELECTORS.neetoEditorFixedMenuFontSize)
191842
+ .click();
191843
+ const allButtons = await this.page
191844
+ .getByTestId(COMMON_SELECTORS.dropdownContainer)
191845
+ .getByRole("button")
191846
+ .all();
191847
+ const headingButtons = (await Promise.all(allButtons.map(async (button) => {
191848
+ const dataCy = await button.getAttribute("data-cy");
191849
+ return /^neeto-editor-fixed-menu-font-size-option-h[1-6]$/.test(dataCy || "")
191850
+ ? button
191851
+ : null;
191852
+ }))).filter(Boolean);
191853
+ for (const button of headingButtons) {
191854
+ const dataCy = await button.getAttribute("data-cy");
191855
+ const fontKey = dataCy === null || dataCy === void 0 ? void 0 : dataCy.split("-").pop();
191856
+ if (!fontKey)
191857
+ continue;
191858
+ const headingLevel = Number(fontKey.slice(1));
191842
191859
  const randomText = await this.fillRandomText();
191843
- await fontSizeDropdown.click();
191844
- await this.editorWrapper
191845
- .getByTestId(FONT_SIZE_SELECTORS[fontKey])
191860
+ await this.page
191861
+ .getByTestId(NEETO_EDITOR_SELECTORS.neetoEditorFixedMenuFontSize)
191846
191862
  .click();
191863
+ await button.click();
191847
191864
  await expect(this.contentField.getByRole("heading", {
191848
- level: Number(font.slice(1)),
191865
+ level: headingLevel,
191849
191866
  name: randomText,
191850
191867
  })).toBeVisible();
191851
191868
  fontsAndTexts.push({