@bigbinary/neeto-playwright-commons 1.9.2 → 1.9.4

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
@@ -222,6 +222,16 @@ declare class CustomCommands {
222
222
  countSelector,
223
223
  countText
224
224
  }: SearchAndVerifyProps) => Promise<void>;
225
+ /**
226
+ *
227
+ * Command to upload an image to image uploader and verify it.
228
+ *
229
+ * @example
230
+ *
231
+ * await neetoPlaywrightUtilities.uploadImage("../assets/image.png");
232
+ * @endexample
233
+ */
234
+ uploadImage: (localImagePath: string) => Promise<void>;
225
235
  }
226
236
  interface EmailContentParams {
227
237
  email: string;
@@ -616,6 +626,249 @@ declare class ZapierPage extends IntegrationBase {
616
626
  }) => Promise<string>;
617
627
  disconnectAndVerify: () => Promise<void>;
618
628
  }
629
+ interface VerifyDescriptionEditorParams {
630
+ text: string;
631
+ linkUrl?: string;
632
+ fileName?: string;
633
+ attachedImageName?: string;
634
+ imageUrl?: string;
635
+ videoUrl?: string;
636
+ cannedResponseSuccessMessage?: string;
637
+ }
638
+ declare class EditorPage {
639
+ page: Page;
640
+ neetoPlaywrightUtilities: CustomCommands;
641
+ t: TFunction;
642
+ paragraphSelector: Locator;
643
+ fixedMenuArrowSelector: Locator;
644
+ editorLinkButton: Locator;
645
+ attachmentPreview: Locator;
646
+ editorAttachmentsButton: Locator;
647
+ imageUploadDeleteButton: Locator;
648
+ imageWrapper: Locator;
649
+ imageUploadOption: Locator;
650
+ cannedResponseOption: Locator;
651
+ videoEmbedOption: Locator;
652
+ videoWrapperSelector: Locator;
653
+ emojiDropdownIcon: Locator;
654
+ constructor(page: Page, neetoPlaywrightUtilities: CustomCommands);
655
+ verifyDescriptionEditor: ({
656
+ text,
657
+ linkUrl,
658
+ fileName,
659
+ imageUrl,
660
+ videoUrl,
661
+ cannedResponseSuccessMessage
662
+ }: VerifyDescriptionEditorParams) => Promise<void>;
663
+ }
664
+ interface CropImageProps {
665
+ toggleAspectRatioLock: boolean;
666
+ aspectRatioHeight: string;
667
+ aspectRatioWidth: string;
668
+ width: string;
669
+ height: string;
670
+ }
671
+ interface ImageLibraryProps extends Partial<CropImageProps> {
672
+ toggleOrginalImage?: boolean;
673
+ localImagePath: string;
674
+ }
675
+ interface SelectImage extends CropImageProps {
676
+ toggleOrginalImage: boolean;
677
+ searchTerm: string;
678
+ nthImage: number;
679
+ }
680
+ declare class ImageUploader {
681
+ page: Page;
682
+ neetoPlaywrightUtilities: CustomCommands;
683
+ constructor({
684
+ page,
685
+ neetoPlaywrightUtilities
686
+ }: {
687
+ page: Page;
688
+ neetoPlaywrightUtilities: CustomCommands;
689
+ });
690
+ private submitCroppedImage;
691
+ /**
692
+ *
693
+ * Used to remove an image already uploaded from the image uploader amd verify it.
694
+ *
695
+ * @example
696
+ *
697
+ * await imageUploader.removeImage()
698
+ * @endexample
699
+ */
700
+ removeImage: () => Promise<void>;
701
+ /**
702
+ *
703
+ * Used to open the image library modal.
704
+ *
705
+ * @example
706
+ *
707
+ * await imageUploader.openImageLibrary()
708
+ * @endexample
709
+ */
710
+ openImageLibrary: () => Promise<void>;
711
+ /**
712
+ *
713
+ * Used to crop the image. It takes the following parameters:
714
+ *
715
+ * toggleAspectRatioLock (optional): A boolean value to toggle the aspect ratio lock switch which is checked by default. Default is false.
716
+ *
717
+ * aspectRatioHeight (optional): The height of the aspect ratio. Default is 9.
718
+ *
719
+ * aspectRatioWidth (optional): The width of the aspect ratio. Default is 16.
720
+ *
721
+ * width (optional): The width of the cropped image. Default is 100.
722
+ *
723
+ * height (optional): The height of the cropped image. Default is 100.
724
+ *
725
+ * @example
726
+ *
727
+ * await imageUploader.cropImage({
728
+ * toggleAspectRatioLock: false
729
+ * aspectRatioHeight: "9",
730
+ * aspectRatioWidth: "16",
731
+ * width: "100",
732
+ * height: "100",
733
+ * })
734
+ * @endexample
735
+ */
736
+ cropImage: ({
737
+ toggleAspectRatioLock,
738
+ width,
739
+ height,
740
+ aspectRatioHeight,
741
+ aspectRatioWidth
742
+ }?: Partial<CropImageProps>) => Promise<void>;
743
+ /**
744
+ *
745
+ * Used to upload a new image from the library and crop it if required. It takes the following parameters:
746
+ *
747
+ * localImagePath: The path of the image to be uploaded.
748
+ *
749
+ * toggleOrginalImage (optional): A boolean value to toggle the original image switch which is not checked by default. Default is false.
750
+ *
751
+ * toggleAspectRatioLock (optional): A boolean value to toggle the aspect ratio lock switch which is checked by default. Default is false.
752
+ *
753
+ * aspectRatioHeight (optional): The height of the aspect ratio. Default is 9.
754
+ *
755
+ * aspectRatioWidth (optional): The width of the aspect ratio. Default is 16.
756
+ *
757
+ * width (optional): The width of the cropped image. Default is 100.
758
+ *
759
+ * height (optional): The height of the cropped image. Default is 100.
760
+ *
761
+ * @example
762
+ *
763
+ * await imageUploader.uploadNewImageFromLibrary({
764
+ * localImagePath,
765
+ * toggleOrginalImage: false,
766
+ * toggleAspectRatioLock: false,
767
+ * aspectRatioHeight: "9",
768
+ * aspectRatioWidth: "16",
769
+ * width: "100",
770
+ * height: "100",
771
+ * })
772
+ * @endexample
773
+ */
774
+ uploadNewImageFromLibrary: ({
775
+ localImagePath,
776
+ toggleOrginalImage,
777
+ toggleAspectRatioLock,
778
+ aspectRatioHeight,
779
+ aspectRatioWidth,
780
+ width,
781
+ height
782
+ }: ImageLibraryProps) => Promise<void>;
783
+ /**
784
+ *
785
+ * Used to select an image from the unsplash and crop it if required. It takes the following parameters:
786
+ *
787
+ * nthImage (optional): The index of the image to be selected. Default is 0.
788
+ *
789
+ * searchTerm (optional): The input for the search field.
790
+ *
791
+ * toggleOrginalImage (optional): A boolean value to toggle the original image switch which is not checked by default. Default is false.
792
+ *
793
+ * toggleAspectRatioLock (optional): A boolean value to toggle the aspect ratio lock switch which is checked by default. Default is false.
794
+ *
795
+ * aspectRatioHeight (optional): The height of the aspect ratio. Default is 9.
796
+ *
797
+ * aspectRatioWidth (optional): The width of the aspect ratio. Default is 16.
798
+ *
799
+ * width (optional): The width of the cropped image. Default is 100.
800
+ *
801
+ * height (optional): The height of the cropped image. Default is 100.
802
+ *
803
+ * @example
804
+ *
805
+ * await imageUploader.selectImageFromWeb({
806
+ * nthImage: 0,
807
+ * searchTerm: "",
808
+ * toggleOrginalImage: false,
809
+ * toggleAspectRatioLock: false,
810
+ * aspectRatioHeight: "9",
811
+ * aspectRatioWidth: "16",
812
+ * width: "100",
813
+ * height: "100",
814
+ * })
815
+ * @endexample
816
+ */
817
+ selectImageFromWeb: ({
818
+ nthImage,
819
+ searchTerm,
820
+ toggleOrginalImage,
821
+ toggleAspectRatioLock,
822
+ aspectRatioHeight,
823
+ aspectRatioWidth,
824
+ width,
825
+ height
826
+ }?: Partial<SelectImage>) => Promise<void>;
827
+ /**
828
+ *
829
+ * Used to select an image from the library and crop it if required. It takes the following parameters
830
+ *
831
+ * nthImage (optional): The index of the image to be selected. Default is 0.
832
+ *
833
+ * searchTerm (optional): The input for the search field.
834
+ *
835
+ * toggleOrginalImage (optional): A boolean value to toggle the original image switch which is not checked by default. Default is false.
836
+ *
837
+ * toggleAspectRatioLock (optional): A boolean value to toggle the aspect ratio lock switch which is checked by default. Default is false.
838
+ *
839
+ * aspectRatioHeight (optional): The height of the aspect ratio. Default is 9.
840
+ *
841
+ * aspectRatioWidth (optional): The width of the aspect ratio. Default is 16.
842
+ *
843
+ * width (optional): The width of the cropped image. Default is 100.
844
+ *
845
+ * height (optional): The height of the cropped image. Default is 100.
846
+ *
847
+ * @example
848
+ *
849
+ * await imageUploader.selectImageFromLibrary({
850
+ * nthImage: 0,
851
+ * searchTerm: "",
852
+ * toggleOrginalImage: false,
853
+ * toggleAspectRatioLock: false,
854
+ * aspectRatioHeight: "9",
855
+ * aspectRatioWidth: "16",
856
+ * width: "100",
857
+ * height: "100",
858
+ * })
859
+ * @endexample
860
+ */
861
+ selectImageFromLibrary: ({
862
+ nthImage,
863
+ searchTerm,
864
+ toggleOrginalImage,
865
+ toggleAspectRatioLock,
866
+ aspectRatioHeight,
867
+ aspectRatioWidth,
868
+ width,
869
+ height
870
+ }?: Partial<SelectImage>) => Promise<void>;
871
+ }
619
872
  interface BasicUserInfo {
620
873
  firstName: string;
621
874
  lastName: string;
@@ -751,12 +1004,14 @@ declare const ROUTES: {
751
1004
  subdomainAvailability: string;
752
1005
  countries: string;
753
1006
  neetoApps: string;
1007
+ directUploads: string;
754
1008
  teamMembers: {
755
1009
  all: string;
756
1010
  bulkUpdate: string;
757
1011
  index: string;
758
1012
  show: (id: string) => string;
759
1013
  };
1014
+ attachment: string;
760
1015
  };
761
1016
  declare const API_ROUTES: {
762
1017
  teamMembers: {
@@ -784,6 +1039,9 @@ declare const THIRD_PARTY_ROUTES: {
784
1039
  zapEditor: (zapId: string) => string;
785
1040
  };
786
1041
  };
1042
+ declare const NEETO_ROUTES: {
1043
+ imageUploader: string;
1044
+ };
787
1045
  declare const networkConditions: Record<"Slow 3G" | "Fast 3G" | "No Throttling", Protocol.Network.emulateNetworkConditionsParameters>;
788
1046
  /**
789
1047
  *
@@ -893,6 +1151,51 @@ declare const NEETO_EDITOR_SELECTORS: {
893
1151
  addLinkTextField: string;
894
1152
  addURLTextField: string;
895
1153
  submitLinkButton: string;
1154
+ fontSizeDropdown: (currentOption?: string) => string;
1155
+ fixedMenuArrow: string;
1156
+ cannedResponseOption: string;
1157
+ cannedResponseSelectContainer: string;
1158
+ fixedMenuWrapper: string;
1159
+ linkOption: string;
1160
+ addLinkUrlInput: string;
1161
+ addLinkDoneButton: string;
1162
+ unlinkButton: string;
1163
+ editorAttachmentsButton: string;
1164
+ attachmentPreviewDeleteButton: string;
1165
+ imageUploadOption: string;
1166
+ imageUploadLinkInput: string;
1167
+ imageUploadButton: string;
1168
+ imageUploadLinkSubmitButton: string;
1169
+ applyButton: string;
1170
+ videoEmbedOption: string;
1171
+ videoEmbedInput: string;
1172
+ videoEmbedSubmit: string;
1173
+ videoWrapper: string;
1174
+ paragraphOption: string;
1175
+ attachmentPreview: string;
1176
+ };
1177
+ declare const NEETO_TEXT_MODIFIER_SELECTORS: {
1178
+ strikeOption: string;
1179
+ underlineOption: string;
1180
+ highlightOption: string;
1181
+ };
1182
+ declare const TEXT_MODIFIER_SELECTORS: {
1183
+ boldOption: string;
1184
+ italicsOption: string;
1185
+ codeOption: string;
1186
+ blockquoteOption: string;
1187
+ codeblockOption: string;
1188
+ };
1189
+ declare const LIST_MODIFIER_SELECTORS: {
1190
+ bulletListOption: string;
1191
+ orderedListOption: string;
1192
+ };
1193
+ declare const FONT_SIZE_SELECTORS: {
1194
+ h1: string;
1195
+ h2: string;
1196
+ h3: string;
1197
+ h4: string;
1198
+ h5: string;
896
1199
  };
897
1200
  declare const NEETO_FILTERS_SELECTORS: {
898
1201
  emailSelectContainer: string;
@@ -1142,6 +1445,33 @@ declare const EMBED_SELECTORS: {
1142
1445
  elementIdInput: string;
1143
1446
  previewElementPopupButton: string;
1144
1447
  };
1448
+ declare const NEETO_IMAGE_UPLOADER_SELECTORS: {
1449
+ imageUploaderWrapper: string;
1450
+ browseText: string;
1451
+ fileInput: string;
1452
+ uploadedImage: string;
1453
+ uploadNewAsset: string;
1454
+ basicImageUploaderRemoveButton: string;
1455
+ removeButton: string;
1456
+ openImageLibraryButton: string;
1457
+ openAssetLibraryButton: string;
1458
+ imageEditorBackButton: string;
1459
+ aspectRatioWidthInput: string;
1460
+ aspectRatioHeightInput: string;
1461
+ cropSubmitButton: string;
1462
+ restrictionMessage: string;
1463
+ progressBar: string;
1464
+ myImagesTab: string;
1465
+ unsplashTab: string;
1466
+ nthLibraryImage: (index: number) => string;
1467
+ nthUnsplashImage: (index: number) => string;
1468
+ unsplashSearchInput: string;
1469
+ imageEditorUploadedImage: string;
1470
+ selectOriginalImageSwitch: string;
1471
+ lockAspectRatioSwitch: string;
1472
+ widthInputField: string;
1473
+ heightInputField: string;
1474
+ };
1145
1475
  declare const CHAT_WIDGET_TEXTS: {
1146
1476
  newConversation: string;
1147
1477
  welcomeChatBubble: string;
@@ -1190,6 +1520,43 @@ declare const TOASTR_MESSAGES: {
1190
1520
  zapierApiKeyGenerated: string;
1191
1521
  };
1192
1522
  declare const ZAPIER_LIMIT_EXHAUSTED_MESSAGE = "Zapier free task limit is exhausted. Test will be aborted";
1523
+ declare const EMOJI_PICKER_LABEL = "Smileys & People";
1524
+ declare const ATTACHMENT_DELETION_TOASTR_MESSAGE = "Attachment has been successfully deleted.";
1525
+ declare const DESCRIPTION_EDITOR_TEXTS: {
1526
+ fontSize: string;
1527
+ paragraph: string;
1528
+ pasteLink: string;
1529
+ invalidURLError: string;
1530
+ pasteURL: string;
1531
+ delete: string;
1532
+ linkTag: string;
1533
+ link: string;
1534
+ cannedResponseHeader: string;
1535
+ paragraphOption: string;
1536
+ };
1537
+ declare const EXPANDED_FONT_SIZE: {
1538
+ h1: string;
1539
+ h2: string;
1540
+ h3: string;
1541
+ h4: string;
1542
+ h5: string;
1543
+ };
1544
+ declare const TEXT_MODIFIER_TAGS: {
1545
+ underlineOption: string;
1546
+ strikeOption: string;
1547
+ highlightOption: string;
1548
+ };
1549
+ declare const TEXT_MODIFIER_ROLES: {
1550
+ boldOption: string;
1551
+ italicsOption: string;
1552
+ blockquoteOption: string;
1553
+ codeblockOption: string;
1554
+ codeOption: string;
1555
+ };
1556
+ declare const LIST_MODIFIER_TAGS: {
1557
+ bulletListOption: string;
1558
+ orderedListOption: string;
1559
+ };
1193
1560
  /**
1194
1561
  *
1195
1562
  * Function to initialize credentials of the current user in the storageState.
@@ -1437,6 +1804,21 @@ declare const hexToRGB: (hex: string) => string;
1437
1804
  declare const filterUtils: {
1438
1805
  openFilterPane: (page: Page) => Promise<void>;
1439
1806
  };
1807
+ /**
1808
+ *
1809
+ * Function to get the image path and name from the image in a given path.
1810
+ *
1811
+ * @example
1812
+ *
1813
+ * import { getImagePathAndName } from "@bigbinary/neeto-playwright-commons";
1814
+ *
1815
+ * const { imagePath, imageName } = getImagePathAndName("../assets/images/image.png");
1816
+ * @endexample
1817
+ */
1818
+ declare const getImagePathAndName: (localImagePath: string) => {
1819
+ imagePath: string;
1820
+ imageName: string;
1821
+ };
1440
1822
  interface CurrentsOverrides {
1441
1823
  projectId: string;
1442
1824
  }
@@ -1465,4 +1847,4 @@ interface Overrides {
1465
1847
  * @endexample
1466
1848
  */
1467
1849
  declare const definePlaywrightConfig: (overrides: Overrides) => _playwright_test.PlaywrightTestConfig<{}, {}>;
1468
- export { API_ROUTES, BASE_URL, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COMMON_SELECTORS, CREDENTIALS, CustomCommands, type CustomFixture, EMBED_SELECTORS, ENVIRONMENT, EmbedBase, GLOBAL_TRANSLATIONS_PATTERN, HELP_CENTER_SELECTORS, HelpAndProfilePage, INTEGRATIONS_TEXTS, INTEGRATION_SELECTORS, IS_STAGING_ENV, IntegrationBase, KEYBOARD_SHORTCUTS_SELECTORS, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MEMBER_TEXTS, MERGE_TAGS_SELECTORS, MailosaurUtils, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, OTP_EMAIL_PATTERN, OrganizationPage, PROFILE_SECTION_SELECTORS, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, SIGNUP_SELECTORS, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STORAGE_STATE, SidebarSection, SlackPage, TAGS_SELECTORS, THIRD_PARTY_ROUTES, TOASTR_MESSAGES, USER_AGENTS, WebhooksPage, ZAPIER_LIMIT_EXHAUSTED_MESSAGE, ZAPIER_SELECTORS, ZAPIER_TEST_EMAIL, ZAPIER_WEB_TEXTS, ZapierPage, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, filterUtils, generateRandomBypassEmail, generateStagingData, getByDataQA, getGlobalUserState, headerUtils, hexToRGB, hyphenize, i18nFixture, initializeCredentials, initializeTotp, joinHyphenCase, joinString, login, loginWithoutSSO, memberUtils, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, shouldSkipSetupAndTeardown, skipTest, squish, _default as stealthTest, tableUtils, toCamelCase, updateCredentials, writeDataToFile };
1850
+ export { API_ROUTES, ATTACHMENT_DELETION_TOASTR_MESSAGE, BASE_URL, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COMMON_SELECTORS, CREDENTIALS, CustomCommands, type CustomFixture, DESCRIPTION_EDITOR_TEXTS, EMBED_SELECTORS, EMOJI_PICKER_LABEL, ENVIRONMENT, EXPANDED_FONT_SIZE, EditorPage, EmbedBase, FONT_SIZE_SELECTORS, GLOBAL_TRANSLATIONS_PATTERN, HELP_CENTER_SELECTORS, HelpAndProfilePage, INTEGRATIONS_TEXTS, INTEGRATION_SELECTORS, IS_STAGING_ENV, ImageUploader, IntegrationBase, KEYBOARD_SHORTCUTS_SELECTORS, LIST_MODIFIER_SELECTORS, LIST_MODIFIER_TAGS, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MEMBER_TEXTS, MERGE_TAGS_SELECTORS, MailosaurUtils, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, NEETO_IMAGE_UPLOADER_SELECTORS, NEETO_ROUTES, NEETO_TEXT_MODIFIER_SELECTORS, OTP_EMAIL_PATTERN, OrganizationPage, PROFILE_SECTION_SELECTORS, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, SIGNUP_SELECTORS, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STORAGE_STATE, SidebarSection, SlackPage, TAGS_SELECTORS, TEXT_MODIFIER_ROLES, TEXT_MODIFIER_SELECTORS, TEXT_MODIFIER_TAGS, THIRD_PARTY_ROUTES, TOASTR_MESSAGES, USER_AGENTS, WebhooksPage, ZAPIER_LIMIT_EXHAUSTED_MESSAGE, ZAPIER_SELECTORS, ZAPIER_TEST_EMAIL, ZAPIER_WEB_TEXTS, ZapierPage, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, filterUtils, generateRandomBypassEmail, generateStagingData, getByDataQA, getGlobalUserState, getImagePathAndName, headerUtils, hexToRGB, hyphenize, i18nFixture, initializeCredentials, initializeTotp, joinHyphenCase, joinString, login, loginWithoutSSO, memberUtils, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, shouldSkipSetupAndTeardown, skipTest, squish, _default as stealthTest, tableUtils, toCamelCase, updateCredentials, writeDataToFile };