@bigbinary/neeto-playwright-commons 1.26.4 → 1.26.6
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 +274 -85
- package/index.cjs.js.map +1 -1
- package/index.d.ts +105 -4
- package/index.js +274 -85
- package/index.js.map +1 -1
- package/package.json +1 -1
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$
|
|
14
|
+
var require$$0$7 = require('stream');
|
|
14
15
|
var node_module = require('node:module');
|
|
15
|
-
var require$$0$
|
|
16
|
+
var require$$0$6 = require('buffer');
|
|
16
17
|
var require$$1$2 = require('string_decoder');
|
|
17
|
-
var require$$0$
|
|
18
|
+
var require$$0$8 = require('crypto');
|
|
18
19
|
var require$$1$3 = require('zlib');
|
|
19
|
-
var require$$0$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
29573
|
-
const Transform = require$$0$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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
|
|
@@ -116201,9 +116217,10 @@ class IntegrationBase {
|
|
|
116201
116217
|
await this.gotoIntegrationIndex();
|
|
116202
116218
|
await this.clickOnIntegrationCard();
|
|
116203
116219
|
await this.page.getByTestId(INTEGRATION_SELECTORS.disconnectButton).click();
|
|
116204
|
-
await this.
|
|
116205
|
-
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
116206
|
-
|
|
116220
|
+
await this.neetoPlaywrightUtilities.clickButtonAndAwaitLoad({
|
|
116221
|
+
locator: this.page.getByTestId(COMMON_SELECTORS.alertModalSubmitButton),
|
|
116222
|
+
timeout: 15000,
|
|
116223
|
+
});
|
|
116207
116224
|
await this.neetoPlaywrightUtilities.verifyToast();
|
|
116208
116225
|
};
|
|
116209
116226
|
this.connect = async (skipGoTo) => {
|
|
@@ -116219,13 +116236,14 @@ class IntegrationBase {
|
|
|
116219
116236
|
await this.page.waitForLoadState("domcontentloaded", { timeout: 35000 });
|
|
116220
116237
|
};
|
|
116221
116238
|
this.verifyIntegrationStatus = async (status = "connected", visibilityTimeout = 15000) => {
|
|
116239
|
+
const isConnected = status === "connected";
|
|
116222
116240
|
await this.gotoIntegrationIndex();
|
|
116223
|
-
|
|
116224
|
-
await test.expect(this.integrationCard.getByTestId(INTEGRATION_SELECTORS.integrationStatusTag)).toBeVisible({ timeout: visibilityTimeout });
|
|
116225
|
-
}
|
|
116241
|
+
isConnected &&
|
|
116242
|
+
(await test.expect(this.integrationCard.getByTestId(INTEGRATION_SELECTORS.integrationStatusTag)).toBeVisible({ timeout: visibilityTimeout }));
|
|
116226
116243
|
await this.clickOnIntegrationCard();
|
|
116227
|
-
|
|
116228
|
-
|
|
116244
|
+
await test.expect(this.page.getByRole("heading", {
|
|
116245
|
+
name: isConnected ? this.connectedHeader : this.connectHeader,
|
|
116246
|
+
})).toBeVisible();
|
|
116229
116247
|
};
|
|
116230
116248
|
this.clickOnIntegrationCard = async () => {
|
|
116231
116249
|
await this.neetoPlaywrightUtilities.waitForPageLoad({
|
|
@@ -116249,7 +116267,7 @@ class IntegrationBase {
|
|
|
116249
116267
|
this.t = playwrightI18nextFixture.getI18nInstance().t;
|
|
116250
116268
|
this.integration = integration;
|
|
116251
116269
|
this.integrationCard = this.page.getByTestId(INTEGRATION_SELECTORS.integrationCard(integration));
|
|
116252
|
-
this.pageloaderTimeout = pageloaderTimeout ||
|
|
116270
|
+
this.pageloaderTimeout = pageloaderTimeout || 35000;
|
|
116253
116271
|
this.integrationRouteIndex = integrationRouteIndex || "";
|
|
116254
116272
|
this.integrationRouteResponsesParams =
|
|
116255
116273
|
integrationRouteResponsesParams || {};
|
|
@@ -117189,6 +117207,183 @@ const LIST_MODIFIER_TAGS = {
|
|
|
117189
117207
|
orderedList: "ol",
|
|
117190
117208
|
};
|
|
117191
117209
|
|
|
117210
|
+
class SlashCommandEditorPage {
|
|
117211
|
+
constructor(page, neetoPlaywrightUtilities, editorWrapper) {
|
|
117212
|
+
this.wordsUsedInEditor = [];
|
|
117213
|
+
this.filePath = "../../../e2e/assets/images/BigBinary.png";
|
|
117214
|
+
this.linkUrl = faker.faker.internet.url();
|
|
117215
|
+
this.imageUrl = "https://picsum.photos/200/300";
|
|
117216
|
+
this.openSlashCommands = async () => {
|
|
117217
|
+
await this.editorWrapper
|
|
117218
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
117219
|
+
.focus();
|
|
117220
|
+
await this.neetoPlaywrightUtilities.moveCursorAtBottom();
|
|
117221
|
+
await this.page.keyboard.press("/");
|
|
117222
|
+
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
|
|
117223
|
+
).toBeVisible();
|
|
117224
|
+
};
|
|
117225
|
+
this.slashCommandsOptions = async () => {
|
|
117226
|
+
await this.openSlashCommands();
|
|
117227
|
+
const slashCommandButtonTexts = await this.page
|
|
117228
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.itemBlockHeading)
|
|
117229
|
+
.allInnerTexts();
|
|
117230
|
+
return slashCommandButtonTexts;
|
|
117231
|
+
};
|
|
117232
|
+
this.verifyFontSize = async (fontSize) => {
|
|
117233
|
+
const randomText = await this.fillRandomText();
|
|
117234
|
+
if (fontSize === "normal") {
|
|
117235
|
+
await test.expect(this.contentField.getByRole("paragraph").filter({ hasText: randomText })).toBeVisible();
|
|
117236
|
+
}
|
|
117237
|
+
else {
|
|
117238
|
+
await test.expect(this.contentField.getByRole("heading", {
|
|
117239
|
+
level: Number(fontSize),
|
|
117240
|
+
name: randomText,
|
|
117241
|
+
})).toBeVisible();
|
|
117242
|
+
return [{ key: `h${fontSize}`, value: randomText }];
|
|
117243
|
+
}
|
|
117244
|
+
};
|
|
117245
|
+
this.verifyTextModifiers = async (modifier) => {
|
|
117246
|
+
const modifierKey = modifier;
|
|
117247
|
+
const textModifierRole = TEXT_MODIFIER_ROLES[modifierKey];
|
|
117248
|
+
const randomText = await this.fillRandomText();
|
|
117249
|
+
await test.expect(this.contentField
|
|
117250
|
+
.getByRole(textModifierRole)
|
|
117251
|
+
.filter({ hasText: randomText })).toBeVisible();
|
|
117252
|
+
await this.neetoPlaywrightUtilities.moveCursorAtBottom();
|
|
117253
|
+
modifierKey === "codeBlock" && (await this.page.keyboard.press("Enter"));
|
|
117254
|
+
return [{ key: modifierKey, value: randomText }];
|
|
117255
|
+
};
|
|
117256
|
+
this.verifyTextDeskModifier = async (modifier) => {
|
|
117257
|
+
const modifierKey = modifier;
|
|
117258
|
+
const randomText = await this.fillRandomText();
|
|
117259
|
+
await test.expect(this.contentField
|
|
117260
|
+
.locator(TEXT_MODIFIER_TAGS[modifierKey])
|
|
117261
|
+
.filter({ hasText: randomText })).toBeVisible();
|
|
117262
|
+
return [{ key: modifierKey, value: randomText }];
|
|
117263
|
+
};
|
|
117264
|
+
this.verifyListModifiers = async (modifier) => {
|
|
117265
|
+
const modifierKey = modifier;
|
|
117266
|
+
const randomText = await this.fillRandomText();
|
|
117267
|
+
await test.expect(this.contentField
|
|
117268
|
+
.locator(LIST_MODIFIER_TAGS[modifierKey])
|
|
117269
|
+
.filter({ hasText: randomText })).toBeVisible();
|
|
117270
|
+
await this.neetoPlaywrightUtilities.moveCursorAtBottom();
|
|
117271
|
+
return [{ key: modifierKey, value: randomText }];
|
|
117272
|
+
};
|
|
117273
|
+
this.verifyEditorLinkButton = async (linkUrl) => {
|
|
117274
|
+
const randomText = this.getRandomText();
|
|
117275
|
+
await this.page
|
|
117276
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.addLinkTextField)
|
|
117277
|
+
.fill(randomText);
|
|
117278
|
+
await this.page
|
|
117279
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.addLinkUrlInput)
|
|
117280
|
+
.fill(linkUrl);
|
|
117281
|
+
await this.page
|
|
117282
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.addLinkDoneButton)
|
|
117283
|
+
.click();
|
|
117284
|
+
await test.expect(this.contentField.getByRole("link")).toBeVisible();
|
|
117285
|
+
return [{ key: "link", value: randomText }];
|
|
117286
|
+
};
|
|
117287
|
+
this.verifyEmojiSelector = async () => {
|
|
117288
|
+
const emoji = "👍";
|
|
117289
|
+
const emojiContainer = this.page.getByTestId(NEETO_EDITOR_SELECTORS.emojiContainer);
|
|
117290
|
+
await test.expect(emojiContainer).toBeVisible({
|
|
117291
|
+
timeout: 10000,
|
|
117292
|
+
});
|
|
117293
|
+
await emojiContainer
|
|
117294
|
+
.getByPlaceholder(DESCRIPTION_EDITOR_TEXTS.search)
|
|
117295
|
+
.fill(EMOJI_LABEL);
|
|
117296
|
+
await this.page.keyboard.press("Enter");
|
|
117297
|
+
await test.expect(this.contentField).toContainText(emoji);
|
|
117298
|
+
return [{ key: "emoji", value: emoji }];
|
|
117299
|
+
};
|
|
117300
|
+
this.verifyImageUploadOption = async (filePath, shouldRemoveImage = false) => {
|
|
117301
|
+
await test.expect(this.page.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.restrictionMessage)).toBeVisible();
|
|
117302
|
+
const fileUploaderPromise = this.page.waitForEvent("filechooser");
|
|
117303
|
+
await this.page
|
|
117304
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.browseText)
|
|
117305
|
+
.click();
|
|
117306
|
+
const fileUploader = await fileUploaderPromise;
|
|
117307
|
+
const imagePath = path__namespace.join(__dirname, filePath);
|
|
117308
|
+
await fileUploader.setFiles(imagePath);
|
|
117309
|
+
await test.expect(this.imageWrapper).toBeVisible({ timeout: 15000 });
|
|
117310
|
+
if (shouldRemoveImage) {
|
|
117311
|
+
await this.imageWrapper
|
|
117312
|
+
.getByTestId(COMMON_SELECTORS.dropdownIcon)
|
|
117313
|
+
.click();
|
|
117314
|
+
await this.uploadDeleteButton.click();
|
|
117315
|
+
await test.expect(this.imageWrapper).toBeHidden({
|
|
117316
|
+
timeout: 15000,
|
|
117317
|
+
});
|
|
117318
|
+
}
|
|
117319
|
+
return [{ key: "image-upload", value: imagePath }];
|
|
117320
|
+
};
|
|
117321
|
+
this.verifyDividerModifier = () => test.expect(this.contentField.locator("hr")).toBeVisible();
|
|
117322
|
+
this.slashCommandsAndVerifications = {
|
|
117323
|
+
normalText: () => this.verifyFontSize("normal"),
|
|
117324
|
+
heading1: () => this.verifyFontSize(1),
|
|
117325
|
+
heading2: () => this.verifyFontSize(2),
|
|
117326
|
+
heading3: () => this.verifyFontSize(3),
|
|
117327
|
+
heading4: () => this.verifyFontSize(4),
|
|
117328
|
+
heading5: () => this.verifyFontSize(5),
|
|
117329
|
+
bold: () => this.verifyTextModifiers("bold"),
|
|
117330
|
+
italic: () => this.verifyTextModifiers("italic"),
|
|
117331
|
+
blockQuote: () => this.verifyTextModifiers("blockquote"),
|
|
117332
|
+
codeBlock: () => this.verifyTextModifiers("codeBlock"),
|
|
117333
|
+
underline: () => this.verifyTextDeskModifier("underline"),
|
|
117334
|
+
numberedList: () => this.verifyListModifiers("orderedList"),
|
|
117335
|
+
bulletList: () => this.verifyListModifiers("bulletList"),
|
|
117336
|
+
link: () => this.verifyEditorLinkButton(this.linkUrl),
|
|
117337
|
+
image: () => this.verifyImageUploadOption(this.filePath),
|
|
117338
|
+
emoji: () => this.verifyEmojiSelector(),
|
|
117339
|
+
divider: () => this.verifyDividerModifier(),
|
|
117340
|
+
};
|
|
117341
|
+
this.getRandomText = () => {
|
|
117342
|
+
let randomText;
|
|
117343
|
+
do {
|
|
117344
|
+
randomText = faker.faker.lorem.word(10);
|
|
117345
|
+
} while (this.wordsUsedInEditor.includes(randomText));
|
|
117346
|
+
return randomText;
|
|
117347
|
+
};
|
|
117348
|
+
this.fillRandomText = async () => {
|
|
117349
|
+
const randomText = this.getRandomText();
|
|
117350
|
+
await this.page.keyboard.type(randomText);
|
|
117351
|
+
this.wordsUsedInEditor.push(randomText);
|
|
117352
|
+
const randomTextLocator = this.contentField.getByText(randomText);
|
|
117353
|
+
await randomTextLocator.scrollIntoViewIfNeeded();
|
|
117354
|
+
return randomText;
|
|
117355
|
+
};
|
|
117356
|
+
this.verifySlashCommandEditor = async ({ linkUrl, filePath, imageUrl, } = {}) => {
|
|
117357
|
+
this.linkUrl = linkUrl || this.linkUrl;
|
|
117358
|
+
this.filePath = filePath || this.filePath;
|
|
117359
|
+
this.imageUrl = imageUrl || this.imageUrl;
|
|
117360
|
+
const slashCommandButtonTexts = await this.slashCommandsOptions();
|
|
117361
|
+
const keysAndValues = [];
|
|
117362
|
+
for (const [index, buttonText] of slashCommandButtonTexts.entries()) {
|
|
117363
|
+
await this.openSlashCommands();
|
|
117364
|
+
await this.page
|
|
117365
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.commandListItem(index))
|
|
117366
|
+
.click();
|
|
117367
|
+
const keyValuesForButton = await this.slashCommandsAndVerifications[toCamelCase(buttonText)](index);
|
|
117368
|
+
keyValuesForButton && keysAndValues.push(...keyValuesForButton);
|
|
117369
|
+
}
|
|
117370
|
+
return keysAndValues;
|
|
117371
|
+
};
|
|
117372
|
+
this.page = page;
|
|
117373
|
+
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
117374
|
+
this.t = playwrightI18nextFixture.getI18nInstance().t;
|
|
117375
|
+
this.editorWrapper = this.page;
|
|
117376
|
+
if (editorWrapper)
|
|
117377
|
+
this.editorWrapper = editorWrapper;
|
|
117378
|
+
this.editorLinkButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.linkOption);
|
|
117379
|
+
this.imageWrapper = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.imageWrapper);
|
|
117380
|
+
this.uploadDeleteButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadDeleteButton);
|
|
117381
|
+
this.imageUploadOption = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadOption);
|
|
117382
|
+
this.emojiSelector = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.emojiOption);
|
|
117383
|
+
this.contentField = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.contentField);
|
|
117384
|
+
}
|
|
117385
|
+
}
|
|
117386
|
+
|
|
117192
117387
|
class EditorPage {
|
|
117193
117388
|
constructor(page, neetoPlaywrightUtilities, editorWrapper) {
|
|
117194
117389
|
this.wordsUsedInEditor = [];
|
|
@@ -117202,8 +117397,6 @@ class EditorPage {
|
|
|
117202
117397
|
this.cleanString = (selector = "") => (selector === null || selector === void 0 ? void 0 : selector.replace("neeto-editor-fixed-menu-", "").replace("-option", "")) ||
|
|
117203
117398
|
"";
|
|
117204
117399
|
this.fixedMenuOptions = async () => {
|
|
117205
|
-
(await this.fixedMenuArrowSelector.isVisible()) &&
|
|
117206
|
-
(await this.fixedMenuArrowSelector.click());
|
|
117207
117400
|
const fixedMenuButtons = await this.editorWrapper
|
|
117208
117401
|
.getByTestId(NEETO_EDITOR_SELECTORS.fixedMenuWrapper)
|
|
117209
117402
|
.getByRole("button")
|
|
@@ -117268,7 +117461,7 @@ class EditorPage {
|
|
|
117268
117461
|
await test.expect(this.contentField
|
|
117269
117462
|
.getByRole(textModifierRole)
|
|
117270
117463
|
.filter({ hasText: randomText })).toBeVisible();
|
|
117271
|
-
await this.moveCursorAtBottom();
|
|
117464
|
+
await this.neetoPlaywrightUtilities.moveCursorAtBottom();
|
|
117272
117465
|
await this.page.keyboard.press("Enter");
|
|
117273
117466
|
if (modifierKey !== "codeBlock") {
|
|
117274
117467
|
isButtonInMoreMenu && (await this.moreMenuSelector.click());
|
|
@@ -117285,7 +117478,7 @@ class EditorPage {
|
|
|
117285
117478
|
await test.expect(this.contentField
|
|
117286
117479
|
.locator(TEXT_MODIFIER_TAGS[modifierKey])
|
|
117287
117480
|
.filter({ hasText: randomText })).toBeVisible();
|
|
117288
|
-
await this.moveCursorAtBottom();
|
|
117481
|
+
await this.neetoPlaywrightUtilities.moveCursorAtBottom();
|
|
117289
117482
|
isButtonInMoreMenu && (await this.moreMenuSelector.click());
|
|
117290
117483
|
await textModifierSelector.click();
|
|
117291
117484
|
return [{ key: modifierKey, value: randomText }];
|
|
@@ -117299,7 +117492,7 @@ class EditorPage {
|
|
|
117299
117492
|
await test.expect(this.page.getByTestId(COMMON_SELECTORS.customDropdownContainer())).toBeVisible({ timeout: 5000 });
|
|
117300
117493
|
}).toPass({ timeout: 30000 });
|
|
117301
117494
|
this.focusText = (textLocator) => {
|
|
117302
|
-
const platform = require$$0$
|
|
117495
|
+
const platform = require$$0$5.platform();
|
|
117303
117496
|
return test.expect(async () => {
|
|
117304
117497
|
await textLocator.click();
|
|
117305
117498
|
platform === "darwin"
|
|
@@ -117331,7 +117524,7 @@ class EditorPage {
|
|
|
117331
117524
|
this.verifyTextHighlighter = async (isButtonInMoreMenu, highlighterCount = this.highlighterCount) => {
|
|
117332
117525
|
const highlightedKeyValuePairs = [];
|
|
117333
117526
|
for (let colorIdx = 1; colorIdx <= highlighterCount; colorIdx++) {
|
|
117334
|
-
await this.moveCursorAtBottom();
|
|
117527
|
+
await this.neetoPlaywrightUtilities.moveCursorAtBottom();
|
|
117335
117528
|
const randomText = await this.highlightText(isButtonInMoreMenu, colorIdx);
|
|
117336
117529
|
highlightedKeyValuePairs.push({
|
|
117337
117530
|
key: `highlight-${colorIdx}`,
|
|
@@ -117349,7 +117542,7 @@ class EditorPage {
|
|
|
117349
117542
|
await test.expect(this.contentField
|
|
117350
117543
|
.locator(LIST_MODIFIER_TAGS[modifierKey])
|
|
117351
117544
|
.filter({ hasText: randomText })).toBeVisible();
|
|
117352
|
-
await this.moveCursorAtBottom();
|
|
117545
|
+
await this.neetoPlaywrightUtilities.moveCursorAtBottom();
|
|
117353
117546
|
isButtonInMoreMenu && (await this.moreMenuSelector.click());
|
|
117354
117547
|
await listModifierSelector.click();
|
|
117355
117548
|
return [{ key: modifierKey, value: randomText }];
|
|
@@ -117366,7 +117559,7 @@ class EditorPage {
|
|
|
117366
117559
|
.click();
|
|
117367
117560
|
const linkRole = DESCRIPTION_EDITOR_TEXTS.link;
|
|
117368
117561
|
await test.expect(this.contentField.getByRole(linkRole)).toBeVisible();
|
|
117369
|
-
await this.moveCursorAtBottom();
|
|
117562
|
+
await this.neetoPlaywrightUtilities.moveCursorAtBottom();
|
|
117370
117563
|
return [{ key: "link", value: randomText }];
|
|
117371
117564
|
};
|
|
117372
117565
|
this.verifyEditorAttachmentsButton = async (filePath, isButtonInMoreMenu, shouldRemoveAttachment = false) => {
|
|
@@ -117536,7 +117729,7 @@ class EditorPage {
|
|
|
117536
117729
|
await test.expect(this.contentField.locator(NEETO_EDITOR_SELECTORS.todoList, {
|
|
117537
117730
|
hasText: randomText,
|
|
117538
117731
|
})).toBeVisible();
|
|
117539
|
-
await this.moveCursorAtBottom();
|
|
117732
|
+
await this.neetoPlaywrightUtilities.moveCursorAtBottom();
|
|
117540
117733
|
return [{ key: "todoList", value: randomText }];
|
|
117541
117734
|
};
|
|
117542
117735
|
this.verifyDynamicVariables = async (dynamicVariables) => {
|
|
@@ -117555,7 +117748,7 @@ class EditorPage {
|
|
|
117555
117748
|
const calloutTypes = ["default", "info", "warning", "error", "success"];
|
|
117556
117749
|
const calloutContentField = this.contentField.locator(NEETO_EDITOR_SELECTORS.calloutContent);
|
|
117557
117750
|
const calloutTypeOption = this.page.locator(NEETO_EDITOR_SELECTORS.calloutTypeOption);
|
|
117558
|
-
await this.moveCursorAtBottom();
|
|
117751
|
+
await this.neetoPlaywrightUtilities.moveCursorAtBottom();
|
|
117559
117752
|
for (const [index, type] of calloutTypes.entries()) {
|
|
117560
117753
|
await this.calloutSelector.click();
|
|
117561
117754
|
const calloutType = calloutTypeOption.filter({ hasText: type });
|
|
@@ -117570,7 +117763,7 @@ class EditorPage {
|
|
|
117570
117763
|
// The index is important here as it determines which callout content field to interact with
|
|
117571
117764
|
// eslint-disable-next-line playwright/no-nth-methods
|
|
117572
117765
|
await test.expect(calloutContentField.nth(index)).toContainText(randomText);
|
|
117573
|
-
await this.moveCursorAtBottom();
|
|
117766
|
+
await this.neetoPlaywrightUtilities.moveCursorAtBottom();
|
|
117574
117767
|
}
|
|
117575
117768
|
return [{ key: "callout" }];
|
|
117576
117769
|
};
|
|
@@ -117606,11 +117799,21 @@ class EditorPage {
|
|
|
117606
117799
|
}),
|
|
117607
117800
|
todoList: isButtonInMoreMenu => this.verifyTodoListSelector(isButtonInMoreMenu),
|
|
117608
117801
|
};
|
|
117802
|
+
this.fillRandomText = async () => {
|
|
117803
|
+
let randomText;
|
|
117804
|
+
do {
|
|
117805
|
+
randomText = faker.faker.lorem.word(10);
|
|
117806
|
+
} while (this.wordsUsedInEditor.includes(randomText));
|
|
117807
|
+
await this.contentField.focus();
|
|
117808
|
+
await this.neetoPlaywrightUtilities.moveCursorAtBottom();
|
|
117809
|
+
await this.page.keyboard.type(randomText);
|
|
117810
|
+
this.wordsUsedInEditor.push(randomText);
|
|
117811
|
+
const randomTextLocator = this.contentField.getByText(randomText);
|
|
117812
|
+
await randomTextLocator.scrollIntoViewIfNeeded();
|
|
117813
|
+
await randomTextLocator.click({ clickCount: 3 });
|
|
117814
|
+
return randomText;
|
|
117815
|
+
};
|
|
117609
117816
|
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
117817
|
this.linkUrl = linkUrl || this.linkUrl;
|
|
117615
117818
|
this.filePath = filePath || this.filePath;
|
|
117616
117819
|
this.videoPath = videoPath || this.videoPath;
|
|
@@ -117618,50 +117821,36 @@ class EditorPage {
|
|
|
117618
117821
|
this.videoUrl = videoUrl || this.videoUrl;
|
|
117619
117822
|
this.highlighterCount = highlighterCount || this.highlighterCount;
|
|
117620
117823
|
this.cannedResponseSuccessMessage = cannedResponseSuccessMessage;
|
|
117824
|
+
await test.expect(this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.contentField)).toBeVisible();
|
|
117825
|
+
const isFixedMenuTypeEditor = await this.editorWrapper
|
|
117826
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.fixedMenuWrapper)
|
|
117827
|
+
.isVisible();
|
|
117828
|
+
const keysAndValues = isFixedMenuTypeEditor
|
|
117829
|
+
? await this.editorWithFixedMenuButtons()
|
|
117830
|
+
: await this.slashCommandEditorPage.verifySlashCommandEditor();
|
|
117831
|
+
dynamicVariables && (await this.verifyDynamicVariables(dynamicVariables));
|
|
117832
|
+
return keysAndValues;
|
|
117833
|
+
};
|
|
117834
|
+
this.editorWithFixedMenuButtons = async () => {
|
|
117835
|
+
const fixedMenuButtons = await this.fixedMenuOptions();
|
|
117836
|
+
let moreMenuButtons = [];
|
|
117837
|
+
(await this.moreMenuSelector.isVisible()) &&
|
|
117838
|
+
(moreMenuButtons = await this.moreMenuOptions());
|
|
117621
117839
|
const keysAndValues = [];
|
|
117622
117840
|
for (const button of [...fixedMenuButtons, ...moreMenuButtons]) {
|
|
117623
117841
|
const isMoreMenuButton = moreMenuButtons.includes(button);
|
|
117624
117842
|
const keyValuesForButton = await this.buttonsAndVerifications[button](isMoreMenuButton);
|
|
117625
117843
|
keysAndValues.push(...keyValuesForButton);
|
|
117626
117844
|
}
|
|
117627
|
-
dynamicVariables && (await this.verifyDynamicVariables(dynamicVariables));
|
|
117628
117845
|
return keysAndValues;
|
|
117629
117846
|
};
|
|
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
117847
|
this.page = page;
|
|
117659
117848
|
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
117849
|
+
this.slashCommandEditorPage = new SlashCommandEditorPage(page, neetoPlaywrightUtilities, editorWrapper);
|
|
117660
117850
|
this.t = playwrightI18nextFixture.getI18nInstance().t;
|
|
117661
117851
|
this.editorWrapper = this.page;
|
|
117662
117852
|
if (editorWrapper)
|
|
117663
117853
|
this.editorWrapper = editorWrapper;
|
|
117664
|
-
this.fixedMenuArrowSelector = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.fixedMenuArrow);
|
|
117665
117854
|
this.editorLinkButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.linkOption);
|
|
117666
117855
|
this.attachmentPreview = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.attachmentPreview);
|
|
117667
117856
|
this.editorAttachmentsButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.editorAttachmentsButton);
|
|
@@ -123628,8 +123817,8 @@ function requireMain$1 () {
|
|
|
123628
123817
|
hasRequiredMain$1 = 1;
|
|
123629
123818
|
const fs = require$$0$4;
|
|
123630
123819
|
const path = path$1;
|
|
123631
|
-
const os = require$$0$
|
|
123632
|
-
const crypto = require$$0$
|
|
123820
|
+
const os = require$$0$5;
|
|
123821
|
+
const crypto = require$$0$8;
|
|
123633
123822
|
const packageJson = require$$4;
|
|
123634
123823
|
|
|
123635
123824
|
const version = packageJson.version;
|