@bigbinary/neeto-playwright-commons 1.11.11 → 1.11.12

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
@@ -100,6 +100,7 @@ const ROUTES = {
100
100
  },
101
101
  attachment: `/neeto_editor${BASE_URL}/direct_uploads/attach`,
102
102
  dashboard: "/dashboard",
103
+ neetoThankYou: "/neeto_thank_you_engine",
103
104
  };
104
105
  const API_ROUTES = {
105
106
  teamMembers: {
@@ -12681,6 +12682,173 @@ const i18nFixture = {
12681
12682
  },
12682
12683
  };
12683
12684
 
12685
+ const THANK_YOU_SELECTORS = {
12686
+ settingsLink: "thank-you-settings-link",
12687
+ showSocialShareIconsSwitch: "show-social-share-icons-switch",
12688
+ showLinkToSubmitAnotherResponseSwitch: "show-link-to-submit-another-response-switch",
12689
+ submitAnotherResponseLinkTextInputField: "submit-another-response-link-text-input-field",
12690
+ previewEditorContent: "preview-editor-content",
12691
+ redirectToExternalLinkRadioLabel: () => "neeto-thank-you-configuration-redirect-to-url-label",
12692
+ thankYouConfigurationLabel: (label = "custom-message") => `neeto-thank-you-configuration-${label}-label`,
12693
+ saveChangesButton: "neeto-thank-you-configuration-save-button",
12694
+ cancelButton: "neeto-thank-you-configuration-cancel-button",
12695
+ thankYouPageImage: "thank-you-page-image",
12696
+ thankYouPageMessage: "thank-you-page-message",
12697
+ thankYouPageContent: "thank-you-page-content",
12698
+ thankYouPageResubmitLink: "thank-you-page-resubmit-link",
12699
+ linkInputField: "link-input-field",
12700
+ previewImage: "preview-image",
12701
+ };
12702
+
12703
+ const optionSelector = (option) => `neeto-editor-fixed-menu-${option}-option`;
12704
+ const fixedMenuSelector = (selector) => `neeto-editor-fixed-menu-${selector}`;
12705
+
12706
+ const NEETO_EDITOR_SELECTORS = {
12707
+ fontSize: optionSelector("font-size"),
12708
+ boldOption: optionSelector("bold"),
12709
+ italicOption: optionSelector("italic"),
12710
+ underlineOption: optionSelector("underline"),
12711
+ strikeOption: optionSelector("strike"),
12712
+ codeBlockOption: optionSelector("code"),
12713
+ highlightOption: optionSelector("highlight"),
12714
+ emojiOption: optionSelector("emoji"),
12715
+ emojiDropdownIcon: "emoji-dropdown-icon",
12716
+ linkInput: fixedMenuSelector("link-option-input"),
12717
+ linkSubmitButton: fixedMenuSelector("link-option-link-button"),
12718
+ commandList: (index) => `neeto-editor-command-list-item-${index}`,
12719
+ imageUploadUrlSubmitButton: "neeto-editor-media-upload-url-submit",
12720
+ imageUploadUrlInputTextField: "neeto-editor-media-upload-url-input",
12721
+ uploadInput: "neeto-editor-media-uploader-input",
12722
+ editorMenuBarWrapper: fixedMenuSelector("wrapper"),
12723
+ undoOption: optionSelector("undo"),
12724
+ redoOption: optionSelector("redo"),
12725
+ imageWrapper: "neeto-editor-image-wrapper",
12726
+ contentField: "neeto-editor-content",
12727
+ addLinkButton: optionSelector("link"),
12728
+ addLinkTextField: "neeto-editor-add-link-text-input",
12729
+ addURLTextField: "neeto-editor-add-link-url-input",
12730
+ submitLinkButton: "neeto-editor-add-link",
12731
+ fixedMenuArrow: fixedMenuSelector("arrow"),
12732
+ cannedResponseOption: optionSelector("canned-responses"),
12733
+ cannedResponseSelectContainer: "select-a-canned-response-select-container",
12734
+ fixedMenuWrapper: fixedMenuSelector("wrapper"),
12735
+ linkOption: optionSelector("link"),
12736
+ addLinkUrlInput: "neeto-editor-add-link-url-input",
12737
+ addLinkDoneButton: "neeto-editor-add-link",
12738
+ unlinkButton: "neeto-editor-link-popover-unlink",
12739
+ editorAttachmentsButton: optionSelector("attachments"),
12740
+ attachmentPreviewDeleteButton: "neeto-editor-preview-delete-button",
12741
+ imageUploadOption: optionSelector("image-upload"),
12742
+ imageUploadLinkInput: "neeto-editor-media-upload-url-input",
12743
+ imageUploadButton: "neeto-editor-media-uploader-dnd",
12744
+ imageUploadLinkSubmitButton: "neeto-editor-media-upload-url-submit",
12745
+ applyButton: "apply-button",
12746
+ videoEmbedOption: optionSelector("video-embed"),
12747
+ videoEmbedInput: "neeto-editor-embed-input",
12748
+ videoEmbedSubmit: "neeto-editor-embed-cancel",
12749
+ videoWrapper: "neeto-editor-video-wrapper",
12750
+ paragraphOption: fixedMenuSelector("font-size-option-body2"),
12751
+ attachmentPreview: "ne-attachments-wrapper",
12752
+ imageUploadLinkButton: "neeto-editor-media-uploader-link-tab",
12753
+ errorText: "neeto-editor-error-text",
12754
+ content: "editor-content",
12755
+ imageUploadDeleteButton: "neeto-editor-image-menu-Delete",
12756
+ dynamicVariablesButton: "dynamic-variables-button",
12757
+ emojiContainer: "neeto-editor-emoji-picker",
12758
+ dynamicVariableSelector: (variable) => `dynamic-variables-list-item-${neetoCist.hyphenate(variable)}`,
12759
+ };
12760
+ const NEETO_TEXT_MODIFIER_SELECTORS = {
12761
+ strike: optionSelector("strike"),
12762
+ underline: optionSelector("underline"),
12763
+ highlight: optionSelector("highlight"),
12764
+ };
12765
+ const TEXT_MODIFIER_SELECTORS = {
12766
+ bold: optionSelector("bold"),
12767
+ italic: optionSelector("italic"),
12768
+ code: optionSelector("code"),
12769
+ blockquote: optionSelector("blockquote"),
12770
+ codeBlock: optionSelector("codeBlock"),
12771
+ };
12772
+ const LIST_MODIFIER_SELECTORS = {
12773
+ bulletList: optionSelector("bulletList"),
12774
+ orderedList: optionSelector("orderedList"),
12775
+ };
12776
+ const FONT_SIZE_SELECTORS = {
12777
+ h1: fixedMenuSelector("font-size-option-h1"),
12778
+ h2: fixedMenuSelector("font-size-option-h2"),
12779
+ h3: fixedMenuSelector("font-size-option-h3"),
12780
+ h4: fixedMenuSelector("font-size-option-h4"),
12781
+ h5: fixedMenuSelector("font-size-option-h5"),
12782
+ };
12783
+
12784
+ const TAB_SELECTORS = {
12785
+ configureTab: "configure-tab",
12786
+ buildTab: "build-tab",
12787
+ themeTab: "theme-tab",
12788
+ shareTab: "share-tab",
12789
+ submissionsTab: "submissions-tab",
12790
+ paymentsTab: "payments-tab",
12791
+ };
12792
+
12793
+ class ThankYouPage {
12794
+ constructor(page, neetoPlaywrightUtilities) {
12795
+ this.navigateToThankYouPage = async () => {
12796
+ await this.page.getByTestId(TAB_SELECTORS.configureTab).click();
12797
+ const fetchConfiguration = this.neetoPlaywrightUtilities.interceptMultipleResponses({
12798
+ responseUrl: ROUTES.neetoThankYou,
12799
+ });
12800
+ await this.page.getByTestId(THANK_YOU_SELECTORS.settingsLink).click();
12801
+ await fetchConfiguration;
12802
+ };
12803
+ this.saveChanges = async () => {
12804
+ const saveChangesButton = this.page.getByTestId(THANK_YOU_SELECTORS.saveChangesButton);
12805
+ await saveChangesButton.click();
12806
+ await this.neetoPlaywrightUtilities.verifyToast();
12807
+ await test$1.expect(saveChangesButton).toBeDisabled();
12808
+ };
12809
+ this.verifyThankYouImage = async (imagePath, imageName) => {
12810
+ await test$1.expect(this.page.getByTestId(THANK_YOU_SELECTORS.thankYouConfigurationLabel())).toBeChecked();
12811
+ await this.neetoPlaywrightUtilities.uploadImage(imagePath);
12812
+ await test$1.expect(this.page.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.progressBar)).toBeHidden();
12813
+ await test$1.expect(this.page.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.uploadedImage)).toHaveAttribute("src", RegExp(imageName), { timeout: 15000 });
12814
+ await test$1.expect(this.page.getByTestId(THANK_YOU_SELECTORS.previewImage)).toHaveAttribute("src", RegExp(imageName), { timeout: 15000 });
12815
+ };
12816
+ this.verifyEditorMenu = async () => {
12817
+ await Promise.all([
12818
+ NEETO_EDITOR_SELECTORS.fontSize,
12819
+ NEETO_EDITOR_SELECTORS.boldOption,
12820
+ NEETO_EDITOR_SELECTORS.italicOption,
12821
+ NEETO_EDITOR_SELECTORS.underlineOption,
12822
+ NEETO_EDITOR_SELECTORS.linkOption,
12823
+ NEETO_EDITOR_SELECTORS.strikeOption,
12824
+ LIST_MODIFIER_SELECTORS.bulletList,
12825
+ LIST_MODIFIER_SELECTORS.orderedList,
12826
+ TEXT_MODIFIER_SELECTORS.code,
12827
+ ].map(editorElement => test$1.expect(this.page
12828
+ .getByTestId(NEETO_EDITOR_SELECTORS.fixedMenuWrapper)
12829
+ .getByTestId(editorElement)).toBeVisible()));
12830
+ };
12831
+ this.verifyThankYouMessage = async (thankYouMessage) => {
12832
+ await this.page.getByTestId(NEETO_EDITOR_SELECTORS.contentField).clear();
12833
+ await this.page
12834
+ .getByTestId(NEETO_EDITOR_SELECTORS.contentField)
12835
+ .fill(thankYouMessage);
12836
+ await test$1.expect(this.page.getByTestId(THANK_YOU_SELECTORS.previewEditorContent)).toContainText(thankYouMessage);
12837
+ };
12838
+ this.addRedirectUrl = async (customRedirectUrl) => {
12839
+ await this.page
12840
+ .getByTestId(THANK_YOU_SELECTORS.thankYouConfigurationLabel("redirect-to-url"))
12841
+ .click();
12842
+ await this.page
12843
+ .getByTestId(THANK_YOU_SELECTORS.linkInputField)
12844
+ .fill(customRedirectUrl);
12845
+ };
12846
+ this.page = page;
12847
+ this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
12848
+ this.t = playwrightI18nextFixture.getI18nInstance().t;
12849
+ }
12850
+ }
12851
+
12684
12852
  const EMBED_SELECTORS = {
12685
12853
  iframe: (appName) => `#${appName}-iframe`,
12686
12854
  modal: (appName) => `#${appName}-modal`,
@@ -15760,87 +15928,6 @@ const LIST_MODIFIER_TAGS = {
15760
15928
  orderedList: "ol",
15761
15929
  };
15762
15930
 
15763
- const optionSelector = (option) => `neeto-editor-fixed-menu-${option}-option`;
15764
- const fixedMenuSelector = (selector) => `neeto-editor-fixed-menu-${selector}`;
15765
-
15766
- const NEETO_EDITOR_SELECTORS = {
15767
- fontSize: optionSelector("font-size"),
15768
- boldOption: optionSelector("bold"),
15769
- italicOption: optionSelector("italic"),
15770
- underlineOption: optionSelector("underline"),
15771
- strikeOption: optionSelector("strike"),
15772
- codeBlockOption: optionSelector("code"),
15773
- highlightOption: optionSelector("highlight"),
15774
- emojiOption: optionSelector("emoji"),
15775
- emojiDropdownIcon: "emoji-dropdown-icon",
15776
- linkInput: fixedMenuSelector("link-option-input"),
15777
- linkSubmitButton: fixedMenuSelector("link-option-link-button"),
15778
- commandList: (index) => `neeto-editor-command-list-item-${index}`,
15779
- imageUploadUrlSubmitButton: "neeto-editor-media-upload-url-submit",
15780
- imageUploadUrlInputTextField: "neeto-editor-media-upload-url-input",
15781
- uploadInput: "neeto-editor-media-uploader-input",
15782
- editorMenuBarWrapper: fixedMenuSelector("wrapper"),
15783
- undoOption: optionSelector("undo"),
15784
- redoOption: optionSelector("redo"),
15785
- imageWrapper: "neeto-editor-image-wrapper",
15786
- contentField: "neeto-editor-content",
15787
- addLinkButton: optionSelector("link"),
15788
- addLinkTextField: "neeto-editor-add-link-text-input",
15789
- addURLTextField: "neeto-editor-add-link-url-input",
15790
- submitLinkButton: "neeto-editor-add-link",
15791
- fixedMenuArrow: fixedMenuSelector("arrow"),
15792
- cannedResponseOption: optionSelector("canned-responses"),
15793
- cannedResponseSelectContainer: "select-a-canned-response-select-container",
15794
- fixedMenuWrapper: fixedMenuSelector("wrapper"),
15795
- linkOption: optionSelector("link"),
15796
- addLinkUrlInput: "neeto-editor-add-link-url-input",
15797
- addLinkDoneButton: "neeto-editor-add-link",
15798
- unlinkButton: "neeto-editor-link-popover-unlink",
15799
- editorAttachmentsButton: optionSelector("attachments"),
15800
- attachmentPreviewDeleteButton: "neeto-editor-preview-delete-button",
15801
- imageUploadOption: optionSelector("image-upload"),
15802
- imageUploadLinkInput: "neeto-editor-media-upload-url-input",
15803
- imageUploadButton: "neeto-editor-media-uploader-dnd",
15804
- imageUploadLinkSubmitButton: "neeto-editor-media-upload-url-submit",
15805
- applyButton: "apply-button",
15806
- videoEmbedOption: optionSelector("video-embed"),
15807
- videoEmbedInput: "neeto-editor-embed-input",
15808
- videoEmbedSubmit: "neeto-editor-embed-cancel",
15809
- videoWrapper: "neeto-editor-video-wrapper",
15810
- paragraphOption: fixedMenuSelector("font-size-option-body2"),
15811
- attachmentPreview: "ne-attachments-wrapper",
15812
- imageUploadLinkButton: "neeto-editor-media-uploader-link-tab",
15813
- errorText: "neeto-editor-error-text",
15814
- content: "editor-content",
15815
- imageUploadDeleteButton: "neeto-editor-image-menu-Delete",
15816
- dynamicVariablesButton: "dynamic-variables-button",
15817
- emojiContainer: "neeto-editor-emoji-picker",
15818
- dynamicVariableSelector: (variable) => `dynamic-variables-list-item-${neetoCist.hyphenate(variable)}`,
15819
- };
15820
- const NEETO_TEXT_MODIFIER_SELECTORS = {
15821
- strike: optionSelector("strike"),
15822
- underline: optionSelector("underline"),
15823
- highlight: optionSelector("highlight"),
15824
- };
15825
- const TEXT_MODIFIER_SELECTORS = {
15826
- bold: optionSelector("bold"),
15827
- italic: optionSelector("italic"),
15828
- code: optionSelector("code"),
15829
- blockquote: optionSelector("blockquote"),
15830
- codeBlock: optionSelector("codeBlock"),
15831
- };
15832
- const LIST_MODIFIER_SELECTORS = {
15833
- bulletList: optionSelector("bulletList"),
15834
- orderedList: optionSelector("orderedList"),
15835
- };
15836
- const FONT_SIZE_SELECTORS = {
15837
- h1: fixedMenuSelector("font-size-option-h1"),
15838
- h2: fixedMenuSelector("font-size-option-h2"),
15839
- h3: fixedMenuSelector("font-size-option-h3"),
15840
- h4: fixedMenuSelector("font-size-option-h4"),
15841
- h5: fixedMenuSelector("font-size-option-h5"),
15842
- };
15843
-
15844
15931
  class EditorPage {
15845
15932
  constructor(page, neetoPlaywrightUtilities, editorWrapper) {
15846
15933
  this.linkUrl = faker.faker.internet.url();
@@ -149175,14 +149262,17 @@ exports.SLACK_WEB_TEXTS = SLACK_WEB_TEXTS;
149175
149262
  exports.STORAGE_STATE = STORAGE_STATE;
149176
149263
  exports.SidebarSection = SidebarSection;
149177
149264
  exports.SlackPage = SlackPage;
149265
+ exports.TAB_SELECTORS = TAB_SELECTORS;
149178
149266
  exports.TAGS_SELECTORS = TAGS_SELECTORS;
149179
149267
  exports.TEXT_MODIFIER_ROLES = TEXT_MODIFIER_ROLES;
149180
149268
  exports.TEXT_MODIFIER_SELECTORS = TEXT_MODIFIER_SELECTORS;
149181
149269
  exports.TEXT_MODIFIER_TAGS = TEXT_MODIFIER_TAGS;
149270
+ exports.THANK_YOU_SELECTORS = THANK_YOU_SELECTORS;
149182
149271
  exports.THIRD_PARTY_ROUTES = THIRD_PARTY_ROUTES;
149183
149272
  exports.TOASTR_MESSAGES = TOASTR_MESSAGES;
149184
149273
  exports.TagsPage = TagsPage;
149185
149274
  exports.TeamMembers = TeamMembers;
149275
+ exports.ThankYouPage = ThankYouPage;
149186
149276
  exports.USER_AGENTS = USER_AGENTS;
149187
149277
  exports.WebhooksPage = WebhooksPage;
149188
149278
  exports.ZAPIER_LIMIT_EXHAUSTED_MESSAGE = ZAPIER_LIMIT_EXHAUSTED_MESSAGE;