@bigbinary/neeto-playwright-commons 1.9.32 → 1.9.33

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
@@ -13602,7 +13602,7 @@ const TOASTR_MESSAGES = {
13602
13602
  zapierApiKeyGenerated: "Zapier API key is generated successfully!",
13603
13603
  };
13604
13604
  const ZAPIER_LIMIT_EXHAUSTED_MESSAGE = "Zapier free task limit is exhausted. Test will be aborted";
13605
- const EMOJI_PICKER_LABEL = "Smileys & People";
13605
+ const EMOJI_LABEL = "thumbs up";
13606
13606
  const ATTACHMENT_DELETION_TOASTR_MESSAGE = "Attachment has been successfully deleted.";
13607
13607
 
13608
13608
  const HELP_CENTER_SELECTORS = {
@@ -14459,6 +14459,7 @@ class ZapierPage extends IntegrationBase {
14459
14459
  const DESCRIPTION_EDITOR_TEXTS = {
14460
14460
  fontSize: "Font size",
14461
14461
  paragraph: "Paragraph",
14462
+ normalText: "Normal text",
14462
14463
  pasteLink: "Paste the link here...",
14463
14464
  invalidURLError: "Please enter a valid URL",
14464
14465
  pasteURL: "Paste URL",
@@ -14467,6 +14468,8 @@ const DESCRIPTION_EDITOR_TEXTS = {
14467
14468
  link: "Link",
14468
14469
  cannedResponseHeader: "Canned responses",
14469
14470
  paragraphOption: "paragraph",
14471
+ search: "Search",
14472
+ emoji: "Emoji",
14470
14473
  };
14471
14474
  const EXPANDED_FONT_SIZE = {
14472
14475
  h1: "Heading 1",
@@ -14514,7 +14517,7 @@ const NEETO_EDITOR_SELECTORS = {
14514
14517
  addLinkTextField: "neeto-editor-add-link-text-input",
14515
14518
  addURLTextField: "neeto-editor-add-link-url-input",
14516
14519
  submitLinkButton: "neeto-editor-add-link",
14517
- fontSizeDropdown: (currentOption = "Paragraph") => `${joinHyphenCase(currentOption)}-dropdown-icon`,
14520
+ fontSizeDropdown: (currentOption) => `${joinHyphenCase(currentOption)}-dropdown-icon`,
14518
14521
  fixedMenuArrow: "neeto-editor-fixed-menu-arrow",
14519
14522
  cannedResponseOption: "neeto-editor-fixed-menu-canned-responses-option",
14520
14523
  cannedResponseSelectContainer: "select-a-canned-response-select-container",
@@ -14540,6 +14543,9 @@ const NEETO_EDITOR_SELECTORS = {
14540
14543
  errorText: "neeto-editor-error-text",
14541
14544
  content: "editor-content",
14542
14545
  imageUploadDeleteButton: "neeto-editor-image-menu-Delete",
14546
+ dynamicVariablesButton: "dynamic-variables-button",
14547
+ emojiContainer: "neeto-editor-emoji-picker",
14548
+ dynamicVariableSelector: (variable) => `dynamic-variables-list-item-${neetoCist.hyphenate(variable)}`,
14543
14549
  };
14544
14550
  const NEETO_TEXT_MODIFIER_SELECTORS = {
14545
14551
  strikeOption: "neeto-editor-fixed-menu-strike-option",
@@ -14550,7 +14556,7 @@ const TEXT_MODIFIER_SELECTORS = {
14550
14556
  boldOption: "neeto-editor-fixed-menu-bold-option",
14551
14557
  italicsOption: "neeto-editor-fixed-menu-italic-option",
14552
14558
  codeOption: "neeto-editor-fixed-menu-code-option",
14553
- blockquoteOption: "neeto-editor-fixed-menu-block-quote-option",
14559
+ blockquoteOption: "neeto-editor-fixed-menu-blockquote-option",
14554
14560
  codeblockOption: "neeto-editor-fixed-menu-code-block-option",
14555
14561
  };
14556
14562
  const LIST_MODIFIER_SELECTORS = {
@@ -14568,40 +14574,44 @@ const FONT_SIZE_SELECTORS = {
14568
14574
  /* eslint-disable playwright/no-nth-methods */
14569
14575
  class EditorPage {
14570
14576
  constructor(page, neetoPlaywrightUtilities) {
14571
- this.verifyDescriptionEditor = async ({ text, linkUrl = faker.faker.internet.url(), filePath = "../../../e2e/assets/images/BigBinary.png", imageUrl = "https://picsum.photos/200/300", videoUrl = "https://youtu.be/jNQXAC9IVRw", cannedResponseSuccessMessage, }) => {
14572
- await this.page.getByTestId(NEETO_EDITOR_SELECTORS.contentField).fill(text);
14573
- await this.page
14574
- .getByTestId(NEETO_EDITOR_SELECTORS.fontSizeDropdown())
14577
+ this.verifyDescriptionEditor = async ({ text, editorWrapper, dynamicVariables, defaultFontSizeOption = "Paragraph", linkUrl = faker.faker.internet.url(), filePath = "../../../e2e/assets/images/BigBinary.png", imageUrl = "https://picsum.photos/200/300", videoUrl = "https://youtu.be/jNQXAC9IVRw", cannedResponseSuccessMessage, }) => {
14578
+ if (!editorWrapper)
14579
+ editorWrapper = this.page;
14580
+ await editorWrapper
14581
+ .getByTestId(NEETO_EDITOR_SELECTORS.contentField)
14582
+ .fill(text);
14583
+ await editorWrapper
14584
+ .getByTestId(NEETO_EDITOR_SELECTORS.fontSizeDropdown(defaultFontSizeOption))
14575
14585
  .click();
14576
14586
  const fontSize = Object.keys(FONT_SIZE_SELECTORS);
14577
14587
  for (const font of fontSize) {
14578
14588
  const fontKey = font;
14579
- await this.page.getByTestId(FONT_SIZE_SELECTORS[fontKey]).click();
14580
- await test$1.expect(this.page
14589
+ await editorWrapper.getByTestId(FONT_SIZE_SELECTORS[fontKey]).click();
14590
+ await test$1.expect(editorWrapper
14581
14591
  .getByTestId(NEETO_EDITOR_SELECTORS.contentField)
14582
14592
  .getByRole("heading", { level: Number(font.slice(1)) })).toBeVisible();
14583
- await this.page
14593
+ await editorWrapper
14584
14594
  .getByTestId(NEETO_EDITOR_SELECTORS.fontSizeDropdown(EXPANDED_FONT_SIZE[fontKey]))
14585
14595
  .click();
14586
14596
  }
14587
14597
  if (await this.paragraphSelector.isVisible()) {
14588
14598
  await this.paragraphSelector.click();
14589
14599
  const paragraphRole = DESCRIPTION_EDITOR_TEXTS.paragraphOption;
14590
- await test$1.expect(this.page
14600
+ await test$1.expect(editorWrapper
14591
14601
  .getByTestId(NEETO_EDITOR_SELECTORS.contentField)
14592
14602
  .getByRole(paragraphRole)).toBeVisible();
14593
14603
  }
14594
14604
  (await this.fixedMenuArrowSelector.isVisible()) &&
14595
14605
  (await this.fixedMenuArrowSelector.click());
14596
- await this.page.getByText(text).click({ clickCount: 3 });
14606
+ await editorWrapper.getByText(text).click({ clickCount: 3 });
14597
14607
  const textModifier = Object.keys(TEXT_MODIFIER_SELECTORS);
14598
14608
  for (const modifier of textModifier) {
14599
14609
  const modifierKey = modifier;
14600
14610
  const textModifierRole = TEXT_MODIFIER_ROLES[modifierKey];
14601
- const textModifierSelector = this.page.getByTestId(TEXT_MODIFIER_SELECTORS[modifierKey]);
14611
+ const textModifierSelector = editorWrapper.getByTestId(TEXT_MODIFIER_SELECTORS[modifierKey]);
14602
14612
  if (await textModifierSelector.isVisible()) {
14603
14613
  await textModifierSelector.click();
14604
- await test$1.expect(this.page
14614
+ await test$1.expect(editorWrapper
14605
14615
  .getByTestId(NEETO_EDITOR_SELECTORS.contentField)
14606
14616
  .getByRole(textModifierRole)).toBeVisible();
14607
14617
  await textModifierSelector.click();
@@ -14610,10 +14620,10 @@ class EditorPage {
14610
14620
  const textDeskModifier = Object.keys(NEETO_TEXT_MODIFIER_SELECTORS);
14611
14621
  for (const modifier of textDeskModifier) {
14612
14622
  const modifierKey = modifier;
14613
- const textModifierSelector = this.page.getByTestId(NEETO_TEXT_MODIFIER_SELECTORS[modifierKey]);
14623
+ const textModifierSelector = editorWrapper.getByTestId(NEETO_TEXT_MODIFIER_SELECTORS[modifierKey]);
14614
14624
  if (await textModifierSelector.isVisible()) {
14615
14625
  await textModifierSelector.click();
14616
- await test$1.expect(this.page
14626
+ await test$1.expect(editorWrapper
14617
14627
  .getByTestId(NEETO_EDITOR_SELECTORS.contentField)
14618
14628
  .locator(TEXT_MODIFIER_TAGS[modifierKey])).toBeVisible();
14619
14629
  await textModifierSelector.click();
@@ -14622,10 +14632,10 @@ class EditorPage {
14622
14632
  const listModifier = Object.keys(LIST_MODIFIER_SELECTORS);
14623
14633
  for (const modifier of listModifier) {
14624
14634
  const modifierKey = modifier;
14625
- const listModifierSelector = this.page.getByTestId(LIST_MODIFIER_SELECTORS[modifierKey]);
14635
+ const listModifierSelector = editorWrapper.getByTestId(LIST_MODIFIER_SELECTORS[modifierKey]);
14626
14636
  if (await listModifierSelector.isVisible()) {
14627
14637
  await listModifierSelector.click();
14628
- await test$1.expect(this.page
14638
+ await test$1.expect(editorWrapper
14629
14639
  .getByTestId(NEETO_EDITOR_SELECTORS.contentField)
14630
14640
  .locator(LIST_MODIFIER_TAGS[modifierKey])).toBeVisible();
14631
14641
  await listModifierSelector.click();
@@ -14640,7 +14650,7 @@ class EditorPage {
14640
14650
  .getByTestId(NEETO_EDITOR_SELECTORS.addLinkDoneButton)
14641
14651
  .click();
14642
14652
  const linkRole = DESCRIPTION_EDITOR_TEXTS.link;
14643
- await test$1.expect(this.page
14653
+ await test$1.expect(editorWrapper
14644
14654
  .getByTestId(NEETO_EDITOR_SELECTORS.contentField)
14645
14655
  .getByRole(linkRole)).toBeVisible();
14646
14656
  await this.page.getByTestId(NEETO_EDITOR_SELECTORS.unlinkButton).click();
@@ -14665,10 +14675,10 @@ class EditorPage {
14665
14675
  await this.page
14666
14676
  .getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
14667
14677
  .click();
14678
+ await this.neetoPlaywrightUtilities.verifyToast({
14679
+ message: ATTACHMENT_DELETION_TOASTR_MESSAGE,
14680
+ });
14668
14681
  }
14669
- await this.neetoPlaywrightUtilities.verifyToast({
14670
- message: ATTACHMENT_DELETION_TOASTR_MESSAGE,
14671
- });
14672
14682
  if (await this.imageUploadOption.isVisible()) {
14673
14683
  await this.imageUploadOption.click();
14674
14684
  const fileUploaderPromise = this.page.waitForEvent("filechooser");
@@ -14679,7 +14689,6 @@ class EditorPage {
14679
14689
  const imagePath = Path__namespace.join(__dirname, filePath);
14680
14690
  await fileUploader.setFiles(imagePath);
14681
14691
  await test$1.expect(this.imageWrapper).toBeVisible({ timeout: 15000 });
14682
- await this.neetoPlaywrightUtilities.verifyToast();
14683
14692
  await this.imageWrapper
14684
14693
  .getByTestId(COMMON_SELECTORS.dropdownIcon)
14685
14694
  .click();
@@ -14720,11 +14729,11 @@ class EditorPage {
14720
14729
  message: cannedResponseSuccessMessage,
14721
14730
  });
14722
14731
  }
14723
- if (await this.page
14732
+ if (await editorWrapper
14724
14733
  .getByTestId(NEETO_EDITOR_SELECTORS.videoEmbedOption)
14725
14734
  .isVisible()) {
14726
14735
  await this.videoEmbedOption.click();
14727
- await this.videoEmbedOption.fill(videoUrl);
14736
+ await this.videoEmbedInput.fill(videoUrl);
14728
14737
  await this.page
14729
14738
  .getByTestId(NEETO_EDITOR_SELECTORS.videoEmbedSubmit)
14730
14739
  .click();
@@ -14740,12 +14749,35 @@ class EditorPage {
14740
14749
  if (await this.emojiDropdownIcon.isVisible()) {
14741
14750
  await this.emojiDropdownIcon.click();
14742
14751
  await this.page
14743
- .getByRole("region", {
14744
- name: EMOJI_PICKER_LABEL,
14745
- })
14746
- .getByText("👍")
14752
+ .getByRole("button", { name: DESCRIPTION_EDITOR_TEXTS.emoji })
14747
14753
  .click();
14748
- await test$1.expect(this.page.getByTestId(NEETO_EDITOR_SELECTORS.contentField)).toContainText("👍");
14754
+ await test$1.expect(this.page.getByTestId(NEETO_EDITOR_SELECTORS.emojiContainer)).toBeVisible({
14755
+ timeout: 10000,
14756
+ });
14757
+ await this.page
14758
+ .getByTestId(NEETO_EDITOR_SELECTORS.emojiContainer)
14759
+ .getByPlaceholder(DESCRIPTION_EDITOR_TEXTS.search)
14760
+ .fill(EMOJI_LABEL);
14761
+ await this.page.keyboard.press("Enter");
14762
+ await test$1.expect(editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.contentField)).toContainText("👍");
14763
+ await this.page.keyboard.press("Escape");
14764
+ }
14765
+ if (dynamicVariables &&
14766
+ (await editorWrapper
14767
+ .getByTestId(NEETO_EDITOR_SELECTORS.dynamicVariablesButton)
14768
+ .isVisible())) {
14769
+ for (const dynamicVariable of dynamicVariables) {
14770
+ await editorWrapper
14771
+ .getByTestId(NEETO_EDITOR_SELECTORS.dynamicVariablesButton)
14772
+ .click();
14773
+ await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.dropdownContainer)).toBeVisible();
14774
+ await this.page
14775
+ .getByTestId(NEETO_EDITOR_SELECTORS.dynamicVariableSelector(dynamicVariable))
14776
+ .click();
14777
+ await test$1.expect(editorWrapper
14778
+ .getByTestId(NEETO_EDITOR_SELECTORS.contentField)
14779
+ .getByText(dynamicVariable)).toBeVisible();
14780
+ }
14749
14781
  }
14750
14782
  };
14751
14783
  this.page = page;
@@ -14761,6 +14793,7 @@ class EditorPage {
14761
14793
  this.imageUploadOption = this.page.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadOption);
14762
14794
  this.cannedResponseOption = this.page.getByTestId(NEETO_EDITOR_SELECTORS.cannedResponseOption);
14763
14795
  this.videoEmbedOption = this.page.getByTestId(NEETO_EDITOR_SELECTORS.videoEmbedOption);
14796
+ this.videoEmbedInput = this.page.getByTestId(NEETO_EDITOR_SELECTORS.videoEmbedInput);
14764
14797
  this.videoWrapperSelector = this.page.getByTestId(NEETO_EDITOR_SELECTORS.videoWrapper);
14765
14798
  this.emojiDropdownIcon = this.page
14766
14799
  .getByTestId(NEETO_EDITOR_SELECTORS.fixedMenuWrapper)
@@ -149300,7 +149333,7 @@ exports.CREDENTIALS = CREDENTIALS;
149300
149333
  exports.CustomCommands = CustomCommands;
149301
149334
  exports.DESCRIPTION_EDITOR_TEXTS = DESCRIPTION_EDITOR_TEXTS;
149302
149335
  exports.EMBED_SELECTORS = EMBED_SELECTORS;
149303
- exports.EMOJI_PICKER_LABEL = EMOJI_PICKER_LABEL;
149336
+ exports.EMOJI_LABEL = EMOJI_LABEL;
149304
149337
  exports.ENVIRONMENT = ENVIRONMENT;
149305
149338
  exports.EXPANDED_FONT_SIZE = EXPANDED_FONT_SIZE;
149306
149339
  exports.EditorPage = EditorPage;