@bigbinary/neeto-playwright-commons 1.9.19 → 1.9.21

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
@@ -1327,7 +1327,7 @@ declare class ZapierPage extends IntegrationBase {
1327
1327
  interface VerifyDescriptionEditorParams {
1328
1328
  text: string;
1329
1329
  linkUrl?: string;
1330
- fileName?: string;
1330
+ filePath?: string;
1331
1331
  attachedImageName?: string;
1332
1332
  imageUrl?: string;
1333
1333
  videoUrl?: string;
@@ -1350,10 +1350,34 @@ declare class EditorPage {
1350
1350
  videoWrapperSelector: Locator;
1351
1351
  emojiDropdownIcon: Locator;
1352
1352
  constructor(page: Page, neetoPlaywrightUtilities: CustomCommands);
1353
+ /**
1354
+ *
1355
+ * Used to verify description editor functionality
1356
+ *
1357
+ * text (required): The text to be filled in editor content field.
1358
+ *
1359
+ * linkUrl (optional): The url to be added when we select the button on the editor menu to link a url to a text. Default is faker.internet.url().
1360
+ *
1361
+ * filePath (optional): The file path to be added when we select the button on the editor menu to attach a file in the editor. Default is "../../../e2e/assets/images/BigBinary.png".
1362
+ *
1363
+ * imageUrl (optional): The url to be added when we select the button on the editor menu to upload an image in the editor. Default is https://picsum.photos/200/300.
1364
+ *
1365
+ * videoUrl (optional): The url to be added when we select the button on the editor menu to upload a video in the editor. Default is https://youtu.be/jNQXAC9IVRw.
1366
+ *
1367
+ * cannedResponseSuccessMessage (optional): The success toastr message after applying canned reesponse.
1368
+ *
1369
+ * @example
1370
+ *
1371
+ * await editorPage.verifyDescriptionEditor({
1372
+ * text: t("tickets.updated_one"),
1373
+ * cannedResponseSuccessMessage: t("messages.successCannedResponse"),
1374
+ * });
1375
+ * @endexample
1376
+ */
1353
1377
  verifyDescriptionEditor: ({
1354
1378
  text,
1355
1379
  linkUrl,
1356
- fileName,
1380
+ filePath,
1357
1381
  imageUrl,
1358
1382
  videoUrl,
1359
1383
  cannedResponseSuccessMessage
@@ -2502,6 +2526,8 @@ declare const networkConditions: Record<"Slow 3G" | "Fast 3G" | "No Throttling",
2502
2526
  * @endexample
2503
2527
  * copyButton: Selector for the copy button.
2504
2528
  *
2529
+ * resetButton: Selector for the reset button.
2530
+ *
2505
2531
  * spinner: Selector for spinners.
2506
2532
  *
2507
2533
  * subheaderText: Selector to get the subheader text.
@@ -2638,6 +2664,7 @@ declare const COMMON_SELECTORS: {
2638
2664
  pane: string;
2639
2665
  sideBar: string;
2640
2666
  copyButton: string;
2667
+ resetButton: string;
2641
2668
  spinner: string;
2642
2669
  subheaderText: string;
2643
2670
  alertTitle: string;
@@ -2757,6 +2784,10 @@ declare const COMMON_SELECTORS: {
2757
2784
  *
2758
2785
  * submitLinkButton: Selector for the submit link button.
2759
2786
  *
2787
+ * errorText: Selector for the error text.
2788
+ *
2789
+ * content: Selector for the editor content.
2790
+ *
2760
2791
  */
2761
2792
  declare const NEETO_EDITOR_SELECTORS: {
2762
2793
  boldOption: string;
@@ -2803,6 +2834,9 @@ declare const NEETO_EDITOR_SELECTORS: {
2803
2834
  paragraphOption: string;
2804
2835
  attachmentPreview: string;
2805
2836
  imageUploadLinkButton: string;
2837
+ errorText: string;
2838
+ content: string;
2839
+ imageUploadDeleteButton: string;
2806
2840
  };
2807
2841
  declare const NEETO_TEXT_MODIFIER_SELECTORS: {
2808
2842
  strikeOption: string;
package/index.js CHANGED
@@ -244,6 +244,7 @@ const COMMON_SELECTORS = {
244
244
  pane: "pane-wrapper",
245
245
  sideBar: "sidebar",
246
246
  copyButton: "copy-button",
247
+ resetButton: "reset-button",
247
248
  spinner: ".neeto-ui-spinner",
248
249
  subheaderText: "subheader-left",
249
250
  alertTitle: "alert-title",
@@ -14423,11 +14424,13 @@ const NEETO_EDITOR_SELECTORS = {
14423
14424
  videoEmbedOption: "neeto-editor-fixed-menu-video-embed-option",
14424
14425
  videoEmbedInput: "neeto-editor-embed-input",
14425
14426
  videoEmbedSubmit: "neeto-editor-embed-cancel",
14426
- // TODO: Fix the selector after the issue is resolved: https://github.com/bigbinary/neeto-editor/issues/1047
14427
- videoWrapper: ".neeto-editor__video-wrapper",
14427
+ videoWrapper: "neeto-editor-video-wrapper",
14428
14428
  paragraphOption: "neeto-editor-fixed-menu-font-size-option-body2",
14429
14429
  attachmentPreview: "ne-attachments-wrapper",
14430
14430
  imageUploadLinkButton: "neeto-editor-media-uploader-link-tab",
14431
+ errorText: "neeto-editor-error-text",
14432
+ content: "editor-content",
14433
+ imageUploadDeleteButton: "neeto-editor-image-menu-Delete",
14431
14434
  };
14432
14435
  const NEETO_TEXT_MODIFIER_SELECTORS = {
14433
14436
  strikeOption: "neeto-editor-fixed-menu-strike-option",
@@ -14456,7 +14459,7 @@ const FONT_SIZE_SELECTORS = {
14456
14459
  /* eslint-disable playwright/no-nth-methods */
14457
14460
  class EditorPage {
14458
14461
  constructor(page, neetoPlaywrightUtilities) {
14459
- this.verifyDescriptionEditor = async ({ text, linkUrl = faker.internet.url(), fileName = "../../../e2e/assets/images/BigBinary.png", imageUrl = "https://picsum.photos/200/300", videoUrl = "https://youtu.be/jNQXAC9IVRw", cannedResponseSuccessMessage, }) => {
14462
+ this.verifyDescriptionEditor = async ({ text, linkUrl = faker.internet.url(), filePath = "../../../e2e/assets/images/BigBinary.png", imageUrl = "https://picsum.photos/200/300", videoUrl = "https://youtu.be/jNQXAC9IVRw", cannedResponseSuccessMessage, }) => {
14460
14463
  await this.page.getByTestId(NEETO_EDITOR_SELECTORS.contentField).fill(text);
14461
14464
  await this.page
14462
14465
  .getByTestId(NEETO_EDITOR_SELECTORS.fontSizeDropdown())
@@ -14537,7 +14540,7 @@ class EditorPage {
14537
14540
  const fileUploaderPromise = this.page.waitForEvent("filechooser");
14538
14541
  await this.editorAttachmentsButton.click();
14539
14542
  const fileUploader = await fileUploaderPromise;
14540
- const imagePath = Path.join(__dirname, fileName);
14543
+ const imagePath = Path.join(__dirname, filePath);
14541
14544
  await fileUploader.setFiles(imagePath);
14542
14545
  await this.neetoPlaywrightUtilities.interceptMultipleResponses({
14543
14546
  responseUrl: ROUTES.attachment,
@@ -14564,7 +14567,7 @@ class EditorPage {
14564
14567
  .getByTestId(NEETO_EDITOR_SELECTORS.imageUploadButton)
14565
14568
  .click();
14566
14569
  const fileUploader = await fileUploaderPromise;
14567
- const imagePath = Path.join(__dirname, fileName);
14570
+ const imagePath = Path.join(__dirname, filePath);
14568
14571
  await fileUploader.setFiles(imagePath);
14569
14572
  await expect(this.imageWrapper).toBeVisible({ timeout: 15000 });
14570
14573
  await this.neetoPlaywrightUtilities.verifySuccessToast();
@@ -14645,16 +14648,11 @@ class EditorPage {
14645
14648
  this.attachmentPreview = this.page.getByTestId(NEETO_EDITOR_SELECTORS.attachmentPreview);
14646
14649
  this.editorAttachmentsButton = this.page.getByTestId(NEETO_EDITOR_SELECTORS.editorAttachmentsButton);
14647
14650
  this.imageWrapper = this.page.getByTestId(NEETO_EDITOR_SELECTORS.imageWrapper);
14648
- // TODO: Fix the selector after the issue is resolved: https://github.com/bigbinary/neeto-editor/issues/1047
14649
- this.imageUploadDeleteButton = this.page
14650
- .getByTestId(COMMON_SELECTORS.dropdownContainer)
14651
- .getByRole("button")
14652
- .nth(3);
14651
+ this.imageUploadDeleteButton = this.page.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadDeleteButton);
14653
14652
  this.imageUploadOption = this.page.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadOption);
14654
14653
  this.cannedResponseOption = this.page.getByTestId(NEETO_EDITOR_SELECTORS.cannedResponseOption);
14655
14654
  this.videoEmbedOption = this.page.getByTestId(NEETO_EDITOR_SELECTORS.videoEmbedOption);
14656
- // TODO: Fix the selector after the issue is resolved: https://github.com/bigbinary/neeto-editor/issues/1047
14657
- this.videoWrapperSelector = this.page.locator(NEETO_EDITOR_SELECTORS.videoWrapper);
14655
+ this.videoWrapperSelector = this.page.getByTestId(NEETO_EDITOR_SELECTORS.videoWrapper);
14658
14656
  this.emojiDropdownIcon = this.page
14659
14657
  .getByTestId(NEETO_EDITOR_SELECTORS.fixedMenuWrapper)
14660
14658
  .getByTestId(COMMON_SELECTORS.dropdownIcon);