@bigbinary/neeto-playwright-commons 1.9.20 → 1.9.22
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 +27 -12
- package/index.cjs.js.map +1 -1
- package/index.d.ts +61 -3
- package/index.js +27 -12
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -359,6 +359,7 @@ const COMMON_SELECTORS = {
|
|
|
359
359
|
actionSelectIndicator: "action-select-indicator",
|
|
360
360
|
takeActionDropdown: "take-action-dropdown-icon",
|
|
361
361
|
columnsSearchInput: "neeto-ui-columns-search",
|
|
362
|
+
errorToastIcon: "error-toast-icon",
|
|
362
363
|
};
|
|
363
364
|
|
|
364
365
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -3473,6 +3474,9 @@ class CustomCommands {
|
|
|
3473
3474
|
const startTime = Date.now();
|
|
3474
3475
|
await this.recursiveMethod(callback, condition, timeout, startTime);
|
|
3475
3476
|
};
|
|
3477
|
+
/**
|
|
3478
|
+
* @deprecated Use verifyToast instead.
|
|
3479
|
+
*/
|
|
3476
3480
|
this.verifySuccessToast = async ({ message = "", closeAfterVerification = true, } = {}) => {
|
|
3477
3481
|
if (!ramda.isEmpty(message)) {
|
|
3478
3482
|
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.toastMessage)).toContainText(message);
|
|
@@ -3484,6 +3488,22 @@ class CustomCommands {
|
|
|
3484
3488
|
(await this.page.getByTestId(COMMON_SELECTORS.toastCloseButton).click());
|
|
3485
3489
|
await test$1.expect(this.page.locator(COMMON_SELECTORS.toastIcon)).toBeHidden();
|
|
3486
3490
|
};
|
|
3491
|
+
this.verifyToast = async ({ message = "", toastType = "success", closeAfterVerification = true, } = {}) => {
|
|
3492
|
+
if (toastType === "error") {
|
|
3493
|
+
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.errorToastIcon)).toBeVisible({ timeout: 10000 });
|
|
3494
|
+
}
|
|
3495
|
+
const toastrCloseButton = this.page.getByTestId(COMMON_SELECTORS.toastCloseButton);
|
|
3496
|
+
if (!ramda.isEmpty(message)) {
|
|
3497
|
+
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.toastMessage)).toContainText(message, { timeout: 10000 });
|
|
3498
|
+
}
|
|
3499
|
+
else {
|
|
3500
|
+
await test$1.expect(this.page.locator(COMMON_SELECTORS.toastIcon)).toContainText("👍");
|
|
3501
|
+
}
|
|
3502
|
+
if (closeAfterVerification && (await toastrCloseButton.isVisible())) {
|
|
3503
|
+
await toastrCloseButton.click();
|
|
3504
|
+
await test$1.expect(toastrCloseButton).toBeHidden();
|
|
3505
|
+
}
|
|
3506
|
+
};
|
|
3487
3507
|
this.reloadAndWait = async (requestCount, customPageContext, interceptMultipleResponsesProps = {}) => {
|
|
3488
3508
|
const pageContext = customPageContext !== null && customPageContext !== void 0 ? customPageContext : this.page;
|
|
3489
3509
|
const reloadRequests = this.interceptMultipleResponses({
|
|
@@ -14470,13 +14490,13 @@ const NEETO_EDITOR_SELECTORS = {
|
|
|
14470
14490
|
videoEmbedOption: "neeto-editor-fixed-menu-video-embed-option",
|
|
14471
14491
|
videoEmbedInput: "neeto-editor-embed-input",
|
|
14472
14492
|
videoEmbedSubmit: "neeto-editor-embed-cancel",
|
|
14473
|
-
|
|
14474
|
-
videoWrapper: ".neeto-editor__video-wrapper",
|
|
14493
|
+
videoWrapper: "neeto-editor-video-wrapper",
|
|
14475
14494
|
paragraphOption: "neeto-editor-fixed-menu-font-size-option-body2",
|
|
14476
14495
|
attachmentPreview: "ne-attachments-wrapper",
|
|
14477
14496
|
imageUploadLinkButton: "neeto-editor-media-uploader-link-tab",
|
|
14478
14497
|
errorText: "neeto-editor-error-text",
|
|
14479
14498
|
content: "editor-content",
|
|
14499
|
+
imageUploadDeleteButton: "neeto-editor-image-menu-Delete",
|
|
14480
14500
|
};
|
|
14481
14501
|
const NEETO_TEXT_MODIFIER_SELECTORS = {
|
|
14482
14502
|
strikeOption: "neeto-editor-fixed-menu-strike-option",
|
|
@@ -14505,7 +14525,7 @@ const FONT_SIZE_SELECTORS = {
|
|
|
14505
14525
|
/* eslint-disable playwright/no-nth-methods */
|
|
14506
14526
|
class EditorPage {
|
|
14507
14527
|
constructor(page, neetoPlaywrightUtilities) {
|
|
14508
|
-
this.verifyDescriptionEditor = async ({ text, linkUrl = faker.faker.internet.url(),
|
|
14528
|
+
this.verifyDescriptionEditor = async ({ text, linkUrl = faker.faker.internet.url(), filePath = "../../../e2e/assets/images/BigBinary.png", imageUrl = "https://picsum.photos/200/300", videoUrl = "https://youtu.be/jNQXAC9IVRw", cannedResponseSuccessMessage, }) => {
|
|
14509
14529
|
await this.page.getByTestId(NEETO_EDITOR_SELECTORS.contentField).fill(text);
|
|
14510
14530
|
await this.page
|
|
14511
14531
|
.getByTestId(NEETO_EDITOR_SELECTORS.fontSizeDropdown())
|
|
@@ -14586,7 +14606,7 @@ class EditorPage {
|
|
|
14586
14606
|
const fileUploaderPromise = this.page.waitForEvent("filechooser");
|
|
14587
14607
|
await this.editorAttachmentsButton.click();
|
|
14588
14608
|
const fileUploader = await fileUploaderPromise;
|
|
14589
|
-
const imagePath = Path__namespace.join(__dirname,
|
|
14609
|
+
const imagePath = Path__namespace.join(__dirname, filePath);
|
|
14590
14610
|
await fileUploader.setFiles(imagePath);
|
|
14591
14611
|
await this.neetoPlaywrightUtilities.interceptMultipleResponses({
|
|
14592
14612
|
responseUrl: ROUTES.attachment,
|
|
@@ -14613,7 +14633,7 @@ class EditorPage {
|
|
|
14613
14633
|
.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadButton)
|
|
14614
14634
|
.click();
|
|
14615
14635
|
const fileUploader = await fileUploaderPromise;
|
|
14616
|
-
const imagePath = Path__namespace.join(__dirname,
|
|
14636
|
+
const imagePath = Path__namespace.join(__dirname, filePath);
|
|
14617
14637
|
await fileUploader.setFiles(imagePath);
|
|
14618
14638
|
await test$1.expect(this.imageWrapper).toBeVisible({ timeout: 15000 });
|
|
14619
14639
|
await this.neetoPlaywrightUtilities.verifySuccessToast();
|
|
@@ -14694,16 +14714,11 @@ class EditorPage {
|
|
|
14694
14714
|
this.attachmentPreview = this.page.getByTestId(NEETO_EDITOR_SELECTORS.attachmentPreview);
|
|
14695
14715
|
this.editorAttachmentsButton = this.page.getByTestId(NEETO_EDITOR_SELECTORS.editorAttachmentsButton);
|
|
14696
14716
|
this.imageWrapper = this.page.getByTestId(NEETO_EDITOR_SELECTORS.imageWrapper);
|
|
14697
|
-
|
|
14698
|
-
this.imageUploadDeleteButton = this.page
|
|
14699
|
-
.getByTestId(COMMON_SELECTORS.dropdownContainer)
|
|
14700
|
-
.getByRole("button")
|
|
14701
|
-
.nth(3);
|
|
14717
|
+
this.imageUploadDeleteButton = this.page.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadDeleteButton);
|
|
14702
14718
|
this.imageUploadOption = this.page.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadOption);
|
|
14703
14719
|
this.cannedResponseOption = this.page.getByTestId(NEETO_EDITOR_SELECTORS.cannedResponseOption);
|
|
14704
14720
|
this.videoEmbedOption = this.page.getByTestId(NEETO_EDITOR_SELECTORS.videoEmbedOption);
|
|
14705
|
-
|
|
14706
|
-
this.videoWrapperSelector = this.page.locator(NEETO_EDITOR_SELECTORS.videoWrapper);
|
|
14721
|
+
this.videoWrapperSelector = this.page.getByTestId(NEETO_EDITOR_SELECTORS.videoWrapper);
|
|
14707
14722
|
this.emojiDropdownIcon = this.page
|
|
14708
14723
|
.getByTestId(NEETO_EDITOR_SELECTORS.fixedMenuWrapper)
|
|
14709
14724
|
.getByTestId(COMMON_SELECTORS.dropdownIcon);
|