@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.cjs.js CHANGED
@@ -3,6 +3,7 @@
3
3
  var neetoCist = require('@bigbinary/neeto-cist');
4
4
  var faker = require('@faker-js/faker');
5
5
  var require$$0$4 = require('fs');
6
+ var require$$0$5 = require('os');
6
7
  var path$1 = require('path');
7
8
  var test = require('@playwright/test');
8
9
  var playwrightI18nextFixture = require('playwright-i18next-fixture');
@@ -10,15 +11,14 @@ var require$$0$3 = require('util');
10
11
  var ramda = require('ramda');
11
12
  var child_process = require('child_process');
12
13
  var dayjs = require('dayjs');
13
- var require$$0$6 = require('stream');
14
+ var require$$0$7 = require('stream');
14
15
  var node_module = require('node:module');
15
- var require$$0$5 = require('buffer');
16
+ var require$$0$6 = require('buffer');
16
17
  var require$$1$2 = require('string_decoder');
17
- var require$$0$7 = require('crypto');
18
+ var require$$0$8 = require('crypto');
18
19
  var require$$1$3 = require('zlib');
19
- var require$$0$8 = require('assert');
20
+ var require$$0$9 = require('assert');
20
21
  var require$$0$a = require('tty');
21
- var require$$0$9 = require('os');
22
22
  var stealth$1 = require('puppeteer-extra-plugin-stealth');
23
23
  var require$$1$4 = require('events');
24
24
  var timezone = require('dayjs/plugin/timezone');
@@ -4996,6 +4996,8 @@ const NEETO_EDITOR_SELECTORS = {
4996
4996
  neetoEditorHighlightTextColor: (textColorIndex) => `neeto-editor-highlight-text-color-dot-${textColorIndex}`,
4997
4997
  neetoEditorHighlightBgColor: (bgColorIndex) => `neeto-editor-highlight-background-color-dot-${bgColorIndex}`,
4998
4998
  todoList: "[data-type='todoList']",
4999
+ commandListItem: (index) => `neeto-editor-command-list-item-${index}`,
5000
+ itemBlockHeading: "neeto-editor-command-list-item-block-heading",
4999
5001
  };
5000
5002
  const NEETO_TEXT_MODIFIER_SELECTORS = {
5001
5003
  strike: optionSelector("strike"),
@@ -5875,6 +5877,20 @@ class CustomCommands {
5875
5877
  isChecked !== shouldBeChecked && (await locator.click());
5876
5878
  await test.expect(locator).toBeChecked({ checked: shouldBeChecked });
5877
5879
  }).toPass({ timeout: 15000 });
5880
+ this.moveCursorAtBottom = async () => {
5881
+ const platform = require$$0$5.platform();
5882
+ if (platform === "darwin") {
5883
+ await this.page.keyboard.press("Meta+ArrowRight");
5884
+ await this.page.keyboard.press("Meta+ArrowDown");
5885
+ }
5886
+ else {
5887
+ await this.page.keyboard.press("End");
5888
+ await this.page.keyboard.press("PageDown");
5889
+ }
5890
+ // eslint-disable-next-line playwright/no-wait-for-timeout
5891
+ await this.page.waitForTimeout(100); // Adding some delay for DOM to react
5892
+ await this.page.keyboard.press("Enter");
5893
+ };
5878
5894
  this.page = page;
5879
5895
  this.responses = [];
5880
5896
  this.request = request;
