@bigbinary/neeto-playwright-commons 1.9.2 → 1.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +579 -74
- package/index.cjs.js.map +1 -1
- package/index.d.ts +383 -1
- package/index.js +590 -101
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -4,12 +4,13 @@ import * as fs$d from 'fs';
|
|
|
4
4
|
import fs__default, { writeFileSync as writeFileSync$1, unlinkSync, readFileSync } from 'fs';
|
|
5
5
|
import { curry, not, isEmpty as isEmpty$1, isNil, isNotNil, mergeDeepLeft, mergeAll } from 'ramda';
|
|
6
6
|
import require$$0$2 from 'util';
|
|
7
|
+
import * as Path from 'path';
|
|
8
|
+
import Path__default from 'path';
|
|
7
9
|
import { faker } from '@faker-js/faker';
|
|
8
10
|
import MailosaurClient from 'mailosaur';
|
|
9
11
|
import dayjs from 'dayjs';
|
|
10
12
|
import require$$1$1 from 'tty';
|
|
11
13
|
import require$$0$3 from 'os';
|
|
12
|
-
import Path from 'path';
|
|
13
14
|
import Stream$4 from 'stream';
|
|
14
15
|
import require$$0$4 from 'events';
|
|
15
16
|
import { getI18nInstance, initI18n } from 'playwright-i18next-fixture';
|
|
@@ -26,6 +27,59 @@ import require$$1$2 from 'string_decoder';
|
|
|
26
27
|
import require$$4$1 from 'timers';
|
|
27
28
|
import require$$3$2 from 'crypto';
|
|
28
29
|
|
|
30
|
+
const BASE_URL = "/api/v1";
|
|
31
|
+
const NEETO_AUTH_BASE_URL = (subdomain = "app") => `https://${subdomain}.neetoauth.net`;
|
|
32
|
+
const ROUTES = {
|
|
33
|
+
neetoAuthSignup: `${NEETO_AUTH_BASE_URL()}/signups/new`,
|
|
34
|
+
neetoAuth: NEETO_AUTH_BASE_URL(),
|
|
35
|
+
loginLink: "/login",
|
|
36
|
+
profile: "/profile",
|
|
37
|
+
admin: "/admin",
|
|
38
|
+
myProfile: "/my/profile",
|
|
39
|
+
authSettings: "/settings",
|
|
40
|
+
webhooks: "/webhooks",
|
|
41
|
+
login: `${BASE_URL}/login`,
|
|
42
|
+
signup: `${BASE_URL}/signups`,
|
|
43
|
+
subdomainAvailability: `${BASE_URL}/subdomain_availability`,
|
|
44
|
+
countries: `${BASE_URL}/countries`,
|
|
45
|
+
neetoApps: `${BASE_URL}/neeto_apps`,
|
|
46
|
+
directUploads: "/direct_uploads",
|
|
47
|
+
teamMembers: {
|
|
48
|
+
all: "/team_members*/**",
|
|
49
|
+
bulkUpdate: "/team_members/teams/bulk_update",
|
|
50
|
+
index: "/team_members/teams",
|
|
51
|
+
show: (id) => `/team_members/teams/${id}`,
|
|
52
|
+
},
|
|
53
|
+
attachment: `/neeto_editor${BASE_URL}/direct_uploads/attach`,
|
|
54
|
+
};
|
|
55
|
+
const API_ROUTES = {
|
|
56
|
+
teamMembers: {
|
|
57
|
+
all: "/team_members*/**",
|
|
58
|
+
bulkUpdate: "/team_members/teams/bulk_update",
|
|
59
|
+
index: "/team_members/teams",
|
|
60
|
+
show: (id) => `/team_members/teams/${id}`,
|
|
61
|
+
},
|
|
62
|
+
integrations: {
|
|
63
|
+
zapier: {
|
|
64
|
+
api_keys: "/neeto_integrations/zapier/api_keys",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
const THIRD_PARTY_ROUTES = {
|
|
69
|
+
webhooks: { site: "https://webhook.site/" },
|
|
70
|
+
slack: {
|
|
71
|
+
loginWithPassword: (workspace) => `https://${workspace}.slack.com/sign_in_with_password`,
|
|
72
|
+
},
|
|
73
|
+
zapier: {
|
|
74
|
+
login: "https://zapier.com/app/login",
|
|
75
|
+
logOut: "https://zapier.com/logout",
|
|
76
|
+
zapEditor: (zapId) => `https://zapier.com/editor/${zapId}`,
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
const NEETO_ROUTES = {
|
|
80
|
+
imageUploader: "/neeto_image_uploader_engine",
|
|
81
|
+
};
|
|
82
|
+
|
|
29
83
|
const NEETO_FILTERS_SELECTORS = {
|
|
30
84
|
emailSelectContainer: "email-select-container-wrapper",
|
|
31
85
|
filterPaneHeading: "neeto-filters-pane-header",
|
|
@@ -45,6 +99,34 @@ const NEETO_FILTERS_SELECTORS = {
|
|
|
45
99
|
searchTermBlock: "neeto-filters-search-term-block",
|
|
46
100
|
};
|
|
47
101
|
|
|
102
|
+
const NEETO_IMAGE_UPLOADER_SELECTORS = {
|
|
103
|
+
imageUploaderWrapper: "image-uploader-wrapper",
|
|
104
|
+
browseText: "neeto-image-uploader-browse-text",
|
|
105
|
+
fileInput: "neeto-image-uploader-file-input",
|
|
106
|
+
uploadedImage: "uploaded-image",
|
|
107
|
+
uploadNewAsset: "upload-new-asset",
|
|
108
|
+
basicImageUploaderRemoveButton: "basic-image-uploader-remove-button",
|
|
109
|
+
removeButton: "image-uploader-remove-button",
|
|
110
|
+
openImageLibraryButton: "image-uploader-open-image-library-button",
|
|
111
|
+
openAssetLibraryButton: "open-asset-library-button",
|
|
112
|
+
imageEditorBackButton: "image-editor-back-button",
|
|
113
|
+
aspectRatioWidthInput: "aspect-ratio-width-input",
|
|
114
|
+
aspectRatioHeightInput: "aspect-ratio-height-input",
|
|
115
|
+
cropSubmitButton: "neeto-image-uploader-crop-submit-button",
|
|
116
|
+
restrictionMessage: "neeto-image-uploader-restriction-message",
|
|
117
|
+
progressBar: "neeto-image-uploader-progress-bar",
|
|
118
|
+
myImagesTab: "neeto-image-uploader-my-images-tab",
|
|
119
|
+
unsplashTab: "neeto-image-uploader-unsplash-tab",
|
|
120
|
+
nthLibraryImage: (index) => `niu-library-image-${index}`,
|
|
121
|
+
nthUnsplashImage: (index) => `niu-unsplash-image-${index}`,
|
|
122
|
+
unsplashSearchInput: "niu-unsplash-image-picker-search-input",
|
|
123
|
+
imageEditorUploadedImage: "image-editor-uploaded-image",
|
|
124
|
+
selectOriginalImageSwitch: "select-original-image-switch",
|
|
125
|
+
lockAspectRatioSwitch: "lock-aspect-ratio-switch",
|
|
126
|
+
widthInputField: "width-input-field",
|
|
127
|
+
heightInputField: "height-input-field",
|
|
128
|
+
};
|
|
129
|
+
|
|
48
130
|
const ENVIRONMENT = {
|
|
49
131
|
development: "development",
|
|
50
132
|
staging: "staging",
|
|
@@ -2504,6 +2586,12 @@ var lib$7 = {
|
|
|
2504
2586
|
|
|
2505
2587
|
var qs$1 = /*@__PURE__*/getDefaultExportFromCjs(lib$7);
|
|
2506
2588
|
|
|
2589
|
+
const getImagePathAndName = (localImagePath) => {
|
|
2590
|
+
const imagePath = Path__default.join(__dirname, localImagePath);
|
|
2591
|
+
const imageName = Path__default.basename(localImagePath, Path__default.extname(localImagePath));
|
|
2592
|
+
return { imagePath, imageName };
|
|
2593
|
+
};
|
|
2594
|
+
|
|
2507
2595
|
class CustomCommands {
|
|
2508
2596
|
constructor(page, request, baseURL = process.env.BASE_URL) {
|
|
2509
2597
|
this.interceptMultipleResponses = ({ responseUrl = "", responseStatus = 200, times = 1, baseUrl, customPageContext, timeout = 35000, } = {}) => {
|
|
@@ -2618,6 +2706,20 @@ class CustomCommands {
|
|
|
2618
2706
|
await expect(this.page.getByTestId(countSelector)).toContainText(countText);
|
|
2619
2707
|
}).toPass({ timeout: 15000 });
|
|
2620
2708
|
};
|
|
2709
|
+
this.uploadImage = async (localImagePath) => {
|
|
2710
|
+
const { imageName, imagePath } = getImagePathAndName(localImagePath);
|
|
2711
|
+
await this.page
|
|
2712
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.browseText)
|
|
2713
|
+
.click();
|
|
2714
|
+
const uploadFile = this.interceptMultipleResponses({
|
|
2715
|
+
responseUrl: ROUTES.directUploads,
|
|
2716
|
+
});
|
|
2717
|
+
await this.page
|
|
2718
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.fileInput)
|
|
2719
|
+
.setInputFiles(imagePath);
|
|
2720
|
+
await uploadFile;
|
|
2721
|
+
await expect(this.page.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.uploadedImage)).toHaveAttribute("src", new RegExp(imageName), { timeout: 20000 });
|
|
2722
|
+
};
|
|
2621
2723
|
this.page = page;
|
|
2622
2724
|
this.responses = [];
|
|
2623
2725
|
this.request = request;
|
|
@@ -5617,7 +5719,7 @@ var path$a = {};
|
|
|
5617
5719
|
Object.defineProperty(path$a, "__esModule", { value: true });
|
|
5618
5720
|
path$a.convertPosixPathToPattern = path$a.convertWindowsPathToPattern = path$a.convertPathToPattern = path$a.escapePosixPath = path$a.escapeWindowsPath = path$a.escape = path$a.removeLeadingDotSegment = path$a.makeAbsolute = path$a.unixify = void 0;
|
|
5619
5721
|
const os$1 = require$$0$3;
|
|
5620
|
-
const path$9 =
|
|
5722
|
+
const path$9 = Path__default;
|
|
5621
5723
|
const IS_WINDOWS_PLATFORM = os$1.platform() === 'win32';
|
|
5622
5724
|
const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
|
|
5623
5725
|
/**
|
|
@@ -5857,7 +5959,7 @@ var isGlob$1 = function isGlob(str, options) {
|
|
|
5857
5959
|
};
|
|
5858
5960
|
|
|
5859
5961
|
var isGlob = isGlob$1;
|
|
5860
|
-
var pathPosixDirname =
|
|
5962
|
+
var pathPosixDirname = Path__default.posix.dirname;
|
|
5861
5963
|
var isWin32 = require$$0$3.platform() === 'win32';
|
|
5862
5964
|
|
|
5863
5965
|
var slash = '/';
|
|
@@ -7319,7 +7421,7 @@ var braces_1 = braces$1;
|
|
|
7319
7421
|
|
|
7320
7422
|
var utils$g = {};
|
|
7321
7423
|
|
|
7322
|
-
const path$8 =
|
|
7424
|
+
const path$8 = Path__default;
|
|
7323
7425
|
const WIN_SLASH = '\\\\/';
|
|
7324
7426
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
7325
7427
|
|
|
@@ -7499,7 +7601,7 @@ var constants$b = {
|
|
|
7499
7601
|
|
|
7500
7602
|
(function (exports) {
|
|
7501
7603
|
|
|
7502
|
-
const path =
|
|
7604
|
+
const path = Path__default;
|
|
7503
7605
|
const win32 = process.platform === 'win32';
|
|
7504
7606
|
const {
|
|
7505
7607
|
REGEX_BACKSLASH,
|
|
@@ -9043,7 +9145,7 @@ parse$3.fastpaths = (input, options) => {
|
|
|
9043
9145
|
|
|
9044
9146
|
var parse_1 = parse$3;
|
|
9045
9147
|
|
|
9046
|
-
const path$7 =
|
|
9148
|
+
const path$7 = Path__default;
|
|
9047
9149
|
const scan$1 = scan_1;
|
|
9048
9150
|
const parse$2 = parse_1;
|
|
9049
9151
|
const utils$d = utils$g;
|
|
@@ -9854,7 +9956,7 @@ var micromatch_1 = micromatch$1;
|
|
|
9854
9956
|
|
|
9855
9957
|
Object.defineProperty(pattern$1, "__esModule", { value: true });
|
|
9856
9958
|
pattern$1.removeDuplicateSlashes = pattern$1.matchAny = pattern$1.convertPatternsToRe = pattern$1.makeRe = pattern$1.getPatternParts = pattern$1.expandBraceExpansion = pattern$1.expandPatternsWithBraceExpansion = pattern$1.isAffectDepthOfReadingPattern = pattern$1.endsWithSlashGlobStar = pattern$1.hasGlobStar = pattern$1.getBaseDirectory = pattern$1.isPatternRelatedToParentDirectory = pattern$1.getPatternsOutsideCurrentDirectory = pattern$1.getPatternsInsideCurrentDirectory = pattern$1.getPositivePatterns = pattern$1.getNegativePatterns = pattern$1.isPositivePattern = pattern$1.isNegativePattern = pattern$1.convertToNegativePattern = pattern$1.convertToPositivePattern = pattern$1.isDynamicPattern = pattern$1.isStaticPattern = void 0;
|
|
9857
|
-
const path$6 =
|
|
9959
|
+
const path$6 = Path__default;
|
|
9858
9960
|
const globParent = globParent$1;
|
|
9859
9961
|
const micromatch = micromatch_1;
|
|
9860
9962
|
const GLOBSTAR = '**';
|
|
@@ -10799,7 +10901,7 @@ var fs$6 = {};
|
|
|
10799
10901
|
} (fs$6));
|
|
10800
10902
|
|
|
10801
10903
|
Object.defineProperty(settings$2, "__esModule", { value: true });
|
|
10802
|
-
const path$4 =
|
|
10904
|
+
const path$4 = Path__default;
|
|
10803
10905
|
const fsStat$3 = out$1;
|
|
10804
10906
|
const fs$5 = fs$6;
|
|
10805
10907
|
class Settings$1 {
|
|
@@ -11462,7 +11564,7 @@ sync$3.default = SyncProvider;
|
|
|
11462
11564
|
var settings$1 = {};
|
|
11463
11565
|
|
|
11464
11566
|
Object.defineProperty(settings$1, "__esModule", { value: true });
|
|
11465
|
-
const path$3 =
|
|
11567
|
+
const path$3 = Path__default;
|
|
11466
11568
|
const fsScandir = out$2;
|
|
11467
11569
|
class Settings {
|
|
11468
11570
|
constructor(_options = {}) {
|
|
@@ -11524,7 +11626,7 @@ function getSettings(settingsOrOptions = {}) {
|
|
|
11524
11626
|
var reader = {};
|
|
11525
11627
|
|
|
11526
11628
|
Object.defineProperty(reader, "__esModule", { value: true });
|
|
11527
|
-
const path$2 =
|
|
11629
|
+
const path$2 = Path__default;
|
|
11528
11630
|
const fsStat$2 = out$1;
|
|
11529
11631
|
const utils$7 = utils$l;
|
|
11530
11632
|
class Reader {
|
|
@@ -11912,7 +12014,7 @@ class EntryTransformer {
|
|
|
11912
12014
|
entry.default = EntryTransformer;
|
|
11913
12015
|
|
|
11914
12016
|
Object.defineProperty(provider, "__esModule", { value: true });
|
|
11915
|
-
const path$1 =
|
|
12017
|
+
const path$1 = Path__default;
|
|
11916
12018
|
const deep_1 = deep;
|
|
11917
12019
|
const entry_1 = entry$1;
|
|
11918
12020
|
const error_1 = error;
|
|
@@ -12388,7 +12490,7 @@ class EmbedBase {
|
|
|
12388
12490
|
: embedCode);
|
|
12389
12491
|
this.filePath = `tmp/${faker.word.noun()}.html`;
|
|
12390
12492
|
writeFileSync$1(this.filePath, fileContent, "utf8");
|
|
12391
|
-
await this.embedTestPage.goto(`file://${
|
|
12493
|
+
await this.embedTestPage.goto(`file://${Path__default.resolve(this.filePath)}`);
|
|
12392
12494
|
await this.embedTestPage.waitForLoadState("load");
|
|
12393
12495
|
this.embeddedFrame = this.embedTestPage.frameLocator(this.embedTestPageType === "inline"
|
|
12394
12496
|
? "iframe"
|
|
@@ -12548,54 +12650,6 @@ class EmbedBase {
|
|
|
12548
12650
|
}
|
|
12549
12651
|
}
|
|
12550
12652
|
|
|
12551
|
-
const BASE_URL = "/api/v1";
|
|
12552
|
-
const NEETO_AUTH_BASE_URL = (subdomain = "app") => `https://${subdomain}.neetoauth.net`;
|
|
12553
|
-
const ROUTES = {
|
|
12554
|
-
neetoAuthSignup: `${NEETO_AUTH_BASE_URL()}/signups/new`,
|
|
12555
|
-
neetoAuth: NEETO_AUTH_BASE_URL(),
|
|
12556
|
-
loginLink: "/login",
|
|
12557
|
-
profile: "/profile",
|
|
12558
|
-
admin: "/admin",
|
|
12559
|
-
myProfile: "/my/profile",
|
|
12560
|
-
authSettings: "/settings",
|
|
12561
|
-
webhooks: "/webhooks",
|
|
12562
|
-
login: `${BASE_URL}/login`,
|
|
12563
|
-
signup: `${BASE_URL}/signups`,
|
|
12564
|
-
subdomainAvailability: `${BASE_URL}/subdomain_availability`,
|
|
12565
|
-
countries: `${BASE_URL}/countries`,
|
|
12566
|
-
neetoApps: `${BASE_URL}/neeto_apps`,
|
|
12567
|
-
teamMembers: {
|
|
12568
|
-
all: "/team_members*/**",
|
|
12569
|
-
bulkUpdate: "/team_members/teams/bulk_update",
|
|
12570
|
-
index: "/team_members/teams",
|
|
12571
|
-
show: (id) => `/team_members/teams/${id}`,
|
|
12572
|
-
},
|
|
12573
|
-
};
|
|
12574
|
-
const API_ROUTES = {
|
|
12575
|
-
teamMembers: {
|
|
12576
|
-
all: "/team_members*/**",
|
|
12577
|
-
bulkUpdate: "/team_members/teams/bulk_update",
|
|
12578
|
-
index: "/team_members/teams",
|
|
12579
|
-
show: (id) => `/team_members/teams/${id}`,
|
|
12580
|
-
},
|
|
12581
|
-
integrations: {
|
|
12582
|
-
zapier: {
|
|
12583
|
-
api_keys: "/neeto_integrations/zapier/api_keys",
|
|
12584
|
-
},
|
|
12585
|
-
},
|
|
12586
|
-
};
|
|
12587
|
-
const THIRD_PARTY_ROUTES = {
|
|
12588
|
-
webhooks: { site: "https://webhook.site/" },
|
|
12589
|
-
slack: {
|
|
12590
|
-
loginWithPassword: (workspace) => `https://${workspace}.slack.com/sign_in_with_password`,
|
|
12591
|
-
},
|
|
12592
|
-
zapier: {
|
|
12593
|
-
login: "https://zapier.com/app/login",
|
|
12594
|
-
logOut: "https://zapier.com/logout",
|
|
12595
|
-
zapEditor: (zapId) => `https://zapier.com/editor/${zapId}`,
|
|
12596
|
-
},
|
|
12597
|
-
};
|
|
12598
|
-
|
|
12599
12653
|
const CHAT_WIDGET_TEXTS = {
|
|
12600
12654
|
newConversation: "New Conversation",
|
|
12601
12655
|
welcomeChatBubble: "Hi! I'm here to assist you with any questions you may have. What can I do for you?",
|
|
@@ -12644,6 +12698,8 @@ const TOASTR_MESSAGES = {
|
|
|
12644
12698
|
zapierApiKeyGenerated: "Zapier API key is generated successfully!",
|
|
12645
12699
|
};
|
|
12646
12700
|
const ZAPIER_LIMIT_EXHAUSTED_MESSAGE = "Zapier free task limit is exhausted. Test will be aborted";
|
|
12701
|
+
const EMOJI_PICKER_LABEL = "Smileys & People";
|
|
12702
|
+
const ATTACHMENT_DELETION_TOASTR_MESSAGE = "Attachment has been successfully deleted.";
|
|
12647
12703
|
|
|
12648
12704
|
const HELP_CENTER_SELECTORS = {
|
|
12649
12705
|
helpButton: "help-button",
|
|
@@ -13480,6 +13536,463 @@ class ZapierPage extends IntegrationBase {
|
|
|
13480
13536
|
}
|
|
13481
13537
|
}
|
|
13482
13538
|
|
|
13539
|
+
const DESCRIPTION_EDITOR_TEXTS = {
|
|
13540
|
+
fontSize: "Font size",
|
|
13541
|
+
paragraph: "Paragraph",
|
|
13542
|
+
pasteLink: "Paste the link here...",
|
|
13543
|
+
invalidURLError: "Please enter a valid URL",
|
|
13544
|
+
pasteURL: "Paste URL",
|
|
13545
|
+
delete: "Delete",
|
|
13546
|
+
linkTag: "a",
|
|
13547
|
+
link: "Link",
|
|
13548
|
+
cannedResponseHeader: "Canned responses",
|
|
13549
|
+
paragraphOption: "paragraph",
|
|
13550
|
+
};
|
|
13551
|
+
const EXPANDED_FONT_SIZE = {
|
|
13552
|
+
h1: "Heading 1",
|
|
13553
|
+
h2: "Heading 2",
|
|
13554
|
+
h3: "Heading 3",
|
|
13555
|
+
h4: "Heading 4",
|
|
13556
|
+
h5: "Heading 5",
|
|
13557
|
+
};
|
|
13558
|
+
const TEXT_MODIFIER_TAGS = {
|
|
13559
|
+
underlineOption: "u",
|
|
13560
|
+
strikeOption: "s",
|
|
13561
|
+
highlightOption: "mark",
|
|
13562
|
+
};
|
|
13563
|
+
const TEXT_MODIFIER_ROLES = {
|
|
13564
|
+
boldOption: "strong",
|
|
13565
|
+
italicsOption: "emphasis",
|
|
13566
|
+
blockquoteOption: "blockquote",
|
|
13567
|
+
codeblockOption: "code",
|
|
13568
|
+
codeOption: "code",
|
|
13569
|
+
};
|
|
13570
|
+
const LIST_MODIFIER_TAGS = {
|
|
13571
|
+
bulletListOption: "ul",
|
|
13572
|
+
orderedListOption: "ol",
|
|
13573
|
+
};
|
|
13574
|
+
|
|
13575
|
+
const NEETO_EDITOR_SELECTORS = {
|
|
13576
|
+
boldOption: "neeto-editor-fixed-menu-bold-option",
|
|
13577
|
+
italicOption: "neeto-editor-fixed-menu-italic-option",
|
|
13578
|
+
underlineOption: "neeto-editor-fixed-menu-underline-option",
|
|
13579
|
+
strikeOption: "neeto-editor-fixed-menu-strike-option",
|
|
13580
|
+
codeBlockOption: "neeto-editor-fixed-menu-code-option",
|
|
13581
|
+
highlightOption: "neeto-editor-fixed-menu-highlight-option",
|
|
13582
|
+
linkInput: "neeto-editor-fixed-menu-link-option-input",
|
|
13583
|
+
linkSubmitButton: "neeto-editor-fixed-menu-link-option-link-button",
|
|
13584
|
+
commandList: (index) => `neeto-editor-command-list-item-${index}`,
|
|
13585
|
+
imageUploadUrlSubmitButton: "neeto-editor-media-upload-url-submit",
|
|
13586
|
+
imageUploadUrlInputTextField: "neeto-editor-media-upload-url-input",
|
|
13587
|
+
uploadInput: "neeto-editor-media-uploader-input",
|
|
13588
|
+
editorMenuBarWrapper: "neeto-editor-fixed-menu-wrapper",
|
|
13589
|
+
undoOption: "neeto-editor-fixed-menu-undo-option",
|
|
13590
|
+
redoOption: "neeto-editor-fixed-menu-redo-option",
|
|
13591
|
+
imageWrapper: "neeto-editor-image-wrapper",
|
|
13592
|
+
contentField: "neeto-editor-content",
|
|
13593
|
+
addLinkButton: "neeto-editor-fixed-menu-link-option",
|
|
13594
|
+
addLinkTextField: "neeto-editor-add-link-text-input",
|
|
13595
|
+
addURLTextField: "neeto-editor-add-link-url-input",
|
|
13596
|
+
submitLinkButton: "neeto-editor-add-link",
|
|
13597
|
+
fontSizeDropdown: (currentOption = "Paragraph") => `${joinHyphenCase(currentOption)}-dropdown-icon`,
|
|
13598
|
+
fixedMenuArrow: "neeto-editor-fixed-menu-arrow",
|
|
13599
|
+
cannedResponseOption: "neeto-editor-fixed-menu-canned-responses-option",
|
|
13600
|
+
cannedResponseSelectContainer: "select-a-canned-response-select-container",
|
|
13601
|
+
fixedMenuWrapper: "neeto-editor-fixed-menu-wrapper",
|
|
13602
|
+
linkOption: "neeto-editor-fixed-menu-link-option",
|
|
13603
|
+
addLinkUrlInput: "neeto-editor-add-link-url-input",
|
|
13604
|
+
addLinkDoneButton: "neeto-editor-add-link",
|
|
13605
|
+
unlinkButton: "neeto-editor-link-popover-unlink",
|
|
13606
|
+
editorAttachmentsButton: "neeto-editor-fixed-menu-attachments-option",
|
|
13607
|
+
attachmentPreviewDeleteButton: "neeto-editor-preview-delete-button",
|
|
13608
|
+
imageUploadOption: "neeto-editor-fixed-menu-image-upload-option",
|
|
13609
|
+
imageUploadLinkInput: "neeto-editor-media-upload-url-input",
|
|
13610
|
+
imageUploadButton: "neeto-editor-media-uploader-dnd",
|
|
13611
|
+
imageUploadLinkSubmitButton: "neeto-editor-media-upload-url-submit",
|
|
13612
|
+
applyButton: "apply-button",
|
|
13613
|
+
videoEmbedOption: "neeto-editor-fixed-menu-video-embed-option",
|
|
13614
|
+
videoEmbedInput: "neeto-editor-embed-input",
|
|
13615
|
+
videoEmbedSubmit: "neeto-editor-embed-cancel",
|
|
13616
|
+
// TODO: Fix the selector after the issue is resolved: https://github.com/bigbinary/neeto-editor/issues/1047
|
|
13617
|
+
videoWrapper: ".neeto-editor__video-wrapper",
|
|
13618
|
+
paragraphOption: "neeto-editor-fixed-menu-font-size-option-body2",
|
|
13619
|
+
attachmentPreview: "ne-attachments-wrapper",
|
|
13620
|
+
};
|
|
13621
|
+
const NEETO_TEXT_MODIFIER_SELECTORS = {
|
|
13622
|
+
strikeOption: "neeto-editor-fixed-menu-strike-option",
|
|
13623
|
+
underlineOption: "neeto-editor-fixed-menu-underline-option",
|
|
13624
|
+
highlightOption: "neeto-editor-fixed-menu-highlight-option",
|
|
13625
|
+
};
|
|
13626
|
+
const TEXT_MODIFIER_SELECTORS = {
|
|
13627
|
+
boldOption: "neeto-editor-fixed-menu-bold-option",
|
|
13628
|
+
italicsOption: "neeto-editor-fixed-menu-italic-option",
|
|
13629
|
+
codeOption: "neeto-editor-fixed-menu-code-option",
|
|
13630
|
+
blockquoteOption: "neeto-editor-fixed-menu-block-quote-option",
|
|
13631
|
+
codeblockOption: "neeto-editor-fixed-menu-code-block-option",
|
|
13632
|
+
};
|
|
13633
|
+
const LIST_MODIFIER_SELECTORS = {
|
|
13634
|
+
bulletListOption: "neeto-editor-fixed-menu-bullet-list-option",
|
|
13635
|
+
orderedListOption: "neeto-editor-fixed-menu-ordered-list-option",
|
|
13636
|
+
};
|
|
13637
|
+
const FONT_SIZE_SELECTORS = {
|
|
13638
|
+
h1: "neeto-editor-fixed-menu-font-size-option-h1",
|
|
13639
|
+
h2: "neeto-editor-fixed-menu-font-size-option-h2",
|
|
13640
|
+
h3: "neeto-editor-fixed-menu-font-size-option-h3",
|
|
13641
|
+
h4: "neeto-editor-fixed-menu-font-size-option-h4",
|
|
13642
|
+
h5: "neeto-editor-fixed-menu-font-size-option-h5",
|
|
13643
|
+
};
|
|
13644
|
+
|
|
13645
|
+
/* eslint-disable playwright/no-nth-methods */
|
|
13646
|
+
class EditorPage {
|
|
13647
|
+
constructor(page, neetoPlaywrightUtilities) {
|
|
13648
|
+
this.verifyDescriptionEditor = async ({ text, linkUrl = faker.internet.url(), fileName = "../../../e2e/assets/images/BigBinary.png", imageUrl = "https://picsum.photos/200/300", videoUrl = "https://youtu.be/jNQXAC9IVRw", cannedResponseSuccessMessage, }) => {
|
|
13649
|
+
await this.page.getByTestId(NEETO_EDITOR_SELECTORS.contentField).fill(text);
|
|
13650
|
+
await this.page
|
|
13651
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.fontSizeDropdown())
|
|
13652
|
+
.click();
|
|
13653
|
+
const fontSize = Object.keys(FONT_SIZE_SELECTORS);
|
|
13654
|
+
for (const font of fontSize) {
|
|
13655
|
+
const fontKey = font;
|
|
13656
|
+
await this.page.getByTestId(FONT_SIZE_SELECTORS[fontKey]).click();
|
|
13657
|
+
await expect(this.page
|
|
13658
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
13659
|
+
.getByRole("heading", { level: Number(font.slice(1)) })).toBeVisible();
|
|
13660
|
+
await this.page
|
|
13661
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.fontSizeDropdown(EXPANDED_FONT_SIZE[fontKey]))
|
|
13662
|
+
.click();
|
|
13663
|
+
}
|
|
13664
|
+
if (await this.paragraphSelector.isVisible()) {
|
|
13665
|
+
await this.paragraphSelector.click();
|
|
13666
|
+
const paragraphRole = DESCRIPTION_EDITOR_TEXTS.paragraphOption;
|
|
13667
|
+
await expect(this.page
|
|
13668
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
13669
|
+
.getByRole(paragraphRole)).toBeVisible();
|
|
13670
|
+
}
|
|
13671
|
+
(await this.fixedMenuArrowSelector.isVisible()) &&
|
|
13672
|
+
(await this.fixedMenuArrowSelector.click());
|
|
13673
|
+
await this.page.getByText(text).click({ clickCount: 3 });
|
|
13674
|
+
const textModifier = Object.keys(TEXT_MODIFIER_SELECTORS);
|
|
13675
|
+
for (const modifier of textModifier) {
|
|
13676
|
+
const modifierKey = modifier;
|
|
13677
|
+
const textModifierRole = TEXT_MODIFIER_ROLES[modifierKey];
|
|
13678
|
+
const textModifierSelector = this.page.getByTestId(TEXT_MODIFIER_SELECTORS[modifierKey]);
|
|
13679
|
+
if (await textModifierSelector.isVisible()) {
|
|
13680
|
+
await textModifierSelector.click();
|
|
13681
|
+
await expect(this.page
|
|
13682
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
13683
|
+
.getByRole(textModifierRole)).toBeVisible();
|
|
13684
|
+
await textModifierSelector.click();
|
|
13685
|
+
}
|
|
13686
|
+
}
|
|
13687
|
+
const textDeskModifier = Object.keys(NEETO_TEXT_MODIFIER_SELECTORS);
|
|
13688
|
+
for (const modifier of textDeskModifier) {
|
|
13689
|
+
const modifierKey = modifier;
|
|
13690
|
+
const textModifierSelector = this.page.getByTestId(NEETO_TEXT_MODIFIER_SELECTORS[modifierKey]);
|
|
13691
|
+
if (await textModifierSelector.isVisible()) {
|
|
13692
|
+
await textModifierSelector.click();
|
|
13693
|
+
await expect(this.page
|
|
13694
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
13695
|
+
.locator(TEXT_MODIFIER_TAGS[modifierKey])).toBeVisible();
|
|
13696
|
+
await textModifierSelector.click();
|
|
13697
|
+
}
|
|
13698
|
+
}
|
|
13699
|
+
const listModifier = Object.keys(LIST_MODIFIER_SELECTORS);
|
|
13700
|
+
for (const modifier of listModifier) {
|
|
13701
|
+
const modifierKey = modifier;
|
|
13702
|
+
const listModifierSelector = this.page.getByTestId(LIST_MODIFIER_SELECTORS[modifierKey]);
|
|
13703
|
+
if (await listModifierSelector.isVisible()) {
|
|
13704
|
+
await listModifierSelector.click();
|
|
13705
|
+
await expect(this.page
|
|
13706
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
13707
|
+
.locator(LIST_MODIFIER_TAGS[modifierKey])).toBeVisible();
|
|
13708
|
+
await listModifierSelector.click();
|
|
13709
|
+
}
|
|
13710
|
+
}
|
|
13711
|
+
if (await this.editorLinkButton.isVisible()) {
|
|
13712
|
+
await this.editorLinkButton.click();
|
|
13713
|
+
await this.page
|
|
13714
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.addLinkUrlInput)
|
|
13715
|
+
.fill(linkUrl);
|
|
13716
|
+
await this.page
|
|
13717
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.addLinkDoneButton)
|
|
13718
|
+
.click();
|
|
13719
|
+
const linkRole = DESCRIPTION_EDITOR_TEXTS.link;
|
|
13720
|
+
await expect(this.page
|
|
13721
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
13722
|
+
.getByRole(linkRole)).toBeVisible();
|
|
13723
|
+
await this.page.getByTestId(NEETO_EDITOR_SELECTORS.unlinkButton).click();
|
|
13724
|
+
}
|
|
13725
|
+
if (await this.editorAttachmentsButton.isVisible()) {
|
|
13726
|
+
const fileUploaderPromise = this.page.waitForEvent("filechooser");
|
|
13727
|
+
await this.editorAttachmentsButton.click();
|
|
13728
|
+
const fileUploader = await fileUploaderPromise;
|
|
13729
|
+
const imagePath = Path.join(__dirname, fileName);
|
|
13730
|
+
await fileUploader.setFiles(imagePath);
|
|
13731
|
+
await this.neetoPlaywrightUtilities.interceptMultipleResponses({
|
|
13732
|
+
responseUrl: ROUTES.attachment,
|
|
13733
|
+
});
|
|
13734
|
+
await this.neetoPlaywrightUtilities.verifySuccessToast();
|
|
13735
|
+
await expect(this.attachmentPreview).toBeVisible();
|
|
13736
|
+
await this.attachmentPreview
|
|
13737
|
+
.getByTestId(COMMON_SELECTORS.dropdownIcon)
|
|
13738
|
+
.click();
|
|
13739
|
+
await this.page
|
|
13740
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.attachmentPreviewDeleteButton)
|
|
13741
|
+
.click();
|
|
13742
|
+
await this.page
|
|
13743
|
+
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
13744
|
+
.click();
|
|
13745
|
+
}
|
|
13746
|
+
await this.neetoPlaywrightUtilities.verifySuccessToast({
|
|
13747
|
+
message: ATTACHMENT_DELETION_TOASTR_MESSAGE,
|
|
13748
|
+
});
|
|
13749
|
+
if (await this.imageUploadOption.isVisible()) {
|
|
13750
|
+
await this.imageUploadOption.click();
|
|
13751
|
+
const fileUploaderPromise = this.page.waitForEvent("filechooser");
|
|
13752
|
+
await this.page
|
|
13753
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadButton)
|
|
13754
|
+
.click();
|
|
13755
|
+
const fileUploader = await fileUploaderPromise;
|
|
13756
|
+
const imagePath = Path.join(__dirname, fileName);
|
|
13757
|
+
await fileUploader.setFiles(imagePath);
|
|
13758
|
+
await expect(this.imageWrapper).toBeVisible({ timeout: 15000 });
|
|
13759
|
+
await this.neetoPlaywrightUtilities.verifySuccessToast();
|
|
13760
|
+
await this.imageWrapper
|
|
13761
|
+
.getByTestId(COMMON_SELECTORS.dropdownIcon)
|
|
13762
|
+
.click();
|
|
13763
|
+
await this.imageUploadDeleteButton.click();
|
|
13764
|
+
await expect(this.imageWrapper).toBeHidden({
|
|
13765
|
+
timeout: 15000,
|
|
13766
|
+
});
|
|
13767
|
+
await this.imageUploadOption.click();
|
|
13768
|
+
// TODO: Fix the selector after the issue is resolved: https://github.com/bigbinary/neeto-editor/issues/1048
|
|
13769
|
+
await this.page
|
|
13770
|
+
.getByTestId(COMMON_SELECTORS.tabItem)
|
|
13771
|
+
.getByText(DESCRIPTION_EDITOR_TEXTS.link)
|
|
13772
|
+
.click();
|
|
13773
|
+
await this.page
|
|
13774
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadLinkInput)
|
|
13775
|
+
.fill(imageUrl);
|
|
13776
|
+
await this.page
|
|
13777
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadLinkSubmitButton)
|
|
13778
|
+
.click();
|
|
13779
|
+
await expect(this.imageWrapper).toBeVisible({ timeout: 15000 });
|
|
13780
|
+
await this.imageWrapper
|
|
13781
|
+
.getByTestId(COMMON_SELECTORS.dropdownIcon)
|
|
13782
|
+
.click();
|
|
13783
|
+
await this.imageUploadDeleteButton.click();
|
|
13784
|
+
await expect(this.imageWrapper).toBeHidden({
|
|
13785
|
+
timeout: 15000,
|
|
13786
|
+
});
|
|
13787
|
+
}
|
|
13788
|
+
if (await this.cannedResponseOption.isVisible()) {
|
|
13789
|
+
await this.cannedResponseOption.click();
|
|
13790
|
+
await expect(this.page.getByTestId(COMMON_SELECTORS.paneHeader)).toContainText(DESCRIPTION_EDITOR_TEXTS.cannedResponseHeader);
|
|
13791
|
+
await this.page
|
|
13792
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.cannedResponseSelectContainer)
|
|
13793
|
+
.fill(this.t("neetoRules.labels.feedback"));
|
|
13794
|
+
await this.page
|
|
13795
|
+
.getByTestId(COMMON_SELECTORS.selectOption(this.t("neetoRules.labels.feedback")))
|
|
13796
|
+
.click();
|
|
13797
|
+
await this.page.getByTestId(NEETO_EDITOR_SELECTORS.applyButton).click();
|
|
13798
|
+
await this.neetoPlaywrightUtilities.verifySuccessToast({
|
|
13799
|
+
message: cannedResponseSuccessMessage,
|
|
13800
|
+
});
|
|
13801
|
+
}
|
|
13802
|
+
if (await this.page
|
|
13803
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.videoEmbedOption)
|
|
13804
|
+
.isVisible()) {
|
|
13805
|
+
await this.videoEmbedOption.click();
|
|
13806
|
+
await this.videoEmbedOption.fill(videoUrl);
|
|
13807
|
+
await this.page
|
|
13808
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.videoEmbedSubmit)
|
|
13809
|
+
.click();
|
|
13810
|
+
await expect(this.videoWrapperSelector).toBeVisible({ timeout: 15000 });
|
|
13811
|
+
await this.videoWrapperSelector
|
|
13812
|
+
.getByTestId(COMMON_SELECTORS.dropdownIcon)
|
|
13813
|
+
.click();
|
|
13814
|
+
await this.imageUploadDeleteButton.click();
|
|
13815
|
+
await expect(this.videoWrapperSelector).toBeHidden({
|
|
13816
|
+
timeout: 15000,
|
|
13817
|
+
});
|
|
13818
|
+
}
|
|
13819
|
+
if (await this.emojiDropdownIcon.isVisible()) {
|
|
13820
|
+
await this.emojiDropdownIcon.click();
|
|
13821
|
+
await this.page
|
|
13822
|
+
.getByRole("region", {
|
|
13823
|
+
name: EMOJI_PICKER_LABEL,
|
|
13824
|
+
})
|
|
13825
|
+
.getByText("👍")
|
|
13826
|
+
.click();
|
|
13827
|
+
await expect(this.page.getByTestId(NEETO_EDITOR_SELECTORS.contentField)).toContainText("👍");
|
|
13828
|
+
}
|
|
13829
|
+
};
|
|
13830
|
+
this.page = page;
|
|
13831
|
+
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
13832
|
+
this.t = getI18nInstance().t;
|
|
13833
|
+
this.paragraphSelector = this.page.getByTestId(NEETO_EDITOR_SELECTORS.paragraphOption);
|
|
13834
|
+
this.fixedMenuArrowSelector = this.page.getByTestId(NEETO_EDITOR_SELECTORS.fixedMenuArrow);
|
|
13835
|
+
this.editorLinkButton = this.page.getByTestId(NEETO_EDITOR_SELECTORS.linkOption);
|
|
13836
|
+
this.attachmentPreview = this.page.getByTestId(NEETO_EDITOR_SELECTORS.attachmentPreview);
|
|
13837
|
+
this.editorAttachmentsButton = this.page.getByTestId(NEETO_EDITOR_SELECTORS.editorAttachmentsButton);
|
|
13838
|
+
this.imageWrapper = this.page.getByTestId(NEETO_EDITOR_SELECTORS.imageWrapper);
|
|
13839
|
+
// TODO: Fix the selector after the issue is resolved: https://github.com/bigbinary/neeto-editor/issues/1047
|
|
13840
|
+
this.imageUploadDeleteButton = this.page
|
|
13841
|
+
.getByTestId(COMMON_SELECTORS.dropdownContainer)
|
|
13842
|
+
.getByRole("button")
|
|
13843
|
+
.nth(3);
|
|
13844
|
+
this.imageUploadOption = this.page.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadOption);
|
|
13845
|
+
this.cannedResponseOption = this.page.getByTestId(NEETO_EDITOR_SELECTORS.cannedResponseOption);
|
|
13846
|
+
this.videoEmbedOption = this.page.getByTestId(NEETO_EDITOR_SELECTORS.videoEmbedOption);
|
|
13847
|
+
// TODO: Fix the selector after the issue is resolved: https://github.com/bigbinary/neeto-editor/issues/1047
|
|
13848
|
+
this.videoWrapperSelector = this.page.locator(NEETO_EDITOR_SELECTORS.videoWrapper);
|
|
13849
|
+
this.emojiDropdownIcon = this.page
|
|
13850
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.fixedMenuWrapper)
|
|
13851
|
+
.getByTestId(COMMON_SELECTORS.dropdownIcon);
|
|
13852
|
+
}
|
|
13853
|
+
}
|
|
13854
|
+
|
|
13855
|
+
class ImageUploader {
|
|
13856
|
+
constructor({ page, neetoPlaywrightUtilities, }) {
|
|
13857
|
+
this.submitCroppedImage = async () => {
|
|
13858
|
+
const cropImage = this.neetoPlaywrightUtilities.interceptMultipleResponses({
|
|
13859
|
+
responseUrl: ROUTES.directUploads,
|
|
13860
|
+
});
|
|
13861
|
+
await this.page
|
|
13862
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.cropSubmitButton)
|
|
13863
|
+
.click();
|
|
13864
|
+
await cropImage;
|
|
13865
|
+
};
|
|
13866
|
+
this.removeImage = async () => {
|
|
13867
|
+
await this.page
|
|
13868
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.imageUploaderWrapper)
|
|
13869
|
+
.getByTestId(COMMON_SELECTORS.dropdownIcon)
|
|
13870
|
+
.click();
|
|
13871
|
+
await this.page
|
|
13872
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.removeButton)
|
|
13873
|
+
.click();
|
|
13874
|
+
await expect(this.page.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.uploadedImage)).toBeHidden();
|
|
13875
|
+
};
|
|
13876
|
+
this.openImageLibrary = async () => {
|
|
13877
|
+
const fetchImages = this.neetoPlaywrightUtilities.interceptMultipleResponses({
|
|
13878
|
+
responseUrl: NEETO_ROUTES.imageUploader,
|
|
13879
|
+
});
|
|
13880
|
+
await this.page
|
|
13881
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.openAssetLibraryButton)
|
|
13882
|
+
.click();
|
|
13883
|
+
await fetchImages;
|
|
13884
|
+
};
|
|
13885
|
+
this.cropImage = async ({ toggleAspectRatioLock = false, width = "100", height = "100", aspectRatioHeight = "9", aspectRatioWidth = "16", } = {}) => {
|
|
13886
|
+
toggleAspectRatioLock &&
|
|
13887
|
+
(await this.page
|
|
13888
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.lockAspectRatioSwitch)
|
|
13889
|
+
.click());
|
|
13890
|
+
await this.page
|
|
13891
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.aspectRatioHeightInput)
|
|
13892
|
+
.fill(aspectRatioHeight);
|
|
13893
|
+
await this.page
|
|
13894
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.aspectRatioWidthInput)
|
|
13895
|
+
.fill(aspectRatioWidth);
|
|
13896
|
+
await this.page
|
|
13897
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.widthInputField)
|
|
13898
|
+
.fill(width);
|
|
13899
|
+
await this.page
|
|
13900
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.heightInputField)
|
|
13901
|
+
.fill(height);
|
|
13902
|
+
};
|
|
13903
|
+
this.uploadNewImageFromLibrary = async ({ localImagePath, toggleOrginalImage = false, toggleAspectRatioLock = false, aspectRatioHeight = "9", aspectRatioWidth = "16", width = "100", height = "100", }) => {
|
|
13904
|
+
await this.openImageLibrary();
|
|
13905
|
+
const fileUploaderPromise = this.page.waitForEvent("filechooser");
|
|
13906
|
+
await this.page
|
|
13907
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.uploadNewAsset)
|
|
13908
|
+
.click();
|
|
13909
|
+
const fileUploader = await fileUploaderPromise;
|
|
13910
|
+
const { imagePath, imageName } = getImagePathAndName(localImagePath);
|
|
13911
|
+
await fileUploader.setFiles(imagePath);
|
|
13912
|
+
await expect(this.page.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.imageEditorUploadedImage)).toHaveAttribute("src", new RegExp(imageName), { timeout: 20000 });
|
|
13913
|
+
toggleOrginalImage
|
|
13914
|
+
? await this.page
|
|
13915
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.selectOriginalImageSwitch)
|
|
13916
|
+
.click()
|
|
13917
|
+
: await this.cropImage({
|
|
13918
|
+
toggleAspectRatioLock,
|
|
13919
|
+
aspectRatioHeight,
|
|
13920
|
+
aspectRatioWidth,
|
|
13921
|
+
width,
|
|
13922
|
+
height,
|
|
13923
|
+
});
|
|
13924
|
+
await this.submitCroppedImage();
|
|
13925
|
+
};
|
|
13926
|
+
this.selectImageFromWeb = async ({ nthImage = 0, searchTerm = "", toggleOrginalImage = false, toggleAspectRatioLock = false, aspectRatioHeight = "9", aspectRatioWidth = "16", width = "100", height = "100", } = {}) => {
|
|
13927
|
+
await this.openImageLibrary();
|
|
13928
|
+
const switchImageTab = this.neetoPlaywrightUtilities.interceptMultipleResponses({
|
|
13929
|
+
responseUrl: NEETO_ROUTES.imageUploader,
|
|
13930
|
+
});
|
|
13931
|
+
await this.page
|
|
13932
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.unsplashTab)
|
|
13933
|
+
.click();
|
|
13934
|
+
await switchImageTab;
|
|
13935
|
+
if (isNotEmpty(searchTerm)) {
|
|
13936
|
+
await this.page
|
|
13937
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.unsplashSearchInput)
|
|
13938
|
+
.fill(searchTerm);
|
|
13939
|
+
await expect(this.page.getByTestId(COMMON_SELECTORS.spinner)).toBeHidden({
|
|
13940
|
+
timeout: 10000,
|
|
13941
|
+
});
|
|
13942
|
+
}
|
|
13943
|
+
await this.page
|
|
13944
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.nthUnsplashImage(nthImage))
|
|
13945
|
+
.click();
|
|
13946
|
+
await expect(this.page.getByTestId(COMMON_SELECTORS.spinner)).toBeHidden({
|
|
13947
|
+
timeout: 10000,
|
|
13948
|
+
});
|
|
13949
|
+
toggleOrginalImage
|
|
13950
|
+
? await this.page
|
|
13951
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.selectOriginalImageSwitch)
|
|
13952
|
+
.click()
|
|
13953
|
+
: await this.cropImage({
|
|
13954
|
+
toggleAspectRatioLock,
|
|
13955
|
+
aspectRatioHeight,
|
|
13956
|
+
aspectRatioWidth,
|
|
13957
|
+
width,
|
|
13958
|
+
height,
|
|
13959
|
+
});
|
|
13960
|
+
await this.submitCroppedImage();
|
|
13961
|
+
};
|
|
13962
|
+
this.selectImageFromLibrary = async ({ nthImage = 0, searchTerm = "", toggleOrginalImage = false, toggleAspectRatioLock = false, aspectRatioHeight = "9", aspectRatioWidth = "16", width = "100", height = "100", } = {}) => {
|
|
13963
|
+
await this.openImageLibrary();
|
|
13964
|
+
await expect(this.page.getByTestId(COMMON_SELECTORS.spinner)).toBeHidden({
|
|
13965
|
+
timeout: 10000,
|
|
13966
|
+
});
|
|
13967
|
+
if (isNotEmpty(searchTerm)) {
|
|
13968
|
+
await this.page
|
|
13969
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.unsplashSearchInput)
|
|
13970
|
+
.fill(searchTerm);
|
|
13971
|
+
await expect(this.page.getByTestId(COMMON_SELECTORS.spinner)).toBeHidden({
|
|
13972
|
+
timeout: 10000,
|
|
13973
|
+
});
|
|
13974
|
+
}
|
|
13975
|
+
await this.page
|
|
13976
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.nthLibraryImage(nthImage))
|
|
13977
|
+
.click();
|
|
13978
|
+
toggleOrginalImage
|
|
13979
|
+
? await this.page
|
|
13980
|
+
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.selectOriginalImageSwitch)
|
|
13981
|
+
.click()
|
|
13982
|
+
: await this.cropImage({
|
|
13983
|
+
toggleAspectRatioLock,
|
|
13984
|
+
aspectRatioHeight,
|
|
13985
|
+
aspectRatioWidth,
|
|
13986
|
+
width,
|
|
13987
|
+
height,
|
|
13988
|
+
});
|
|
13989
|
+
await this.submitCroppedImage();
|
|
13990
|
+
};
|
|
13991
|
+
this.page = page;
|
|
13992
|
+
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
13993
|
+
}
|
|
13994
|
+
}
|
|
13995
|
+
|
|
13483
13996
|
const LOGIN_SELECTORS = {
|
|
13484
13997
|
appleAuthenticationButton: "apple-authentication-button",
|
|
13485
13998
|
emailTextField: "login-email-text-field",
|
|
@@ -13784,30 +14297,6 @@ const networkConditions = {
|
|
|
13784
14297
|
},
|
|
13785
14298
|
};
|
|
13786
14299
|
|
|
13787
|
-
const NEETO_EDITOR_SELECTORS = {
|
|
13788
|
-
boldOption: "neeto-editor-fixed-menu-bold-option",
|
|
13789
|
-
italicOption: "neeto-editor-fixed-menu-italic-option",
|
|
13790
|
-
underlineOption: "neeto-editor-fixed-menu-underline-option",
|
|
13791
|
-
strikeOption: "neeto-editor-fixed-menu-strike-option",
|
|
13792
|
-
codeBlockOption: "neeto-editor-fixed-menu-code-option",
|
|
13793
|
-
highlightOption: "neeto-editor-fixed-menu-highlight-option",
|
|
13794
|
-
linkInput: "neeto-editor-fixed-menu-link-option-input",
|
|
13795
|
-
linkSubmitButton: "neeto-editor-fixed-menu-link-option-link-button",
|
|
13796
|
-
commandList: (index) => `neeto-editor-command-list-item-${index}`,
|
|
13797
|
-
imageUploadUrlSubmitButton: "neeto-editor-media-upload-url-submit",
|
|
13798
|
-
imageUploadUrlInputTextField: "neeto-editor-media-upload-url-input",
|
|
13799
|
-
uploadInput: "neeto-editor-media-uploader-input",
|
|
13800
|
-
editorMenuBarWrapper: "neeto-editor-fixed-menu-wrapper",
|
|
13801
|
-
undoOption: "neeto-editor-fixed-menu-undo-option",
|
|
13802
|
-
redoOption: "neeto-editor-fixed-menu-redo-option",
|
|
13803
|
-
imageWrapper: "neeto-editor-image-wrapper",
|
|
13804
|
-
contentField: "neeto-editor-content",
|
|
13805
|
-
addLinkButton: "neeto-editor-fixed-menu-link-option",
|
|
13806
|
-
addLinkTextField: "neeto-editor-add-link-text-input",
|
|
13807
|
-
addURLTextField: "neeto-editor-add-link-url-input",
|
|
13808
|
-
submitLinkButton: "neeto-editor-add-link",
|
|
13809
|
-
};
|
|
13810
|
-
|
|
13811
14300
|
const MEMBER_SELECTORS = {
|
|
13812
14301
|
membersTab: "members-nav-tab",
|
|
13813
14302
|
newButton: "ntm-add-member-button",
|
|
@@ -102591,7 +103080,7 @@ class Jimp$1 extends require$$0$4 {
|
|
|
102591
103080
|
return throwError.call(this, "cb must be a function", cb);
|
|
102592
103081
|
}
|
|
102593
103082
|
const mime = getType(path) || this.getMIME();
|
|
102594
|
-
const pathObj =
|
|
103083
|
+
const pathObj = Path__default.parse(path);
|
|
102595
103084
|
if (pathObj.dir) {
|
|
102596
103085
|
fs__default.mkdirSync(pathObj.dir, {
|
|
102597
103086
|
recursive: true
|
|
@@ -134081,19 +134570,19 @@ var print = (() => ({
|
|
|
134081
134570
|
constants: {
|
|
134082
134571
|
measureText,
|
|
134083
134572
|
measureTextHeight,
|
|
134084
|
-
FONT_SANS_8_BLACK:
|
|
134085
|
-
FONT_SANS_10_BLACK:
|
|
134086
|
-
FONT_SANS_12_BLACK:
|
|
134087
|
-
FONT_SANS_14_BLACK:
|
|
134088
|
-
FONT_SANS_16_BLACK:
|
|
134089
|
-
FONT_SANS_32_BLACK:
|
|
134090
|
-
FONT_SANS_64_BLACK:
|
|
134091
|
-
FONT_SANS_128_BLACK:
|
|
134092
|
-
FONT_SANS_8_WHITE:
|
|
134093
|
-
FONT_SANS_16_WHITE:
|
|
134094
|
-
FONT_SANS_32_WHITE:
|
|
134095
|
-
FONT_SANS_64_WHITE:
|
|
134096
|
-
FONT_SANS_128_WHITE:
|
|
134573
|
+
FONT_SANS_8_BLACK: Path__default.join(dir, "fonts/open-sans/open-sans-8-black/open-sans-8-black.fnt"),
|
|
134574
|
+
FONT_SANS_10_BLACK: Path__default.join(dir, "fonts/open-sans/open-sans-10-black/open-sans-10-black.fnt"),
|
|
134575
|
+
FONT_SANS_12_BLACK: Path__default.join(dir, "fonts/open-sans/open-sans-12-black/open-sans-12-black.fnt"),
|
|
134576
|
+
FONT_SANS_14_BLACK: Path__default.join(dir, "fonts/open-sans/open-sans-14-black/open-sans-14-black.fnt"),
|
|
134577
|
+
FONT_SANS_16_BLACK: Path__default.join(dir, "fonts/open-sans/open-sans-16-black/open-sans-16-black.fnt"),
|
|
134578
|
+
FONT_SANS_32_BLACK: Path__default.join(dir, "fonts/open-sans/open-sans-32-black/open-sans-32-black.fnt"),
|
|
134579
|
+
FONT_SANS_64_BLACK: Path__default.join(dir, "fonts/open-sans/open-sans-64-black/open-sans-64-black.fnt"),
|
|
134580
|
+
FONT_SANS_128_BLACK: Path__default.join(dir, "fonts/open-sans/open-sans-128-black/open-sans-128-black.fnt"),
|
|
134581
|
+
FONT_SANS_8_WHITE: Path__default.join(dir, "fonts/open-sans/open-sans-8-white/open-sans-8-white.fnt"),
|
|
134582
|
+
FONT_SANS_16_WHITE: Path__default.join(dir, "fonts/open-sans/open-sans-16-white/open-sans-16-white.fnt"),
|
|
134583
|
+
FONT_SANS_32_WHITE: Path__default.join(dir, "fonts/open-sans/open-sans-32-white/open-sans-32-white.fnt"),
|
|
134584
|
+
FONT_SANS_64_WHITE: Path__default.join(dir, "fonts/open-sans/open-sans-64-white/open-sans-64-white.fnt"),
|
|
134585
|
+
FONT_SANS_128_WHITE: Path__default.join(dir, "fonts/open-sans/open-sans-128-white/open-sans-128-white.fnt"),
|
|
134097
134586
|
/**
|
|
134098
134587
|
* Loads a bitmap font from a file
|
|
134099
134588
|
* @param {string} file the file path of a .fnt file
|
|
@@ -134120,7 +134609,7 @@ var print = (() => ({
|
|
|
134120
134609
|
kernings[firstString] = kernings[firstString] || {};
|
|
134121
134610
|
kernings[firstString][String.fromCharCode(font.kernings[i].second)] = font.kernings[i].amount;
|
|
134122
134611
|
}
|
|
134123
|
-
loadPages(this,
|
|
134612
|
+
loadPages(this, Path__default.dirname(file), font.pages).then(pages => {
|
|
134124
134613
|
cb(null, {
|
|
134125
134614
|
chars,
|
|
134126
134615
|
kernings,
|
|
@@ -146970,7 +147459,7 @@ var require$$4 = {
|
|
|
146970
147459
|
};
|
|
146971
147460
|
|
|
146972
147461
|
const fs = fs__default;
|
|
146973
|
-
const path =
|
|
147462
|
+
const path = Path__default;
|
|
146974
147463
|
const os = require$$0$3;
|
|
146975
147464
|
const crypto = require$$3$2;
|
|
146976
147465
|
const packageJson = require$$4;
|
|
@@ -147485,5 +147974,5 @@ const definePlaywrightConfig = (overrides) => {
|
|
|
147485
147974
|
});
|
|
147486
147975
|
};
|
|
147487
147976
|
|
|
147488
|
-
export { API_ROUTES, BASE_URL, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COMMON_SELECTORS, CREDENTIALS, CustomCommands, EMBED_SELECTORS, ENVIRONMENT, EmbedBase, GLOBAL_TRANSLATIONS_PATTERN, HELP_CENTER_SELECTORS, HelpAndProfilePage, INTEGRATIONS_TEXTS, INTEGRATION_SELECTORS, IS_STAGING_ENV, IntegrationBase, KEYBOARD_SHORTCUTS_SELECTORS, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MEMBER_TEXTS, MERGE_TAGS_SELECTORS, MailosaurUtils, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, OTP_EMAIL_PATTERN, OrganizationPage, PROFILE_SECTION_SELECTORS, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, SIGNUP_SELECTORS, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STORAGE_STATE, SidebarSection, SlackPage, TAGS_SELECTORS, THIRD_PARTY_ROUTES, TOASTR_MESSAGES, USER_AGENTS, WebhooksPage, ZAPIER_LIMIT_EXHAUSTED_MESSAGE, ZAPIER_SELECTORS, ZAPIER_TEST_EMAIL, ZAPIER_WEB_TEXTS, ZapierPage, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, filterUtils, generateRandomBypassEmail, generateStagingData, getByDataQA, getGlobalUserState, headerUtils, hexToRGB, hyphenize, i18nFixture, initializeCredentials, initializeTotp, joinHyphenCase, joinString, login, loginWithoutSSO, memberUtils, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, shouldSkipSetupAndTeardown, skipTest, squish, stealth as stealthTest, tableUtils, toCamelCase, updateCredentials, writeDataToFile };
|
|
147977
|
+
export { API_ROUTES, ATTACHMENT_DELETION_TOASTR_MESSAGE, BASE_URL, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COMMON_SELECTORS, CREDENTIALS, CustomCommands, DESCRIPTION_EDITOR_TEXTS, EMBED_SELECTORS, EMOJI_PICKER_LABEL, ENVIRONMENT, EXPANDED_FONT_SIZE, EditorPage, EmbedBase, FONT_SIZE_SELECTORS, GLOBAL_TRANSLATIONS_PATTERN, HELP_CENTER_SELECTORS, HelpAndProfilePage, INTEGRATIONS_TEXTS, INTEGRATION_SELECTORS, IS_STAGING_ENV, ImageUploader, IntegrationBase, KEYBOARD_SHORTCUTS_SELECTORS, LIST_MODIFIER_SELECTORS, LIST_MODIFIER_TAGS, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MEMBER_TEXTS, MERGE_TAGS_SELECTORS, MailosaurUtils, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, NEETO_IMAGE_UPLOADER_SELECTORS, NEETO_ROUTES, NEETO_TEXT_MODIFIER_SELECTORS, OTP_EMAIL_PATTERN, OrganizationPage, PROFILE_SECTION_SELECTORS, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, SIGNUP_SELECTORS, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STORAGE_STATE, SidebarSection, SlackPage, TAGS_SELECTORS, TEXT_MODIFIER_ROLES, TEXT_MODIFIER_SELECTORS, TEXT_MODIFIER_TAGS, THIRD_PARTY_ROUTES, TOASTR_MESSAGES, USER_AGENTS, WebhooksPage, ZAPIER_LIMIT_EXHAUSTED_MESSAGE, ZAPIER_SELECTORS, ZAPIER_TEST_EMAIL, ZAPIER_WEB_TEXTS, ZapierPage, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, filterUtils, generateRandomBypassEmail, generateStagingData, getByDataQA, getGlobalUserState, getImagePathAndName, headerUtils, hexToRGB, hyphenize, i18nFixture, initializeCredentials, initializeTotp, joinHyphenCase, joinString, login, loginWithoutSSO, memberUtils, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, shouldSkipSetupAndTeardown, skipTest, squish, stealth as stealthTest, tableUtils, toCamelCase, updateCredentials, writeDataToFile };
|
|
147489
147978
|
//# sourceMappingURL=index.js.map
|