@bigbinary/neeto-playwright-commons 1.20.1 → 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.cjs.js CHANGED
@@ -223,6 +223,7 @@ const THANK_YOU_SELECTORS = {
223
223
  linkInputField: "link-input-field",
224
224
  previewImage: "preview-image",
225
225
  thankYouMessageEditor: "thank-you-message-editor",
226
+ thankYouMessageWrapper: "thank-you-message-wrapper",
226
227
  };
227
228
 
228
229
  const ENVIRONMENT = {
@@ -419,6 +420,7 @@ const NEETO_EDITOR_SELECTORS = {
419
420
  editorMenuWrapper: "neeto-editor-fixed-menu-wrapper",
420
421
  editorMediaUploaderTab: "neeto-editor-media-uploader-local-tab",
421
422
  dynamicVariableSelector: (variable) => `dynamic-variables-list-item-${joinHyphenCase(variable)}`,
423
+ neetoEditorFixedMenuFontSize: 'neeto-editor-fixed-menu-font-size-option',
422
424
  };
423
425
  const NEETO_TEXT_MODIFIER_SELECTORS = {
424
426
  strike: optionSelector("strike"),
@@ -188511,7 +188513,7 @@ class ThankYouPage {
188511
188513
  await this.page
188512
188514
  .getByTestId(NEETO_EDITOR_SELECTORS.contentField)
188513
188515
  .fill(thankYouMessage);
188514
- await test$1.expect(this.page.getByTestId(THANK_YOU_SELECTORS.previewEditorContent)).toContainText(thankYouMessage);
188516
+ await test$1.expect(this.page.getByTestId(THANK_YOU_SELECTORS.thankYouMessageWrapper).getByTestId(NEETO_EDITOR_SELECTORS.contentField)).toContainText(thankYouMessage);
188515
188517
  };
188516
188518
  this.addRedirectUrl = async (customRedirectUrl) => {
188517
188519
  await this.page
@@ -191855,17 +191857,32 @@ class EditorPage {
191855
191857
  };
191856
191858
  this.verifyFontSize = async () => {
191857
191859
  const fontsAndTexts = [];
191858
- const fontSizeDropdown = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.fontSize);
191859
- const fontSize = Object.keys(FONT_SIZE_SELECTORS);
191860
- for (const font of fontSize) {
191861
- const fontKey = font;
191860
+ await this.page
191861
+ .getByTestId(NEETO_EDITOR_SELECTORS.neetoEditorFixedMenuFontSize)
191862
+ .click();
191863
+ const allButtons = await this.page
191864
+ .getByTestId(COMMON_SELECTORS.dropdownContainer)
191865
+ .getByRole("button")
191866
+ .all();
191867
+ const headingButtons = (await Promise.all(allButtons.map(async (button) => {
191868
+ const dataCy = await button.getAttribute("data-cy");
191869
+ return /^neeto-editor-fixed-menu-font-size-option-h[1-6]$/.test(dataCy || "")
191870
+ ? button
191871
+ : null;
191872
+ }))).filter(Boolean);
191873
+ for (const button of headingButtons) {
191874
+ const dataCy = await button.getAttribute("data-cy");
191875
+ const fontKey = dataCy === null || dataCy === void 0 ? void 0 : dataCy.split("-").pop();
191876
+ if (!fontKey)
191877
+ continue;
191878
+ const headingLevel = Number(fontKey.slice(1));
191862
191879
  const randomText = await this.fillRandomText();
191863
- await fontSizeDropdown.click();
191864
- await this.editorWrapper
191865
- .getByTestId(FONT_SIZE_SELECTORS[fontKey])
191880
+ await this.page
191881
+ .getByTestId(NEETO_EDITOR_SELECTORS.neetoEditorFixedMenuFontSize)
191866
191882
  .click();
191883
+ await button.click();
191867
191884
  await test$1.expect(this.contentField.getByRole("heading", {
191868
- level: Number(font.slice(1)),
191885
+ level: headingLevel,
191869
191886
  name: randomText,
191870
191887
  })).toBeVisible();
191871
191888
  fontsAndTexts.push({
@@ -195113,6 +195130,13 @@ const definePlaywrightConfig = (overrides) => {
195113
195130
  },
195114
195131
  dependencies: ["setup"],
195115
195132
  },
195133
+ {
195134
+ name: "lighthouse-audits",
195135
+ testDir: "e2e/lighthouse-audits",
195136
+ testMatch: "**/*.lighthouse.ts",
195137
+ use: { storageState: "e2e/auth/user.json" },
195138
+ dependencies: ["setup"],
195139
+ },
195116
195140
  { name: "cleanup credentials", testMatch: "global.teardown.ts" },
195117
195141
  ...projectOverrides,
195118
195142
  ],