@@ -5901,7 +5917,7 @@ function requireSafer () {
5901
5917
  if (hasRequiredSafer) return safer_1;
5902
5918
  hasRequiredSafer = 1;
5903
5919
 
5904
- var buffer = require$$0$5;
5920
+ var buffer = require$$0$6;
5905
5921
  var Buffer = buffer.Buffer;
5906
5922
 
5907
5923
  var safer = {};
@@ -27542,7 +27558,7 @@ function requireMimeNode () {
27542
27558
  const libmime = requireLibmime();
27543
27559
  const libqp = requireLibqp();
27544
27560
  const libbase64 = requireLibbase64();
27545
- const PassThrough = require$$0$6.PassThrough;
27561
+ const PassThrough = require$$0$7.PassThrough;
27546
27562
  const pathlib = path$1;
27547
27563
 
27548
27564
  class MimeNode {
@@ -27811,7 +27827,7 @@ function requireMessageSplitter () {
27811
27827
  if (hasRequiredMessageSplitter) return messageSplitter;
27812
27828
  hasRequiredMessageSplitter = 1;
27813
27829
 
27814
- const Transform = require$$0$6.Transform;
27830
+ const Transform = require$$0$7.Transform;
27815
27831
  const MimeNode = requireMimeNode();
27816
27832
 
27817
27833
  const MAX_HEAD_SIZE = 1 * 1024 * 1024;
@@ -28241,7 +28257,7 @@ function requireMessageJoiner () {
28241
28257
  if (hasRequiredMessageJoiner) return messageJoiner;
28242
28258
  hasRequiredMessageJoiner = 1;
28243
28259
 
28244
- const Transform = require$$0$6.Transform;
28260
+ const Transform = require$$0$7.Transform;
28245
28261
 
28246
28262
  class MessageJoiner extends Transform {
28247
28263
  constructor() {
@@ -28281,7 +28297,7 @@ function requireFlowedDecoder () {
28281
28297
 
28282
28298
  // Helper class to rewrite nodes with specific mime type
28283
28299
 
28284
- const Transform = require$$0$6.Transform;
28300
+ const Transform = require$$0$7.Transform;
28285
28301
  const libmime = requireLibmime();
28286
28302
 
28287
28303
  /**
@@ -28344,7 +28360,7 @@ function requireNodeRewriter () {
28344
28360
 
28345
28361
  // Helper class to rewrite nodes with specific mime type
28346
28362
 
28347
- const Transform = require$$0$6.Transform;
28363
+ const Transform = require$$0$7.Transform;
28348
28364
  const FlowedDecoder = requireFlowedDecoder();
28349
28365
 
28350
28366
  /**
@@ -28546,7 +28562,7 @@ function requireNodeStreamer () {
28546
28562
 
28547
28563
  // Helper class to rewrite nodes with specific mime type
28548
28564
 
28549
- const Transform = require$$0$6.Transform;
28565
+ const Transform = require$$0$7.Transform;
28550
28566
  const FlowedDecoder = requireFlowedDecoder();
28551
28567
 
28552
28568
  /**
@@ -28673,7 +28689,7 @@ function requireChunkedPassthrough () {
28673
28689
  if (hasRequiredChunkedPassthrough) return chunkedPassthrough;
28674
28690
  hasRequiredChunkedPassthrough = 1;
28675
28691
 
28676
- const { Transform } = require$$0$6;
28692
+ const { Transform } = require$$0$7;
28677
28693
 
28678
28694
  class ChunkedPassthrough extends Transform {
28679
28695
  constructor(options = {}) {
@@ -29569,8 +29585,8 @@ function requireStreamHash () {
29569
29585
  if (hasRequiredStreamHash) return streamHash;
29570
29586
  hasRequiredStreamHash = 1;
29571
29587
 
29572
- const crypto = require$$0$7;
29573
- const Transform = require$$0$6.Transform;
29588
+ const crypto = require$$0$8;
29589
+ const Transform = require$$0$7.Transform;
29574
29590
 
29575
29591
  class StreamHash extends Transform {
29576
29592
  constructor(attachment, algo) {
@@ -51953,7 +51969,7 @@ function requireMailParser () {
51953
51969
  const mailsplit = requireMailsplit();
51954
51970
  const libmime = requireLibmime();
51955
51971
  const addressparser = requireAddressparser();
51956
- const Transform = require$$0$6.Transform;
51972
+ const Transform = require$$0$7.Transform;
51957
51973
  const Splitter = mailsplit.Splitter;
51958
51974
  const ChunkedPassthrough = mailsplit.ChunkedPassthrough;
51959
51975
  const punycode = require$$4$2;
@@ -66507,7 +66523,7 @@ function requireChunkstream () {
66507
66523
  hasRequiredChunkstream = 1;
66508
66524
 
66509
66525
  let util = require$$0$3;
66510
- let Stream = require$$0$6;
66526
+ let Stream = require$$0$7;
66511
66527
 
66512
66528
  let ChunkStream = (chunkstream.exports = function () {
66513
66529
  Stream.call(this);
@@ -68476,7 +68492,7 @@ function requirePackerAsync () {
68476
68492
  hasRequiredPackerAsync = 1;
68477
68493
 
68478
68494
  let util = require$$0$3;
68479
- let Stream = require$$0$6;
68495
+ let Stream = require$$0$7;
68480
68496
  let constants = requireConstants$4();
68481
68497
  let Packer = requirePacker();
68482
68498
 
@@ -68537,11 +68553,11 @@ function requireSyncInflate () {
68537
68553
  hasRequiredSyncInflate = 1;
68538
68554
  (function (module, exports) {
68539
68555
 
68540
- let assert = require$$0$8.ok;
68556
+ let assert = require$$0$9.ok;
68541
68557
  let zlib = require$$1$3;
68542
68558
  let util = require$$0$3;
68543
68559
 
68544
- let kMaxLength = require$$0$5.kMaxLength;
68560
+ let kMaxLength = require$$0$6.kMaxLength;
68545
68561
 
68546
68562
  function Inflate(opts) {
68547
68563
  if (!(this instanceof Inflate)) {
@@ -68998,7 +69014,7 @@ function requirePng () {
68998
69014
  hasRequiredPng = 1;
68999
69015
 
69000
69016
  let util = require$$0$3;
69001
- let Stream = require$$0$6;
69017
+ let Stream = require$$0$7;
69002
69018
  let Parser = requireParserAsync();
69003
69019
  let Packer = requirePackerAsync();
69004
69020
  let PNGSync = requirePngSync();
@@ -104719,7 +104735,7 @@ var hasRequiredSupportsColor;
104719
104735
  function requireSupportsColor () {
104720
104736
  if (hasRequiredSupportsColor) return supportsColor_1;
104721
104737
  hasRequiredSupportsColor = 1;
104722
- const os = require$$0$9;
104738
+ const os = require$$0$5;
104723
104739
  const hasFlag = requireHasFlag();
104724
104740
 
104725
104741
  const env = process.env;
@@ -106190,7 +106206,7 @@ function requirePath () {
106190
106206
  hasRequiredPath = 1;
106191
106207
  Object.defineProperty(path, "__esModule", { value: true });
106192
106208
  path.convertPosixPathToPattern = path.convertWindowsPathToPattern = path.convertPathToPattern = path.escapePosixPath = path.escapeWindowsPath = path.escape = path.removeLeadingDotSegment = path.makeAbsolute = path.unixify = void 0;
106193
- const os = require$$0$9;
106209
+ const os = require$$0$5;
106194
106210
  const path$2 = path$1;
106195
106211
  const IS_WINDOWS_PLATFORM = os.platform() === 'win32';
106196
106212
  const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
@@ -106457,7 +106473,7 @@ function requireGlobParent () {
106457
106473
 
106458
106474
  var isGlob = requireIsGlob();
106459
106475
  var pathPosixDirname = path$1.posix.dirname;
106460
- var isWin32 = require$$0$9.platform() === 'win32';
106476
+ var isWin32 = require$$0$5.platform() === 'win32';
106461
106477
 
106462
106478
  var slash = '/';
106463
106479
  var backslash = /\\/g;
@@ -110850,7 +110866,7 @@ function requireMerge2 () {
110850
110866
  * Copyright (c) 2014-2020 Teambition
110851
110867
  * Licensed under the MIT license.
110852
110868
  */
110853
- const Stream = require$$0$6;
110869
+ const Stream = require$$0$7;
110854
110870
  const PassThrough = Stream.PassThrough;
110855
110871
  const slice = Array.prototype.slice;
110856
110872
 
@@ -112342,7 +112358,7 @@ function requireStream$2 () {
112342
112358
  if (hasRequiredStream$2) return stream$2;
112343
112359
  hasRequiredStream$2 = 1;
112344
112360
  Object.defineProperty(stream$2, "__esModule", { value: true });
112345
- const stream_1 = require$$0$6;
112361
+ const stream_1 = require$$0$7;
112346
112362
  const async_1 = requireAsync$3();
112347
112363
  class StreamProvider {
112348
112364
  constructor(_root, _settings) {
@@ -112594,7 +112610,7 @@ function requireStream$1 () {
112594
112610
  if (hasRequiredStream$1) return stream$1;
112595
112611
  hasRequiredStream$1 = 1;
112596
112612
  Object.defineProperty(stream$1, "__esModule", { value: true });
112597
- const stream_1 = require$$0$6;
112613
+ const stream_1 = require$$0$7;
112598
112614
  const fsStat = requireOut$3();
112599
112615
  const fsWalk = requireOut$1();
112600
112616
  const reader_1 = requireReader();
@@ -113112,7 +113128,7 @@ function requireStream () {
113112
113128
  if (hasRequiredStream) return stream;
113113
113129
  hasRequiredStream = 1;
113114
113130
  Object.defineProperty(stream, "__esModule", { value: true });
113115
- const stream_1 = require$$0$6;
113131
+ const stream_1 = require$$0$7;
113116
113132
  const stream_2 = requireStream$1();
113117
113133
  const provider_1 = requireProvider();
113118
113134
  class ProviderStream extends provider_1.default {
@@ -113239,7 +113255,7 @@ function requireSettings () {
113239
113255
  Object.defineProperty(exports, "__esModule", { value: true });
113240
113256
  exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
113241
113257
  const fs = require$$0$4;
113242
- const os = require$$0$9;
113258
+ const os = require$$0$5;
113243
113259
  /**
113244
113260
  * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
113245
113261
  * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107
@@ -117189,6 +117205,183 @@ const LIST_MODIFIER_TAGS = {
117189
117205
  orderedList: "ol",
117190
117206
  };
117191
117207
 
117208
+ class SlashCommandEditorPage {
117209
+ constructor(page, neetoPlaywrightUtilities, editorWrapper) {
117210
+ this.wordsUsedInEditor = [];
117211
+ this.filePath = "../../../e2e/assets/images/BigBinary.png";
117212
+ this.linkUrl = faker.faker.internet.url();
117213
+ this.imageUrl = "https://picsum.photos/200/300";
117214
+ this.openSlashCommands = async () => {
117215
+ await this.editorWrapper
117216
+ .getByTestId(NEETO_EDITOR_SELECTORS.contentField)
117217
+ .focus();
117218
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117219
+ await this.page.keyboard.press("/");
117220
+ await test.expect(this.page.locator(".neeto-editor-slash-commands__wrapper") //TODO: use data-testid once https://github.com/neetozone/neeto-editor/issues/1704 resolves
117221
+ ).toBeVisible();
117222
+ };
117223
+ this.slashCommandsOptions = async () => {
117224
+ await this.openSlashCommands();
117225
+ const slashCommandButtonTexts = await this.page
117226
+ .getByTestId(NEETO_EDITOR_SELECTORS.itemBlockHeading)
117227
+ .allInnerTexts();
117228
+ return slashCommandButtonTexts;
117229
+ };
117230
+ this.verifyFontSize = async (fontSize) => {
117231
+ const randomText = await this.fillRandomText();
117232
+ if (fontSize === "normal") {
117233
+ await test.expect(this.contentField.getByRole("paragraph").filter({ hasText: randomText })).toBeVisible();
117234
+ }
117235
+ else {
117236
+ await test.expect(this.contentField.getByRole("heading", {
117237
+ level: Number(fontSize),
117238
+ name: randomText,
117239
+ })).toBeVisible();
117240
+ return [{ key: `h${fontSize}`, value: randomText }];
117241
+ }
117242
+ };
117243
+ this.verifyTextModifiers = async (modifier) => {
117244
+ const modifierKey = modifier;
117245
+ const textModifierRole = TEXT_MODIFIER_ROLES[modifierKey];
117246
+ const randomText = await this.fillRandomText();
117247
+ await test.expect(this.contentField
117248
+ .getByRole(textModifierRole)
117249
+ .filter({ hasText: randomText })).toBeVisible();
117250
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117251
+ modifierKey === "codeBlock" && (await this.page.keyboard.press("Enter"));
117252
+ return [{ key: modifierKey, value: randomText }];
117253
+ };
117254
+ this.verifyTextDeskModifier = async (modifier) => {
117255
+ const modifierKey = modifier;
117256
+ const randomText = await this.fillRandomText();
117257
+ await test.expect(this.contentField
117258
+ .locator(TEXT_MODIFIER_TAGS[modifierKey])
117259
+ .filter({ hasText: randomText })).toBeVisible();
117260
+ return [{ key: modifierKey, value: randomText }];
117261
+ };
117262
+ this.verifyListModifiers = async (modifier) => {
117263
+ const modifierKey = modifier;
117264
+ const randomText = await this.fillRandomText();
117265
+ await test.expect(this.contentField
117266
+ .locator(LIST_MODIFIER_TAGS[modifierKey])
117267
+ .filter({ hasText: randomText })).toBeVisible();
117268
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117269
+ return [{ key: modifierKey, value: randomText }];
117270
+ };
117271
+ this.verifyEditorLinkButton = async (linkUrl) => {
117272
+ const randomText = this.getRandomText();
117273
+ await this.page
117274
+ .getByTestId(NEETO_EDITOR_SELECTORS.addLinkTextField)
117275
+ .fill(randomText);
117276
+ await this.page
117277
+ .getByTestId(NEETO_EDITOR_SELECTORS.addLinkUrlInput)
117278
+ .fill(linkUrl);
117279
+ await this.page
117280
+ .getByTestId(NEETO_EDITOR_SELECTORS.addLinkDoneButton)
117281
+ .click();
117282
+ await test.expect(this.contentField.getByRole("link")).toBeVisible();
117283
+ return [{ key: "link", value: randomText }];
117284
+ };
117285
+ this.verifyEmojiSelector = async () => {
117286
+ const emoji = "👍";
117287
+ const emojiContainer = this.page.getByTestId(NEETO_EDITOR_SELECTORS.emojiContainer);
117288
+ await test.expect(emojiContainer).toBeVisible({
117289
+ timeout: 10000,
117290
+ });
117291
+ await emojiContainer
117292
+ .getByPlaceholder(DESCRIPTION_EDITOR_TEXTS.search)
117293
+ .fill(EMOJI_LABEL);
117294
+ await this.page.keyboard.press("Enter");
117295
+ await test.expect(this.contentField).toContainText(emoji);
117296
+ return [{ key: "emoji", value: emoji }];
117297
+ };
117298
+ this.verifyImageUploadOption = async (filePath, shouldRemoveImage = false) => {
117299
+ await test.expect(this.page.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.restrictionMessage)).toBeVisible();
117300
+ const fileUploaderPromise = this.page.waitForEvent("filechooser");
117301
+ await this.page
117302
+ .getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.browseText)
117303
+ .click();
117304
+ const fileUploader = await fileUploaderPromise;
117305
+ const imagePath = path__namespace.join(__dirname, filePath);
117306
+ await fileUploader.setFiles(imagePath);
117307
+ await test.expect(this.imageWrapper).toBeVisible({ timeout: 15000 });
117308
+ if (shouldRemoveImage) {
117309
+ await this.imageWrapper
117310
+ .getByTestId(COMMON_SELECTORS.dropdownIcon)
117311
+ .click();
117312
+ await this.uploadDeleteButton.click();
117313
+ await test.expect(this.imageWrapper).toBeHidden({
117314
+ timeout: 15000,
117315
+ });
117316
+ }
117317
+ return [{ key: "image-upload", value: imagePath }];
117318
+ };
117319
+ this.verifyDividerModifier = () => test.expect(this.contentField.locator("hr")).toBeVisible();
117320
+ this.slashCommandsAndVerifications = {
117321
+ normalText: () => this.verifyFontSize("normal"),
117322
+ heading1: () => this.verifyFontSize(1),
117323
+ heading2: () => this.verifyFontSize(2),
117324
+ heading3: () => this.verifyFontSize(3),
117325
+ heading4: () => this.verifyFontSize(4),
117326
+ heading5: () => this.verifyFontSize(5),
117327
+ bold: () => this.verifyTextModifiers("bold"),
117328
+ italic: () => this.verifyTextModifiers("italic"),
117329
+ blockQuote: () => this.verifyTextModifiers("blockquote"),
117330
+ codeBlock: () => this.verifyTextModifiers("codeBlock"),
117331
+ underline: () => this.verifyTextDeskModifier("underline"),
117332
+ numberedList: () => this.verifyListModifiers("orderedList"),
117333
+ bulletList: () => this.verifyListModifiers("bulletList"),
117334
+ link: () => this.verifyEditorLinkButton(this.linkUrl),
117335
+ image: () => this.verifyImageUploadOption(this.filePath),
117336
+ emoji: () => this.verifyEmojiSelector(),
117337
+ divider: () => this.verifyDividerModifier(),
117338
+ };
117339
+ this.getRandomText = () => {
117340
+ let randomText;
117341
+ do {
117342
+ randomText = faker.faker.lorem.word(10);
117343
+ } while (this.wordsUsedInEditor.includes(randomText));
117344
+ return randomText;
117345
+ };
117346
+ this.fillRandomText = async () => {
117347
+ const randomText = this.getRandomText();
117348
+ await this.page.keyboard.type(randomText);
117349
+ this.wordsUsedInEditor.push(randomText);
117350
+ const randomTextLocator = this.contentField.getByText(randomText);
117351
+ await randomTextLocator.scrollIntoViewIfNeeded();
117352
+ return randomText;
117353
+ };
117354
+ this.verifySlashCommandEditor = async ({ linkUrl, filePath, imageUrl, } = {}) => {
117355
+ this.linkUrl = linkUrl || this.linkUrl;
117356
+ this.filePath = filePath || this.filePath;
117357
+ this.imageUrl = imageUrl || this.imageUrl;
117358
+ const slashCommandButtonTexts = await this.slashCommandsOptions();
117359
+ const keysAndValues = [];
117360
+ for (const [index, buttonText] of slashCommandButtonTexts.entries()) {
117361
+ await this.openSlashCommands();
117362
+ await this.page
117363
+ .getByTestId(NEETO_EDITOR_SELECTORS.commandListItem(index))
117364
+ .click();
117365
+ const keyValuesForButton = await this.slashCommandsAndVerifications[toCamelCase(buttonText)](index);
117366
+ keyValuesForButton && keysAndValues.push(...keyValuesForButton);
117367
+ }
117368
+ return keysAndValues;
117369
+ };
117370
+ this.page = page;
117371
+ this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
117372
+ this.t = playwrightI18nextFixture.getI18nInstance().t;
117373
+ this.editorWrapper = this.page;
117374
+ if (editorWrapper)
117375
+ this.editorWrapper = editorWrapper;
117376
+ this.editorLinkButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.linkOption);
117377
+ this.imageWrapper = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.imageWrapper);
117378
+ this.uploadDeleteButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadDeleteButton);
117379
+ this.imageUploadOption = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadOption);
117380
+ this.emojiSelector = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.emojiOption);
117381
+ this.contentField = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.contentField);
117382
+ }
117383
+ }
117384
+
117192
117385
  class EditorPage {
117193
117386
  constructor(page, neetoPlaywrightUtilities, editorWrapper) {
117194
117387
  this.wordsUsedInEditor = [];
@@ -117202,8 +117395,6 @@ class EditorPage {
117202
117395
  this.cleanString = (selector = "") => (selector === null || selector === void 0 ? void 0 : selector.replace("neeto-editor-fixed-menu-", "").replace("-option", "")) ||
117203
117396
  "";
117204
117397
  this.fixedMenuOptions = async () => {
117205
- (await this.fixedMenuArrowSelector.isVisible()) &&
117206
- (await this.fixedMenuArrowSelector.click());
117207
117398
  const fixedMenuButtons = await this.editorWrapper
117208
117399
  .getByTestId(NEETO_EDITOR_SELECTORS.fixedMenuWrapper)
117209
117400
  .getByRole("button")
@@ -117268,7 +117459,7 @@ class EditorPage {
117268
117459
  await test.expect(this.contentField
117269
117460
  .getByRole(textModifierRole)
117270
117461
  .filter({ hasText: randomText })).toBeVisible();
117271
- await this.moveCursorAtBottom();
117462
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117272
117463
  await this.page.keyboard.press("Enter");
117273
117464
  if (modifierKey !== "codeBlock") {
117274
117465
  isButtonInMoreMenu && (await this.moreMenuSelector.click());
@@ -117285,7 +117476,7 @@ class EditorPage {
117285
117476
  await test.expect(this.contentField
117286
117477
  .locator(TEXT_MODIFIER_TAGS[modifierKey])
117287
117478
  .filter({ hasText: randomText })).toBeVisible();
117288
- await this.moveCursorAtBottom();
117479
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117289
117480
  isButtonInMoreMenu && (await this.moreMenuSelector.click());
117290
117481
  await textModifierSelector.click();
117291
117482
  return [{ key: modifierKey, value: randomText }];
@@ -117299,7 +117490,7 @@ class EditorPage {
117299
117490
  await test.expect(this.page.getByTestId(COMMON_SELECTORS.customDropdownContainer())).toBeVisible({ timeout: 5000 });
117300
117491
  }).toPass({ timeout: 30000 });
117301
117492
  this.focusText = (textLocator) => {
117302
- const platform = require$$0$9.platform();
117493
+ const platform = require$$0$5.platform();
117303
117494
  return test.expect(async () => {
117304
117495
  await textLocator.click();
117305
117496
  platform === "darwin"
@@ -117331,7 +117522,7 @@ class EditorPage {
117331
117522
  this.verifyTextHighlighter = async (isButtonInMoreMenu, highlighterCount = this.highlighterCount) => {
117332
117523
  const highlightedKeyValuePairs = [];
117333
117524
  for (let colorIdx = 1; colorIdx <= highlighterCount; colorIdx++) {
117334
- await this.moveCursorAtBottom();
117525
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117335
117526
  const randomText = await this.highlightText(isButtonInMoreMenu, colorIdx);
117336
117527
  highlightedKeyValuePairs.push({
117337
117528
  key: `highlight-${colorIdx}`,
@@ -117349,7 +117540,7 @@ class EditorPage {
117349
117540
  await test.expect(this.contentField
117350
117541
  .locator(LIST_MODIFIER_TAGS[modifierKey])
117351
117542
  .filter({ hasText: randomText })).toBeVisible();
117352
- await this.moveCursorAtBottom();
117543
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117353
117544
  isButtonInMoreMenu && (await this.moreMenuSelector.click());
117354
117545
  await listModifierSelector.click();
117355
117546
  return [{ key: modifierKey, value: randomText }];
@@ -117366,7 +117557,7 @@ class EditorPage {
117366
117557
  .click();
117367
117558
  const linkRole = DESCRIPTION_EDITOR_TEXTS.link;
117368
117559
  await test.expect(this.contentField.getByRole(linkRole)).toBeVisible();
117369
- await this.moveCursorAtBottom();
117560
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117370
117561
  return [{ key: "link", value: randomText }];
117371
117562
  };
117372
117563
  this.verifyEditorAttachmentsButton = async (filePath, isButtonInMoreMenu, shouldRemoveAttachment = false) => {
@@ -117536,7 +117727,7 @@ class EditorPage {
117536
117727
  await test.expect(this.contentField.locator(NEETO_EDITOR_SELECTORS.todoList, {
117537
117728
  hasText: randomText,
117538
117729
  })).toBeVisible();
117539
- await this.moveCursorAtBottom();
117730
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117540
117731
  return [{ key: "todoList", value: randomText }];
117541
117732
  };
117542
117733
  this.verifyDynamicVariables = async (dynamicVariables) => {
@@ -117555,7 +117746,7 @@ class EditorPage {
117555
117746
  const calloutTypes = ["default", "info", "warning", "error", "success"];
117556
117747
  const calloutContentField = this.contentField.locator(NEETO_EDITOR_SELECTORS.calloutContent);
117557
117748
  const calloutTypeOption = this.page.locator(NEETO_EDITOR_SELECTORS.calloutTypeOption);
117558
- await this.moveCursorAtBottom();
117749
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117559
117750
  for (const [index, type] of calloutTypes.entries()) {
117560
117751
  await this.calloutSelector.click();
117561
117752
  const calloutType = calloutTypeOption.filter({ hasText: type });
@@ -117570,7 +117761,7 @@ class EditorPage {
117570
117761
  // The index is important here as it determines which callout content field to interact with
117571
117762
  // eslint-disable-next-line playwright/no-nth-methods
117572
117763
  await test.expect(calloutContentField.nth(index)).toContainText(randomText);
117573
- await this.moveCursorAtBottom();
117764
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117574
117765
  }
117575
117766
  return [{ key: "callout" }];
117576
117767
  };
@@ -117606,11 +117797,21 @@ class EditorPage {
117606
117797
  }),
117607
117798
  todoList: isButtonInMoreMenu => this.verifyTodoListSelector(isButtonInMoreMenu),
117608
117799
  };
117800
+ this.fillRandomText = async () => {
117801
+ let randomText;
117802
+ do {
117803
+ randomText = faker.faker.lorem.word(10);
117804
+ } while (this.wordsUsedInEditor.includes(randomText));
117805
+ await this.contentField.focus();
117806
+ await this.neetoPlaywrightUtilities.moveCursorAtBottom();
117807
+ await this.page.keyboard.type(randomText);
117808
+ this.wordsUsedInEditor.push(randomText);
117809
+ const randomTextLocator = this.contentField.getByText(randomText);
117810
+ await randomTextLocator.scrollIntoViewIfNeeded();
117811
+ await randomTextLocator.click({ clickCount: 3 });
117812
+ return randomText;
117813
+ };
117609
117814
  this.verifyDescriptionEditor = async ({ dynamicVariables, linkUrl, videoPath, filePath, imageUrl, videoUrl, highlighterCount, cannedResponseSuccessMessage, } = {}) => {
117610
- const fixedMenuButtons = await this.fixedMenuOptions();
117611
- let moreMenuButtons = [];
117612
- (await this.moreMenuSelector.isVisible()) &&
117613
- (moreMenuButtons = await this.moreMenuOptions());
117614
117815
  this.linkUrl = linkUrl || this.linkUrl;
117615
117816
  this.filePath = filePath || this.filePath;
117616
117817
  this.videoPath = videoPath || this.videoPath;
@@ -117618,50 +117819,36 @@ class EditorPage {
117618
117819
  this.videoUrl = videoUrl || this.videoUrl;
117619
117820
  this.highlighterCount = highlighterCount || this.highlighterCount;
117620
117821
  this.cannedResponseSuccessMessage = cannedResponseSuccessMessage;
117822
+ await test.expect(this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.contentField)).toBeVisible();
117823
+ const isFixedMenuTypeEditor = await this.editorWrapper
117824
+ .getByTestId(NEETO_EDITOR_SELECTORS.fixedMenuWrapper)
117825
+ .isVisible();
117826
+ const keysAndValues = isFixedMenuTypeEditor
117827
+ ? await this.editorWithFixedMenuButtons()
117828
+ : await this.slashCommandEditorPage.verifySlashCommandEditor();
117829
+ dynamicVariables && (await this.verifyDynamicVariables(dynamicVariables));
117830
+ return keysAndValues;
117831
+ };
117832
+ this.editorWithFixedMenuButtons = async () => {
117833
+ const fixedMenuButtons = await this.fixedMenuOptions();
117834
+ let moreMenuButtons = [];
117835
+ (await this.moreMenuSelector.isVisible()) &&
117836
+ (moreMenuButtons = await this.moreMenuOptions());
117621
117837
  const keysAndValues = [];
117622
117838
  for (const button of [...fixedMenuButtons, ...moreMenuButtons]) {
117623
117839
  const isMoreMenuButton = moreMenuButtons.includes(button);
117624
117840
  const keyValuesForButton = await this.buttonsAndVerifications[button](isMoreMenuButton);
117625
117841
  keysAndValues.push(...keyValuesForButton);
117626
117842
  }
117627
- dynamicVariables && (await this.verifyDynamicVariables(dynamicVariables));
117628
117843
  return keysAndValues;
117629
117844
  };
117630
- this.moveCursorAtBottom = async () => {
117631
- const platform = require$$0$9.platform();
117632
- if (platform === "darwin") {
117633
- await this.page.keyboard.press("Meta+ArrowRight");
117634
- await this.page.keyboard.press("Meta+ArrowDown");
117635
- }
117636
- else {
117637
- await this.page.keyboard.press("End");
117638
- await this.page.keyboard.press("PageDown");
117639
- }
117640
- // eslint-disable-next-line playwright/no-wait-for-timeout
117641
- await this.page.waitForTimeout(100); // Adding some delay for DOM to react
117642
- await this.page.keyboard.press("Enter");
117643
- };
117644
- this.fillRandomText = async () => {
117645
- let randomText;
117646
- do {
117647
- randomText = faker.faker.lorem.word(10);
117648
- } while (this.wordsUsedInEditor.includes(randomText));
117649
- await this.contentField.focus();
117650
- await this.moveCursorAtBottom();
117651
- await this.page.keyboard.type(randomText);
117652
- this.wordsUsedInEditor.push(randomText);
117653
- const randomTextLocator = this.contentField.getByText(randomText);
117654
- await randomTextLocator.scrollIntoViewIfNeeded();
117655
- await randomTextLocator.click({ clickCount: 3 });
117656
- return randomText;
117657
- };
117658
117845
  this.page = page;
117659
117846
  this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
117847
+ this.slashCommandEditorPage = new SlashCommandEditorPage(page, neetoPlaywrightUtilities, editorWrapper);
117660
117848
  this.t = playwrightI18nextFixture.getI18nInstance().t;
117661
117849
  this.editorWrapper = this.page;
117662
117850
  if (editorWrapper)
117663
117851
  this.editorWrapper = editorWrapper;
117664
- this.fixedMenuArrowSelector = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.fixedMenuArrow);
117665
117852
  this.editorLinkButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.linkOption);
117666
117853
  this.attachmentPreview = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.attachmentPreview);
117667
117854
  this.editorAttachmentsButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.editorAttachmentsButton);
@@ -123628,8 +123815,8 @@ function requireMain$1 () {
123628
123815
  hasRequiredMain$1 = 1;
123629
123816
  const fs = require$$0$4;
123630
123817
  const path = path$1;
123631
- const os = require$$0$9;
123632
- const crypto = require$$0$7;
123818
+ const os = require$$0$5;
123819
+ const crypto = require$$0$8;
123633
123820
  const packageJson = require$$4;
123634
123821
 
123635
123822
  const version = packageJson.version;