@bigbinary/neeto-playwright-commons 1.26.4 → 1.26.5

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.js CHANGED
@@ -2,6 +2,7 @@ import { keysToSnakeCase, hyphenate, isPresent, isNotPresent, humanize, dynamicA
2
2
  import { faker } from '@faker-js/faker';
3
3
  import * as require$$0$3 from 'fs';
4
4
  import require$$0__default, { readFileSync, promises, existsSync, writeFileSync, unlinkSync } from 'fs';
5
+ import require$$0$5 from 'os';
5
6
  import * as path$1 from 'path';
6
7
  import path__default from 'path';
7
8
  import test, { expect, test as test$1, chromium as chromium$1, defineConfig, devices } from '@playwright/test';
@@ -10,15 +11,14 @@ import require$$0$4 from 'util';
10
11
  import { curry, not, isEmpty, pluck, mergeDeepLeft, isNil, isNotNil, mergeAll } from 'ramda';
11
12
  import { execSync } from 'child_process';
12
13
  import dayjs from 'dayjs';
13
- import require$$0$6 from 'stream';
14
+ import require$$0$7 from 'stream';
14
15
  import { createRequire } from 'node:module';
15
- import require$$0$5 from 'buffer';
16
+ import require$$0$6 from 'buffer';
16
17
  import require$$1$2 from 'string_decoder';
17
- import require$$0$7 from 'crypto';
18
+ import require$$0$8 from 'crypto';
18
19
  import require$$1$3 from 'zlib';
19
- import require$$0$8 from 'assert';
20
+ import require$$0$9 from 'assert';
20
21
  import require$$0$a from 'tty';
21
- import require$$0$9 from 'os';
22
22
  import stealth$1 from 'puppeteer-extra-plugin-stealth';
23
23
  import require$$1$4 from 'events';
24
24
  import timezone from 'dayjs/plugin/timezone';
@@ -4975,6 +4975,8 @@ const NEETO_EDITOR_SELECTORS = {
4975
4975
  neetoEditorHighlightTextColor: (textColorIndex) => `neeto-editor-highlight-text-color-dot-${textColorIndex}`,
4976
4976
  neetoEditorHighlightBgColor: (bgColorIndex) => `neeto-editor-highlight-background-color-dot-${bgColorIndex}`,
4977
4977
  todoList: "[data-type='todoList']",
4978
+ commandListItem: (index) => `neeto-editor-command-list-item-${index}`,
4979
+ itemBlockHeading: "neeto-editor-command-list-item-block-heading",
4978
4980
  };
4979
4981
  const NEETO_TEXT_MODIFIER_SELECTORS = {
4980
4982
  strike: optionSelector("strike"),
@@ -5854,6 +5856,20 @@ class CustomCommands {
5854
5856
  isChecked !== shouldBeChecked && (await locator.click());
5855
5857
  await expect(locator).toBeChecked({ checked: shouldBeChecked });
5856
5858
  }).toPass({ timeout: 15000 });
5859
+ this.moveCursorAtBottom = async () => {
5860
+ const platform = require$$0$5.platform();
5861
+ if (platform === "darwin") {
5862
+ await this.page.keyboard.press("Meta+ArrowRight");
5863
+ await this.page.keyboard.press("Meta+ArrowDown");
5864
+ }
5865
+ else {
5866
+ await this.page.keyboard.press("End");
5867
+ await this.page.keyboard.press("PageDown");
5868
+ }
5869
+ // eslint-disable-next-line playwright/no-wait-for-timeout
5870
+ await this.page.waitForTimeout(100); // Adding some delay for DOM to react
5871
+ await this.page.keyboard.press("Enter");
5872
+ };
5857
5873
  this.page = page;
5858
5874
  this.responses = [];
5859
5875
  this.request = request;
@@ -5880,7 +5896,7 @@ function requireSafer () {
5880
5896
  if (hasRequiredSafer) return safer_1;
5881
5897
  hasRequiredSafer = 1;
5882
5898
 
5883
- var buffer = require$$0$5;
5899
+ var buffer = require$$0$6;
5884
5900
  var Buffer = buffer.Buffer;
5885
5901
 
5886
5902
  var safer = {};
@@ -27521,7 +27537,7 @@ function requireMimeNode () {
27521
27537
  const libmime = requireLibmime();
27522
27538
  const libqp = requireLibqp();
27523
27539
  const libbase64 = requireLibbase64();
27524
- const PassThrough = require$$0$6.PassThrough;
27540
+ const PassThrough = require$$0$7.PassThrough;
27525
27541
  const pathlib = path__default;
27526
27542
 
27527
27543
  class MimeNode {
@@ -27790,7 +27806,7 @@ function requireMessageSplitter () {
27790
27806
  if (hasRequiredMessageSplitter) return messageSplitter;
27791
27807
  hasRequiredMessageSplitter = 1;
27792
27808
 
27793
- const Transform = require$$0$6.Transform;
27809
+ const Transform = require$$0$7.Transform;
27794
27810
  const MimeNode = requireMimeNode();
27795
27811
 
27796
27812
  const MAX_HEAD_SIZE = 1 * 1024 * 1024;
@@ -28220,7 +28236,7 @@ function requireMessageJoiner () {
28220
28236
  if (hasRequiredMessageJoiner) return messageJoiner;
28221
28237
  hasRequiredMessageJoiner = 1;
28222
28238
 
28223
- const Transform = require$$0$6.Transform;
28239
+ const Transform = require$$0$7.Transform;
28224
28240
 
28225
28241
  class MessageJoiner extends Transform {
28226
28242
  constructor() {
@@ -28260,7 +28276,7 @@ function requireFlowedDecoder () {
28260
28276
 
28261
28277
  // Helper class to rewrite nodes with specific mime type
28262
28278
 
28263
- const Transform = require$$0$6.Transform;
28279
+ const Transform = require$$0$7.Transform;
28264
28280
  const libmime = requireLibmime();
28265
28281
 
28266
28282
  /**
@@ -28323,7 +28339,7 @@ function requireNodeRewriter () {
28323
28339
 
28324
28340
  // Helper class to rewrite nodes with specific mime type
28325
28341
 
28326
- const Transform = require$$0$6.Transform;
28342
+ const Transform = require$$0$7.Transform;
28327
28343
  const FlowedDecoder = requireFlowedDecoder();
28328
28344
 
28329
28345
  /**
@@ -28525,7 +28541,7 @@ function requireNodeStreamer () {
28525
28541
 
28526
28542
  // Helper class to rewrite nodes with specific mime type
28527
28543
 
28528
- const Transform = require$$0$6.Transform;
28544
+ const Transform = require$$0$7.Transform;
28529
28545
  const FlowedDecoder = requireFlowedDecoder();
28530
28546
 
28531
28547
  /**
@@ -28652,7 +28668,7 @@ function requireChunkedPassthrough () {
28652
28668
  if (hasRequiredChunkedPassthrough) return chunkedPassthrough;
28653
28669
  hasRequiredChunkedPassthrough = 1;
28654
28670
 
28655
- const { Transform } = require$$0$6;
28671
+ const { Transform } = require$$0$7;
28656
28672
 
28657
28673
  class ChunkedPassthrough extends Transform {
28658
28674
  constructor(options = {}) {
@@ -29548,8 +29564,8 @@ function requireStreamHash () {
29548
29564
  if (hasRequiredStreamHash) return streamHash;
29549
29565
  hasRequiredStreamHash = 1;
29550
29566
 
29551
- const crypto = require$$0$7;
29552
- const Transform = require$$0$6.Transform;
29567
+ const crypto = require$$0$8;
29568
+ const Transform = require$$0$7.Transform;
29553
29569
 
29554
29570
  class StreamHash extends Transform {
29555
29571
  constructor(attachment, algo) {
@@ -51932,7 +51948,7 @@ function requireMailParser () {
51932
51948
  const mailsplit = requireMailsplit();
51933
51949
  const libmime = requireLibmime();
51934
51950
  const addressparser = requireAddressparser();
51935
- const Transform = require$$0$6.Transform;
51951
+ const Transform = require$$0$7.Transform;
51936
51952
  const Splitter = mailsplit.Splitter;
51937
51953
  const ChunkedPassthrough = mailsplit.ChunkedPassthrough;
51938
51954
  const punycode = require$$4$2;
@@ -66486,7 +66502,7 @@ function requireChunkstream () {
66486
66502
  hasRequiredChunkstream = 1;
66487
66503
 
66488
66504
  let util = require$$0$4;
66489
- let Stream = require$$0$6;
66505
+ let Stream = require$$0$7;
66490
66506
 
66491
66507
  let ChunkStream = (chunkstream.exports = function () {
66492
66508
  Stream.call(this);
@@ -68455,7 +68471,7 @@ function requirePackerAsync () {
68455
68471
  hasRequiredPackerAsync = 1;
68456
68472
 
68457
68473
  let util = require$$0$4;
68458
- let Stream = require$$0$6;
68474
+ let Stream = require$$0$7;
68459
68475
  let constants = requireConstants$4();
68460
68476
  let Packer = requirePacker();
68461
68477
 
@@ -68516,11 +68532,11 @@ function requireSyncInflate () {
68516
68532
  hasRequiredSyncInflate = 1;
68517
68533
  (function (module, exports) {
68518
68534
 
68519
- let assert = require$$0$8.ok;
68535
+ let assert = require$$0$9.ok;
68520
68536
  let zlib = require$$1$3;
68521
68537
  let util = require$$0$4;
68522
68538
 
68523
- let kMaxLength = require$$0$5.kMaxLength;
68539
+ let kMaxLength = require$$0$6.kMaxLength;
68524
68540
 
68525
68541
  function Inflate(opts) {
68526
68542
  if (!(this instanceof Inflate)) {
@@ -68977,7 +68993,7 @@ function requirePng () {
68977
68993
  hasRequiredPng = 1;
68978
68994
 
68979
68995
  let util = require$$0$4;
68980
- let Stream = require$$0$6;
68996
+ let Stream = require$$0$7;
68981
68997
  let Parser = requireParserAsync();
68982
68998
  let Packer = requirePackerAsync();
68983
68999
  let PNGSync = requirePngSync();
@@ -104698,7 +104714,7 @@ var hasRequiredSupportsColor;
104698
104714
  function requireSupportsColor () {
104699
104715
  if (hasRequiredSupportsColor) return supportsColor_1;
104700
104716
  hasRequiredSupportsColor = 1;
104701
- const os = require$$0$9;
104717
+ const os = require$$0$5;
104702
104718
  const hasFlag = requireHasFlag();
104703
104719
 
104704
104720
  const env = process.env;
@@ -106169,7 +106185,7 @@ function requirePath () {
106169
106185
  hasRequiredPath = 1;
106170
106186
  Object.defineProperty(path, "__esModule", { value: true });
106171
106187
  path.convertPosixPathToPattern = path.convertWindowsPathToPattern = path.convertPathToPattern = path.escapePosixPath = path.escapeWindowsPath = path.escape = path.removeLeadingDotSegment = path.makeAbsolute = path.unixify = void 0;
106172
- const os = require$$0$9;
106188
+ const os = require$$0$5;
106173
106189
  const path$1 = path__default;
106174
106190
  const IS_WINDOWS_PLATFORM = os.platform() === 'win32';
106175
106191
  const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
@@ -106436,7 +106452,7 @@ function requireGlobParent () {
106436
106452
 
106437
106453
  var isGlob = requireIsGlob();
106438
106454
  var pathPosixDirname = path__default.posix.dirname;
106439
- var isWin32 = require$$0$9.platform() === 'win32';
106455
+ var isWin32 = require$$0$5.platform() === 'win32';
106440
106456
 
106441
106457
  var slash = '/';
106442
106458
  var backslash = /\\/g;
@@ -110829,7 +110845,7 @@ function requireMerge2 () {
110829
110845
  * Copyright (c) 2014-2020 Teambition
110830
110846
  * Licensed under the MIT license.
110831
110847
  */
110832
- const Stream = require$$0$6;
110848
+ const Stream = require$$0$7;
110833
110849
  const PassThrough = Stream.PassThrough;
110834
110850
  const slice = Array.prototype.slice;
110835
110851
 
@@ -112321,7 +112337,7 @@ function requireStream$2 () {
112321
112337
  if (hasRequiredStream$2) return stream$2;
112322
112338
  hasRequiredStream$2 = 1;
112323
112339
  Object.defineProperty(stream$2, "__esModule", { value: true });
112324
- const stream_1 = require$$0$6;
112340
+ const stream_1 = require$$0$7;
112325
112341
  const async_1 = requireAsync$3();
112326
112342
  class StreamProvider {
112327
112343
  constructor(_root, _settings) {
@@ -112573,7 +112589,7 @@ function requireStream$1 () {
112573
112589
  if (hasRequiredStream$1) return stream$1;
112574
112590
  hasRequiredStream$1 = 1;
112575
112591
  Object.defineProperty(stream$1, "__esModule", { value: true });
112576
- const stream_1 = require$$0$6;
112592
+ const stream_1 = require$$0$7;
112577
112593
  const fsStat = requireOut$3();
112578
112594
  const fsWalk = requireOut$1();
112579
112595
  const reader_1 = requireReader();
@@ -113091,7 +113107,7 @@ function requireStream () {
113091
113107
  if (hasRequiredStream) return stream;
113092
113108
  hasRequiredStream = 1;
113093
113109
  Object.defineProperty(stream, "__esModule", { value: true });
113094
- const stream_1 = require$$0$6;
113110
+ const stream_1 = require$$0$7;
113095
113111
  const stream_2 = requireStream$1();
113096
113112
  const provider_1 = requireProvider();
113097
113113
  class ProviderStream extends provider_1.default {
@@ -113218,7 +113234,7 @@ function requireSettings () {
113218
113234
  Object.defineProperty(exports, "__esModule", { value: true });
113219
113235
  exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
113220
113236
  const fs = require$$0__default;
113221
- const os = require$$0$9;
113237
+ const os = require$$0$5;
113222
113238
  /**
113223
113239
  * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
113224
113240
  * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107
@@ -117168,6 +117184,183 @@ const LIST_MODIFIER_TAGS = {
117168
117184
  orderedList: "ol",
117169
117185
  };
117170
117186
 
117187
+ class SlashCommandEditorPage {
117188
+ constructor(page, neetoPlaywrightUtilities, editorWrapper) {
117189
+ this.wordsUsedInEditor = [];
117190
+ this.filePath = "../../../e2e/assets/images/BigBinary.png";
117191
+ this.linkUrl = faker.internet.url();
117192
+ this.imageUrl = "https://picsum.photos/200/300";
117193
+ this.openSlashCommands = async () => {
117194
+ await this.editorWrapper
117195
+ .getByTestId(NEETO_EDITOR_SELECTORS.contentField)
117196
+ .focus();
117197
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117198
+ await this.page.keyboard.press("/");
117199
+ await expect(this.page.locator(".neeto-editor-slash-commands__wrapper") //TODO: use data-testid once https://github.com/neetozone/neeto-editor/issues/1704 resolves
117200
+ ).toBeVisible();
117201
+ };
117202
+ this.slashCommandsOptions = async () => {
117203
+ await this.openSlashCommands();
117204
+ const slashCommandButtonTexts = await this.page
117205
+ .getByTestId(NEETO_EDITOR_SELECTORS.itemBlockHeading)
117206
+ .allInnerTexts();
117207
+ return slashCommandButtonTexts;
117208
+ };
117209
+ this.verifyFontSize = async (fontSize) => {
117210
+ const randomText = await this.fillRandomText();
117211
+ if (fontSize === "normal") {
117212
+ await expect(this.contentField.getByRole("paragraph").filter({ hasText: randomText })).toBeVisible();
117213
+ }
117214
+ else {
117215
+ await expect(this.contentField.getByRole("heading", {
117216
+ level: Number(fontSize),
117217
+ name: randomText,
117218
+ })).toBeVisible();
117219
+ return [{ key: `h${fontSize}`, value: randomText }];
117220
+ }
117221
+ };
117222
+ this.verifyTextModifiers = async (modifier) => {
117223
+ const modifierKey = modifier;
117224
+ const textModifierRole = TEXT_MODIFIER_ROLES[modifierKey];
117225
+ const randomText = await this.fillRandomText();
117226
+ await expect(this.contentField
117227
+ .getByRole(textModifierRole)
117228
+ .filter({ hasText: randomText })).toBeVisible();
117229
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117230
+ modifierKey === "codeBlock" && (await this.page.keyboard.press("Enter"));
117231
+ return [{ key: modifierKey, value: randomText }];
117232
+ };
117233
+ this.verifyTextDeskModifier = async (modifier) => {
117234
+ const modifierKey = modifier;
117235
+ const randomText = await this.fillRandomText();
117236
+ await expect(this.contentField
117237
+ .locator(TEXT_MODIFIER_TAGS[modifierKey])
117238
+ .filter({ hasText: randomText })).toBeVisible();
117239
+ return [{ key: modifierKey, value: randomText }];
117240
+ };
117241
+ this.verifyListModifiers = async (modifier) => {
117242
+ const modifierKey = modifier;
117243
+ const randomText = await this.fillRandomText();
117244
+ await expect(this.contentField
117245
+ .locator(LIST_MODIFIER_TAGS[modifierKey])
117246
+ .filter({ hasText: randomText })).toBeVisible();
117247
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117248
+ return [{ key: modifierKey, value: randomText }];
117249
+ };
117250
+ this.verifyEditorLinkButton = async (linkUrl) => {
117251
+ const randomText = this.getRandomText();
117252
+ await this.page
117253
+ .getByTestId(NEETO_EDITOR_SELECTORS.addLinkTextField)
117254
+ .fill(randomText);
117255
+ await this.page
117256
+ .getByTestId(NEETO_EDITOR_SELECTORS.addLinkUrlInput)
117257
+ .fill(linkUrl);
117258
+ await this.page
117259
+ .getByTestId(NEETO_EDITOR_SELECTORS.addLinkDoneButton)
117260
+ .click();
117261
+ await expect(this.contentField.getByRole("link")).toBeVisible();
117262
+ return [{ key: "link", value: randomText }];
117263
+ };
117264
+ this.verifyEmojiSelector = async () => {
117265
+ const emoji = "👍";
117266
+ const emojiContainer = this.page.getByTestId(NEETO_EDITOR_SELECTORS.emojiContainer);
117267
+ await expect(emojiContainer).toBeVisible({
117268
+ timeout: 10000,
117269
+ });
117270
+ await emojiContainer
117271
+ .getByPlaceholder(DESCRIPTION_EDITOR_TEXTS.search)
117272
+ .fill(EMOJI_LABEL);
117273
+ await this.page.keyboard.press("Enter");
117274
+ await expect(this.contentField).toContainText(emoji);
117275
+ return [{ key: "emoji", value: emoji }];
117276
+ };
117277
+ this.verifyImageUploadOption = async (filePath, shouldRemoveImage = false) => {
117278
+ await expect(this.page.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.restrictionMessage)).toBeVisible();
117279
+ const fileUploaderPromise = this.page.waitForEvent("filechooser");
117280
+ await this.page
117281
+ .getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.browseText)
117282
+ .click();
117283
+ const fileUploader = await fileUploaderPromise;
117284
+ const imagePath = path$1.join(__dirname, filePath);
117285
+ await fileUploader.setFiles(imagePath);
117286
+ await expect(this.imageWrapper).toBeVisible({ timeout: 15000 });
117287
+ if (shouldRemoveImage) {
117288
+ await this.imageWrapper
117289
+ .getByTestId(COMMON_SELECTORS.dropdownIcon)
117290
+ .click();
117291
+ await this.uploadDeleteButton.click();
117292
+ await expect(this.imageWrapper).toBeHidden({
117293
+ timeout: 15000,
117294
+ });
117295
+ }
117296
+ return [{ key: "image-upload", value: imagePath }];
117297
+ };
117298
+ this.verifyDividerModifier = () => expect(this.contentField.locator("hr")).toBeVisible();
117299
+ this.slashCommandsAndVerifications = {
117300
+ normalText: () => this.verifyFontSize("normal"),
117301
+ heading1: () => this.verifyFontSize(1),
117302
+ heading2: () => this.verifyFontSize(2),
117303
+ heading3: () => this.verifyFontSize(3),
117304
+ heading4: () => this.verifyFontSize(4),
117305
+ heading5: () => this.verifyFontSize(5),
117306
+ bold: () => this.verifyTextModifiers("bold"),
117307
+ italic: () => this.verifyTextModifiers("italic"),
117308
+ blockQuote: () => this.verifyTextModifiers("blockquote"),
117309
+ codeBlock: () => this.verifyTextModifiers("codeBlock"),
117310
+ underline: () => this.verifyTextDeskModifier("underline"),
117311
+ numberedList: () => this.verifyListModifiers("orderedList"),
117312
+ bulletList: () => this.verifyListModifiers("bulletList"),
117313
+ link: () => this.verifyEditorLinkButton(this.linkUrl),
117314
+ image: () => this.verifyImageUploadOption(this.filePath),
117315
+ emoji: () => this.verifyEmojiSelector(),
117316
+ divider: () => this.verifyDividerModifier(),
117317
+ };
117318
+ this.getRandomText = () => {
117319
+ let randomText;
117320
+ do {
117321
+ randomText = faker.lorem.word(10);
117322
+ } while (this.wordsUsedInEditor.includes(randomText));
117323
+ return randomText;
117324
+ };
117325
+ this.fillRandomText = async () => {
117326
+ const randomText = this.getRandomText();
117327
+ await this.page.keyboard.type(randomText);
117328
+ this.wordsUsedInEditor.push(randomText);
117329
+ const randomTextLocator = this.contentField.getByText(randomText);
117330
+ await randomTextLocator.scrollIntoViewIfNeeded();
117331
+ return randomText;
117332
+ };
117333
+ this.verifySlashCommandEditor = async ({ linkUrl, filePath, imageUrl, } = {}) => {
117334
+ this.linkUrl = linkUrl || this.linkUrl;
117335
+ this.filePath = filePath || this.filePath;
117336
+ this.imageUrl = imageUrl || this.imageUrl;
117337
+ const slashCommandButtonTexts = await this.slashCommandsOptions();
117338
+ const keysAndValues = [];
117339
+ for (const [index, buttonText] of slashCommandButtonTexts.entries()) {
117340
+ await this.openSlashCommands();
117341
+ await this.page
117342
+ .getByTestId(NEETO_EDITOR_SELECTORS.commandListItem(index))
117343
+ .click();
117344
+ const keyValuesForButton = await this.slashCommandsAndVerifications[toCamelCase(buttonText)](index);
117345
+ keyValuesForButton && keysAndValues.push(...keyValuesForButton);
117346
+ }
117347
+ return keysAndValues;
117348
+ };
117349
+ this.page = page;
117350
+ this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
117351
+ this.t = getI18nInstance().t;
117352
+ this.editorWrapper = this.page;
117353
+ if (editorWrapper)
117354
+ this.editorWrapper = editorWrapper;
117355
+ this.editorLinkButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.linkOption);
117356
+ this.imageWrapper = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.imageWrapper);
117357
+ this.uploadDeleteButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadDeleteButton);
117358
+ this.imageUploadOption = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadOption);
117359
+ this.emojiSelector = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.emojiOption);
117360
+ this.contentField = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.contentField);
117361
+ }
117362
+ }
117363
+
117171
117364
  class EditorPage {
117172
117365
  constructor(page, neetoPlaywrightUtilities, editorWrapper) {
117173
117366
  this.wordsUsedInEditor = [];
@@ -117181,8 +117374,6 @@ class EditorPage {
117181
117374
  this.cleanString = (selector = "") => (selector === null || selector === void 0 ? void 0 : selector.replace("neeto-editor-fixed-menu-", "").replace("-option", "")) ||
117182
117375
  "";
117183
117376
  this.fixedMenuOptions = async () => {
117184
- (await this.fixedMenuArrowSelector.isVisible()) &&
117185
- (await this.fixedMenuArrowSelector.click());
117186
117377
  const fixedMenuButtons = await this.editorWrapper
117187
117378
  .getByTestId(NEETO_EDITOR_SELECTORS.fixedMenuWrapper)
117188
117379
  .getByRole("button")
@@ -117247,7 +117438,7 @@ class EditorPage {
117247
117438
  await expect(this.contentField
117248
117439
  .getByRole(textModifierRole)
117249
117440
  .filter({ hasText: randomText })).toBeVisible();
117250
- await this.moveCursorAtBottom();
117441
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117251
117442
  await this.page.keyboard.press("Enter");
117252
117443
  if (modifierKey !== "codeBlock") {
117253
117444
  isButtonInMoreMenu && (await this.moreMenuSelector.click());
@@ -117264,7 +117455,7 @@ class EditorPage {
117264
117455
  await expect(this.contentField
117265
117456
  .locator(TEXT_MODIFIER_TAGS[modifierKey])
117266
117457
  .filter({ hasText: randomText })).toBeVisible();
117267
- await this.moveCursorAtBottom();
117458
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117268
117459
  isButtonInMoreMenu && (await this.moreMenuSelector.click());
117269
117460
  await textModifierSelector.click();
117270
117461
  return [{ key: modifierKey, value: randomText }];
@@ -117278,7 +117469,7 @@ class EditorPage {
117278
117469
  await expect(this.page.getByTestId(COMMON_SELECTORS.customDropdownContainer())).toBeVisible({ timeout: 5000 });
117279
117470
  }).toPass({ timeout: 30000 });
117280
117471
  this.focusText = (textLocator) => {
117281
- const platform = require$$0$9.platform();
117472
+ const platform = require$$0$5.platform();
117282
117473
  return expect(async () => {
117283
117474
  await textLocator.click();
117284
117475
  platform === "darwin"
@@ -117310,7 +117501,7 @@ class EditorPage {
117310
117501
  this.verifyTextHighlighter = async (isButtonInMoreMenu, highlighterCount = this.highlighterCount) => {
117311
117502
  const highlightedKeyValuePairs = [];
117312
117503
  for (let colorIdx = 1; colorIdx <= highlighterCount; colorIdx++) {
117313
- await this.moveCursorAtBottom();
117504
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117314
117505
  const randomText = await this.highlightText(isButtonInMoreMenu, colorIdx);
117315
117506
  highlightedKeyValuePairs.push({
117316
117507
  key: `highlight-${colorIdx}`,
@@ -117328,7 +117519,7 @@ class EditorPage {
117328
117519
  await expect(this.contentField
117329
117520
  .locator(LIST_MODIFIER_TAGS[modifierKey])
117330
117521
  .filter({ hasText: randomText })).toBeVisible();
117331
- await this.moveCursorAtBottom();
117522
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117332
117523
  isButtonInMoreMenu && (await this.moreMenuSelector.click());
117333
117524
  await listModifierSelector.click();
117334
117525
  return [{ key: modifierKey, value: randomText }];
@@ -117345,7 +117536,7 @@ class EditorPage {
117345
117536
  .click();
117346
117537
  const linkRole = DESCRIPTION_EDITOR_TEXTS.link;
117347
117538
  await expect(this.contentField.getByRole(linkRole)).toBeVisible();
117348
- await this.moveCursorAtBottom();
117539
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117349
117540
  return [{ key: "link", value: randomText }];
117350
117541
  };
117351
117542
  this.verifyEditorAttachmentsButton = async (filePath, isButtonInMoreMenu, shouldRemoveAttachment = false) => {
@@ -117515,7 +117706,7 @@ class EditorPage {
117515
117706
  await expect(this.contentField.locator(NEETO_EDITOR_SELECTORS.todoList, {
117516
117707
  hasText: randomText,
117517
117708
  })).toBeVisible();
117518
- await this.moveCursorAtBottom();
117709
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117519
117710
  return [{ key: "todoList", value: randomText }];
117520
117711
  };
117521
117712
  this.verifyDynamicVariables = async (dynamicVariables) => {
@@ -117534,7 +117725,7 @@ class EditorPage {
117534
117725
  const calloutTypes = ["default", "info", "warning", "error", "success"];
117535
117726
  const calloutContentField = this.contentField.locator(NEETO_EDITOR_SELECTORS.calloutContent);
117536
117727
  const calloutTypeOption = this.page.locator(NEETO_EDITOR_SELECTORS.calloutTypeOption);
117537
- await this.moveCursorAtBottom();
117728
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117538
117729
  for (const [index, type] of calloutTypes.entries()) {
117539
117730
  await this.calloutSelector.click();
117540
117731
  const calloutType = calloutTypeOption.filter({ hasText: type });
@@ -117549,7 +117740,7 @@ class EditorPage {
117549
117740
  // The index is important here as it determines which callout content field to interact with
117550
117741
  // eslint-disable-next-line playwright/no-nth-methods
117551
117742
  await expect(calloutContentField.nth(index)).toContainText(randomText);
117552
- await this.moveCursorAtBottom();
117743
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117553
117744
  }
117554
117745
  return [{ key: "callout" }];
117555
117746
  };
@@ -117585,11 +117776,21 @@ class EditorPage {
117585
117776
  }),
117586
117777
  todoList: isButtonInMoreMenu => this.verifyTodoListSelector(isButtonInMoreMenu),
117587
117778
  };
117779
+ this.fillRandomText = async () => {
117780
+ let randomText;
117781
+ do {
117782
+ randomText = faker.lorem.word(10);
117783
+ } while (this.wordsUsedInEditor.includes(randomText));
117784
+ await this.contentField.focus();
117785
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117786
+ await this.page.keyboard.type(randomText);
117787
+ this.wordsUsedInEditor.push(randomText);
117788
+ const randomTextLocator = this.contentField.getByText(randomText);
117789
+ await randomTextLocator.scrollIntoViewIfNeeded();
117790
+ await randomTextLocator.click({ clickCount: 3 });
117791
+ return randomText;
117792
+ };
117588
117793
  this.verifyDescriptionEditor = async ({ dynamicVariables, linkUrl, videoPath, filePath, imageUrl, videoUrl, highlighterCount, cannedResponseSuccessMessage, } = {}) => {
117589
- const fixedMenuButtons = await this.fixedMenuOptions();
117590
- let moreMenuButtons = [];
117591
- (await this.moreMenuSelector.isVisible()) &&
117592
- (moreMenuButtons = await this.moreMenuOptions());
117593
117794
  this.linkUrl = linkUrl || this.linkUrl;
117594
117795
  this.filePath = filePath || this.filePath;
117595
117796
  this.videoPath = videoPath || this.videoPath;
@@ -117597,50 +117798,36 @@ class EditorPage {
117597
117798
  this.videoUrl = videoUrl || this.videoUrl;
117598
117799
  this.highlighterCount = highlighterCount || this.highlighterCount;
117599
117800
  this.cannedResponseSuccessMessage = cannedResponseSuccessMessage;
117801
+ await expect(this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.contentField)).toBeVisible();
117802
+ const isFixedMenuTypeEditor = await this.editorWrapper
117803
+ .getByTestId(NEETO_EDITOR_SELECTORS.fixedMenuWrapper)
117804
+ .isVisible();
117805
+ const keysAndValues = isFixedMenuTypeEditor
117806
+ ? await this.editorWithFixedMenuButtons()
117807
+ : await this.slashCommandEditorPage.verifySlashCommandEditor();
117808
+ dynamicVariables && (await this.verifyDynamicVariables(dynamicVariables));
117809
+ return keysAndValues;
117810
+ };
117811
+ this.editorWithFixedMenuButtons = async () => {
117812
+ const fixedMenuButtons = await this.fixedMenuOptions();
117813
+ let moreMenuButtons = [];
117814
+ (await this.moreMenuSelector.isVisible()) &&
117815
+ (moreMenuButtons = await this.moreMenuOptions());
117600
117816
  const keysAndValues = [];
117601
117817
  for (const button of [...fixedMenuButtons, ...moreMenuButtons]) {
117602
117818
  const isMoreMenuButton = moreMenuButtons.includes(button);
117603
117819
  const keyValuesForButton = await this.buttonsAndVerifications[button](isMoreMenuButton);
117604
117820
  keysAndValues.push(...keyValuesForButton);
117605
117821
  }
117606
- dynamicVariables && (await this.verifyDynamicVariables(dynamicVariables));
117607
117822
  return keysAndValues;
117608
117823
  };
117609
- this.moveCursorAtBottom = async () => {
117610
- const platform = require$$0$9.platform();
117611
- if (platform === "darwin") {
117612
- await this.page.keyboard.press("Meta+ArrowRight");
117613
- await this.page.keyboard.press("Meta+ArrowDown");
117614
- }
117615
- else {
117616
- await this.page.keyboard.press("End");
117617
- await this.page.keyboard.press("PageDown");
117618
- }
117619
- // eslint-disable-next-line playwright/no-wait-for-timeout
117620
- await this.page.waitForTimeout(100); // Adding some delay for DOM to react
117621
- await this.page.keyboard.press("Enter");
117622
- };
117623
- this.fillRandomText = async () => {
117624
- let randomText;
117625
- do {
117626
- randomText = faker.lorem.word(10);
117627
- } while (this.wordsUsedInEditor.includes(randomText));
117628
- await this.contentField.focus();
117629
- await this.moveCursorAtBottom();
117630
- await this.page.keyboard.type(randomText);
117631
- this.wordsUsedInEditor.push(randomText);
117632
- const randomTextLocator = this.contentField.getByText(randomText);
117633
- await randomTextLocator.scrollIntoViewIfNeeded();
117634
- await randomTextLocator.click({ clickCount: 3 });
117635
- return randomText;
117636
- };
117637
117824
  this.page = page;
117638
117825
  this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
117826
+ this.slashCommandEditorPage = new SlashCommandEditorPage(page, neetoPlaywrightUtilities, editorWrapper);
117639
117827
  this.t = getI18nInstance().t;
117640
117828
  this.editorWrapper = this.page;
117641
117829
  if (editorWrapper)
117642
117830
  this.editorWrapper = editorWrapper;
117643
- this.fixedMenuArrowSelector = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.fixedMenuArrow);
117644
117831
  this.editorLinkButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.linkOption);
117645
117832
  this.attachmentPreview = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.attachmentPreview);
117646
117833
  this.editorAttachmentsButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.editorAttachmentsButton);
@@ -123607,8 +123794,8 @@ function requireMain$1 () {
123607
123794
  hasRequiredMain$1 = 1;
123608
123795
  const fs = require$$0__default;
123609
123796
  const path = path__default;
123610
- const os = require$$0$9;
123611
- const crypto = require$$0$7;
123797
+ const os = require$$0$5;
123798
+ const crypto = require$$0$8;
123612
123799
  const packageJson = require$$4;
123613
123800
 
123614
123801
  const version = packageJson.version;