@bigbinary/neeto-playwright-commons 1.10.2 → 1.10.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 +243 -225
- package/index.cjs.js.map +1 -1
- package/index.d.ts +23 -10
- package/index.js +243 -225
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -13740,49 +13740,54 @@ const LIST_MODIFIER_TAGS = {
|
|
|
13740
13740
|
orderedListOption: "ol",
|
|
13741
13741
|
};
|
|
13742
13742
|
|
|
13743
|
+
const optionSelector = (option) => `neeto-editor-fixed-menu-${option}-option`;
|
|
13744
|
+
const fixedMenuSelector = (selector) => `neeto-editor-fixed-menu-${selector}`;
|
|
13745
|
+
|
|
13743
13746
|
const NEETO_EDITOR_SELECTORS = {
|
|
13744
|
-
boldOption: "
|
|
13745
|
-
italicOption: "
|
|
13746
|
-
underlineOption: "
|
|
13747
|
-
strikeOption: "
|
|
13748
|
-
codeBlockOption: "
|
|
13749
|
-
highlightOption: "
|
|
13750
|
-
|
|
13751
|
-
|
|
13747
|
+
boldOption: optionSelector("bold"),
|
|
13748
|
+
italicOption: optionSelector("italic"),
|
|
13749
|
+
underlineOption: optionSelector("underline"),
|
|
13750
|
+
strikeOption: optionSelector("strike"),
|
|
13751
|
+
codeBlockOption: optionSelector("code"),
|
|
13752
|
+
highlightOption: optionSelector("highlight"),
|
|
13753
|
+
emojiOption: optionSelector("emoji"),
|
|
13754
|
+
emojiDropdownIcon: "emoji-dropdown-icon",
|
|
13755
|
+
linkInput: fixedMenuSelector("link-option-input"),
|
|
13756
|
+
linkSubmitButton: fixedMenuSelector("link-option-link-button"),
|
|
13752
13757
|
commandList: (index) => `neeto-editor-command-list-item-${index}`,
|
|
13753
13758
|
imageUploadUrlSubmitButton: "neeto-editor-media-upload-url-submit",
|
|
13754
13759
|
imageUploadUrlInputTextField: "neeto-editor-media-upload-url-input",
|
|
13755
13760
|
uploadInput: "neeto-editor-media-uploader-input",
|
|
13756
|
-
editorMenuBarWrapper: "
|
|
13757
|
-
undoOption: "
|
|
13758
|
-
redoOption: "
|
|
13761
|
+
editorMenuBarWrapper: fixedMenuSelector("wrapper"),
|
|
13762
|
+
undoOption: optionSelector("undo"),
|
|
13763
|
+
redoOption: optionSelector("redo"),
|
|
13759
13764
|
imageWrapper: "neeto-editor-image-wrapper",
|
|
13760
13765
|
contentField: "neeto-editor-content",
|
|
13761
|
-
addLinkButton: "
|
|
13766
|
+
addLinkButton: optionSelector("link"),
|
|
13762
13767
|
addLinkTextField: "neeto-editor-add-link-text-input",
|
|
13763
13768
|
addURLTextField: "neeto-editor-add-link-url-input",
|
|
13764
13769
|
submitLinkButton: "neeto-editor-add-link",
|
|
13765
13770
|
fontSizeDropdown: (currentOption) => `${joinHyphenCase(currentOption)}-dropdown-icon`,
|
|
13766
|
-
fixedMenuArrow: "
|
|
13767
|
-
cannedResponseOption: "
|
|
13771
|
+
fixedMenuArrow: fixedMenuSelector("arrow"),
|
|
13772
|
+
cannedResponseOption: optionSelector("canned-responses"),
|
|
13768
13773
|
cannedResponseSelectContainer: "select-a-canned-response-select-container",
|
|
13769
|
-
fixedMenuWrapper: "
|
|
13770
|
-
linkOption: "
|
|
13774
|
+
fixedMenuWrapper: optionSelector("wrapper"),
|
|
13775
|
+
linkOption: optionSelector("link"),
|
|
13771
13776
|
addLinkUrlInput: "neeto-editor-add-link-url-input",
|
|
13772
13777
|
addLinkDoneButton: "neeto-editor-add-link",
|
|
13773
13778
|
unlinkButton: "neeto-editor-link-popover-unlink",
|
|
13774
|
-
editorAttachmentsButton: "
|
|
13779
|
+
editorAttachmentsButton: optionSelector("attachments"),
|
|
13775
13780
|
attachmentPreviewDeleteButton: "neeto-editor-preview-delete-button",
|
|
13776
|
-
imageUploadOption: "
|
|
13781
|
+
imageUploadOption: optionSelector("image-upload"),
|
|
13777
13782
|
imageUploadLinkInput: "neeto-editor-media-upload-url-input",
|
|
13778
13783
|
imageUploadButton: "neeto-editor-media-uploader-dnd",
|
|
13779
13784
|
imageUploadLinkSubmitButton: "neeto-editor-media-upload-url-submit",
|
|
13780
13785
|
applyButton: "apply-button",
|
|
13781
|
-
videoEmbedOption: "
|
|
13786
|
+
videoEmbedOption: optionSelector("video-embed"),
|
|
13782
13787
|
videoEmbedInput: "neeto-editor-embed-input",
|
|
13783
13788
|
videoEmbedSubmit: "neeto-editor-embed-cancel",
|
|
13784
13789
|
videoWrapper: "neeto-editor-video-wrapper",
|
|
13785
|
-
paragraphOption: "
|
|
13790
|
+
paragraphOption: fixedMenuSelector("font-size-option-body2"),
|
|
13786
13791
|
attachmentPreview: "ne-attachments-wrapper",
|
|
13787
13792
|
imageUploadLinkButton: "neeto-editor-media-uploader-link-tab",
|
|
13788
13793
|
errorText: "neeto-editor-error-text",
|
|
@@ -13793,256 +13798,266 @@ const NEETO_EDITOR_SELECTORS = {
|
|
|
13793
13798
|
dynamicVariableSelector: (variable) => `dynamic-variables-list-item-${hyphenate(variable)}`,
|
|
13794
13799
|
};
|
|
13795
13800
|
const NEETO_TEXT_MODIFIER_SELECTORS = {
|
|
13796
|
-
strikeOption: "
|
|
13797
|
-
underlineOption: "
|
|
13798
|
-
highlightOption: "
|
|
13801
|
+
strikeOption: optionSelector("strike"),
|
|
13802
|
+
underlineOption: optionSelector("underline"),
|
|
13803
|
+
highlightOption: optionSelector("highlight"),
|
|
13799
13804
|
};
|
|
13800
13805
|
const TEXT_MODIFIER_SELECTORS = {
|
|
13801
|
-
boldOption: "
|
|
13802
|
-
italicsOption: "
|
|
13803
|
-
codeOption: "
|
|
13804
|
-
blockquoteOption: "
|
|
13805
|
-
codeblockOption: "
|
|
13806
|
+
boldOption: optionSelector("bold"),
|
|
13807
|
+
italicsOption: optionSelector("italic"),
|
|
13808
|
+
codeOption: optionSelector("code"),
|
|
13809
|
+
blockquoteOption: optionSelector("blockquote"),
|
|
13810
|
+
codeblockOption: optionSelector("codeBlock"),
|
|
13806
13811
|
};
|
|
13807
13812
|
const LIST_MODIFIER_SELECTORS = {
|
|
13808
|
-
bulletListOption: "
|
|
13809
|
-
orderedListOption: "
|
|
13813
|
+
bulletListOption: optionSelector("bulletList"),
|
|
13814
|
+
orderedListOption: optionSelector("orderedList"),
|
|
13810
13815
|
};
|
|
13811
13816
|
const FONT_SIZE_SELECTORS = {
|
|
13812
|
-
h1: "
|
|
13813
|
-
h2: "
|
|
13814
|
-
h3: "
|
|
13815
|
-
h4: "
|
|
13816
|
-
h5: "
|
|
13817
|
+
h1: fixedMenuSelector("font-size-option-h1"),
|
|
13818
|
+
h2: fixedMenuSelector("font-size-option-h2"),
|
|
13819
|
+
h3: fixedMenuSelector("font-size-option-h3"),
|
|
13820
|
+
h4: fixedMenuSelector("font-size-option-h4"),
|
|
13821
|
+
h5: fixedMenuSelector("font-size-option-h5"),
|
|
13817
13822
|
};
|
|
13818
13823
|
|
|
13819
|
-
/* eslint-disable playwright/no-nth-methods */
|
|
13820
13824
|
class EditorPage {
|
|
13821
|
-
constructor(page, neetoPlaywrightUtilities) {
|
|
13822
|
-
this.
|
|
13823
|
-
if (
|
|
13824
|
-
|
|
13825
|
-
await
|
|
13826
|
-
.
|
|
13827
|
-
|
|
13828
|
-
|
|
13825
|
+
constructor(page, neetoPlaywrightUtilities, editorWrapper) {
|
|
13826
|
+
this.assertOptionVisibility = async (optionLocator) => {
|
|
13827
|
+
if (await optionLocator.isVisible())
|
|
13828
|
+
return true;
|
|
13829
|
+
(await this.moreMenuSelector.isVisible()) &&
|
|
13830
|
+
(await this.moreMenuSelector.click());
|
|
13831
|
+
return optionLocator.isVisible();
|
|
13832
|
+
};
|
|
13833
|
+
this.verifyFontSize = async (defaultFontSizeOption) => {
|
|
13834
|
+
await this.editorWrapper
|
|
13829
13835
|
.getByTestId(NEETO_EDITOR_SELECTORS.fontSizeDropdown(defaultFontSizeOption))
|
|
13830
13836
|
.click();
|
|
13831
13837
|
const fontSize = Object.keys(FONT_SIZE_SELECTORS);
|
|
13832
13838
|
for (const font of fontSize) {
|
|
13833
13839
|
const fontKey = font;
|
|
13834
|
-
await editorWrapper
|
|
13835
|
-
|
|
13836
|
-
.
|
|
13837
|
-
|
|
13838
|
-
await editorWrapper
|
|
13840
|
+
await this.editorWrapper
|
|
13841
|
+
.getByTestId(FONT_SIZE_SELECTORS[fontKey])
|
|
13842
|
+
.click();
|
|
13843
|
+
await expect(this.contentField.getByRole("heading", { level: Number(font.slice(1)) })).toBeVisible();
|
|
13844
|
+
await this.editorWrapper
|
|
13839
13845
|
.getByTestId(NEETO_EDITOR_SELECTORS.fontSizeDropdown(EXPANDED_FONT_SIZE[fontKey]))
|
|
13840
13846
|
.click();
|
|
13841
13847
|
}
|
|
13842
|
-
|
|
13843
|
-
|
|
13844
|
-
const paragraphRole = DESCRIPTION_EDITOR_TEXTS.paragraphOption;
|
|
13845
|
-
await expect(editorWrapper
|
|
13846
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
13847
|
-
.getByRole(paragraphRole)).toBeVisible();
|
|
13848
|
-
}
|
|
13849
|
-
(await this.fixedMenuArrowSelector.isVisible()) &&
|
|
13850
|
-
(await this.fixedMenuArrowSelector.click());
|
|
13851
|
-
await editorWrapper.getByText(text).click({ clickCount: 3 });
|
|
13848
|
+
};
|
|
13849
|
+
this.verifyTextModifiers = async () => {
|
|
13852
13850
|
const textModifier = Object.keys(TEXT_MODIFIER_SELECTORS);
|
|
13853
13851
|
for (const modifier of textModifier) {
|
|
13854
13852
|
const modifierKey = modifier;
|
|
13855
13853
|
const textModifierRole = TEXT_MODIFIER_ROLES[modifierKey];
|
|
13856
|
-
const textModifierSelector = editorWrapper.getByTestId(TEXT_MODIFIER_SELECTORS[modifierKey]);
|
|
13857
|
-
if (await
|
|
13854
|
+
const textModifierSelector = this.editorWrapper.getByTestId(TEXT_MODIFIER_SELECTORS[modifierKey]);
|
|
13855
|
+
if (await this.assertOptionVisibility(textModifierSelector)) {
|
|
13858
13856
|
await textModifierSelector.click();
|
|
13859
|
-
await expect(
|
|
13860
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
13861
|
-
.getByRole(textModifierRole)).toBeVisible();
|
|
13857
|
+
await expect(this.contentField.getByRole(textModifierRole)).toBeVisible();
|
|
13862
13858
|
await textModifierSelector.click();
|
|
13863
13859
|
}
|
|
13864
13860
|
}
|
|
13861
|
+
};
|
|
13862
|
+
this.verifyTextDeskModifier = async () => {
|
|
13865
13863
|
const textDeskModifier = Object.keys(NEETO_TEXT_MODIFIER_SELECTORS);
|
|
13866
13864
|
for (const modifier of textDeskModifier) {
|
|
13867
13865
|
const modifierKey = modifier;
|
|
13868
|
-
const textModifierSelector = editorWrapper.getByTestId(NEETO_TEXT_MODIFIER_SELECTORS[modifierKey]);
|
|
13869
|
-
if (await
|
|
13866
|
+
const textModifierSelector = this.editorWrapper.getByTestId(NEETO_TEXT_MODIFIER_SELECTORS[modifierKey]);
|
|
13867
|
+
if (await this.assertOptionVisibility(textModifierSelector)) {
|
|
13870
13868
|
await textModifierSelector.click();
|
|
13871
|
-
await expect(
|
|
13872
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
13873
|
-
.locator(TEXT_MODIFIER_TAGS[modifierKey])).toBeVisible();
|
|
13869
|
+
await expect(this.contentField.locator(TEXT_MODIFIER_TAGS[modifierKey])).toBeVisible();
|
|
13874
13870
|
await textModifierSelector.click();
|
|
13875
13871
|
}
|
|
13876
13872
|
}
|
|
13873
|
+
};
|
|
13874
|
+
this.verifyListModifiers = async () => {
|
|
13877
13875
|
const listModifier = Object.keys(LIST_MODIFIER_SELECTORS);
|
|
13878
13876
|
for (const modifier of listModifier) {
|
|
13879
13877
|
const modifierKey = modifier;
|
|
13880
|
-
const listModifierSelector = editorWrapper.getByTestId(LIST_MODIFIER_SELECTORS[modifierKey]);
|
|
13881
|
-
if (await
|
|
13878
|
+
const listModifierSelector = this.editorWrapper.getByTestId(LIST_MODIFIER_SELECTORS[modifierKey]);
|
|
13879
|
+
if (await this.assertOptionVisibility(listModifierSelector)) {
|
|
13882
13880
|
await listModifierSelector.click();
|
|
13883
|
-
await expect(
|
|
13884
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
13885
|
-
.locator(LIST_MODIFIER_TAGS[modifierKey])).toBeVisible();
|
|
13881
|
+
await expect(this.contentField.locator(LIST_MODIFIER_TAGS[modifierKey])).toBeVisible();
|
|
13886
13882
|
await listModifierSelector.click();
|
|
13887
13883
|
}
|
|
13888
13884
|
}
|
|
13889
|
-
|
|
13890
|
-
|
|
13891
|
-
|
|
13892
|
-
|
|
13893
|
-
|
|
13894
|
-
|
|
13895
|
-
|
|
13896
|
-
|
|
13897
|
-
|
|
13898
|
-
|
|
13899
|
-
|
|
13900
|
-
|
|
13901
|
-
|
|
13902
|
-
|
|
13903
|
-
|
|
13904
|
-
|
|
13905
|
-
|
|
13906
|
-
|
|
13907
|
-
|
|
13908
|
-
|
|
13909
|
-
|
|
13910
|
-
|
|
13911
|
-
|
|
13912
|
-
|
|
13913
|
-
|
|
13914
|
-
|
|
13915
|
-
|
|
13916
|
-
|
|
13917
|
-
|
|
13918
|
-
|
|
13919
|
-
|
|
13920
|
-
|
|
13921
|
-
|
|
13922
|
-
|
|
13923
|
-
|
|
13924
|
-
|
|
13925
|
-
|
|
13926
|
-
|
|
13927
|
-
|
|
13928
|
-
|
|
13929
|
-
|
|
13930
|
-
|
|
13931
|
-
|
|
13932
|
-
|
|
13933
|
-
|
|
13934
|
-
|
|
13935
|
-
|
|
13936
|
-
|
|
13937
|
-
|
|
13938
|
-
|
|
13939
|
-
|
|
13940
|
-
|
|
13941
|
-
|
|
13942
|
-
|
|
13943
|
-
|
|
13944
|
-
|
|
13945
|
-
|
|
13946
|
-
|
|
13947
|
-
|
|
13948
|
-
|
|
13949
|
-
|
|
13950
|
-
|
|
13951
|
-
|
|
13952
|
-
|
|
13953
|
-
|
|
13954
|
-
|
|
13955
|
-
|
|
13956
|
-
|
|
13957
|
-
|
|
13958
|
-
|
|
13959
|
-
|
|
13960
|
-
|
|
13961
|
-
|
|
13962
|
-
|
|
13963
|
-
|
|
13964
|
-
|
|
13965
|
-
|
|
13966
|
-
|
|
13967
|
-
|
|
13968
|
-
|
|
13969
|
-
|
|
13970
|
-
|
|
13971
|
-
|
|
13972
|
-
|
|
13973
|
-
|
|
13974
|
-
|
|
13975
|
-
|
|
13976
|
-
|
|
13977
|
-
|
|
13978
|
-
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
-
|
|
13982
|
-
|
|
13983
|
-
|
|
13984
|
-
|
|
13985
|
-
|
|
13986
|
-
|
|
13987
|
-
|
|
13988
|
-
|
|
13989
|
-
|
|
13990
|
-
|
|
13991
|
-
|
|
13992
|
-
|
|
13993
|
-
|
|
13994
|
-
|
|
13995
|
-
|
|
13885
|
+
};
|
|
13886
|
+
this.verifyEditorLinkButton = async (linkUrl) => {
|
|
13887
|
+
await this.editorLinkButton.click();
|
|
13888
|
+
await this.page
|
|
13889
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.addLinkUrlInput)
|
|
13890
|
+
.fill(linkUrl);
|
|
13891
|
+
await this.page
|
|
13892
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.addLinkDoneButton)
|
|
13893
|
+
.click();
|
|
13894
|
+
const linkRole = DESCRIPTION_EDITOR_TEXTS.link;
|
|
13895
|
+
await expect(this.contentField.getByRole(linkRole)).toBeVisible();
|
|
13896
|
+
await this.page.getByTestId(NEETO_EDITOR_SELECTORS.unlinkButton).click();
|
|
13897
|
+
};
|
|
13898
|
+
this.verifyEditorAttachmentsButton = async (filePath) => {
|
|
13899
|
+
const fileUploaderPromise = this.page.waitForEvent("filechooser");
|
|
13900
|
+
await this.editorAttachmentsButton.click();
|
|
13901
|
+
const fileUploader = await fileUploaderPromise;
|
|
13902
|
+
const imagePath = Path.join(__dirname, filePath);
|
|
13903
|
+
await fileUploader.setFiles(imagePath);
|
|
13904
|
+
await this.neetoPlaywrightUtilities.interceptMultipleResponses({
|
|
13905
|
+
responseUrl: ROUTES.attachment,
|
|
13906
|
+
});
|
|
13907
|
+
await this.neetoPlaywrightUtilities.verifyToast();
|
|
13908
|
+
await expect(this.attachmentPreview).toBeVisible();
|
|
13909
|
+
await this.attachmentPreview
|
|
13910
|
+
.getByTestId(COMMON_SELECTORS.dropdownIcon)
|
|
13911
|
+
.click();
|
|
13912
|
+
await this.page
|
|
13913
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.attachmentPreviewDeleteButton)
|
|
13914
|
+
.click();
|
|
13915
|
+
await this.page
|
|
13916
|
+
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
13917
|
+
.click();
|
|
13918
|
+
await this.neetoPlaywrightUtilities.verifyToast({
|
|
13919
|
+
message: ATTACHMENT_DELETION_TOASTR_MESSAGE,
|
|
13920
|
+
});
|
|
13921
|
+
};
|
|
13922
|
+
this.verifyImageUploadOption = async ({ imageUrl, filePath, }) => {
|
|
13923
|
+
await this.imageUploadOption.click();
|
|
13924
|
+
const fileUploaderPromise = this.page.waitForEvent("filechooser");
|
|
13925
|
+
await this.page
|
|
13926
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadButton)
|
|
13927
|
+
.click();
|
|
13928
|
+
const fileUploader = await fileUploaderPromise;
|
|
13929
|
+
const imagePath = Path.join(__dirname, filePath);
|
|
13930
|
+
await fileUploader.setFiles(imagePath);
|
|
13931
|
+
await expect(this.imageWrapper).toBeVisible({ timeout: 15000 });
|
|
13932
|
+
await this.imageWrapper.getByTestId(COMMON_SELECTORS.dropdownIcon).click();
|
|
13933
|
+
await this.imageUploadDeleteButton.click();
|
|
13934
|
+
await expect(this.imageWrapper).toBeHidden({
|
|
13935
|
+
timeout: 15000,
|
|
13936
|
+
});
|
|
13937
|
+
await this.imageUploadOption.click();
|
|
13938
|
+
await this.page
|
|
13939
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadLinkButton)
|
|
13940
|
+
.click();
|
|
13941
|
+
await this.page
|
|
13942
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadLinkInput)
|
|
13943
|
+
.fill(imageUrl);
|
|
13944
|
+
await this.page
|
|
13945
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadLinkSubmitButton)
|
|
13946
|
+
.click();
|
|
13947
|
+
await expect(this.imageWrapper).toBeVisible({ timeout: 15000 });
|
|
13948
|
+
await this.imageWrapper.getByTestId(COMMON_SELECTORS.dropdownIcon).click();
|
|
13949
|
+
await this.imageUploadDeleteButton.click();
|
|
13950
|
+
await expect(this.imageWrapper).toBeHidden({
|
|
13951
|
+
timeout: 15000,
|
|
13952
|
+
});
|
|
13953
|
+
};
|
|
13954
|
+
this.verifyCannedResponseOption = async (cannedResponseSuccessMessage) => {
|
|
13955
|
+
await this.cannedResponseOption.click();
|
|
13956
|
+
await expect(this.page.getByTestId(COMMON_SELECTORS.paneHeader)).toContainText(DESCRIPTION_EDITOR_TEXTS.cannedResponseHeader);
|
|
13957
|
+
await this.page
|
|
13958
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.cannedResponseSelectContainer)
|
|
13959
|
+
.fill(this.t("neetoRules.labels.feedback"));
|
|
13960
|
+
await this.page
|
|
13961
|
+
.getByTestId(COMMON_SELECTORS.selectOption(this.t("neetoRules.labels.feedback")))
|
|
13962
|
+
.click();
|
|
13963
|
+
await this.page.getByTestId(NEETO_EDITOR_SELECTORS.applyButton).click();
|
|
13964
|
+
await this.neetoPlaywrightUtilities.verifyToast({
|
|
13965
|
+
message: cannedResponseSuccessMessage,
|
|
13966
|
+
});
|
|
13967
|
+
};
|
|
13968
|
+
this.verifyVideoEmbedOption = async (videoUrl) => {
|
|
13969
|
+
await this.videoEmbedOption.click();
|
|
13970
|
+
await this.videoEmbedInput.fill(videoUrl);
|
|
13971
|
+
await this.page
|
|
13972
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.videoEmbedSubmit)
|
|
13973
|
+
.click();
|
|
13974
|
+
await expect(this.videoWrapperSelector).toBeVisible({ timeout: 15000 });
|
|
13975
|
+
await this.videoWrapperSelector
|
|
13976
|
+
.getByTestId(COMMON_SELECTORS.dropdownIcon)
|
|
13977
|
+
.click();
|
|
13978
|
+
await this.imageUploadDeleteButton.click();
|
|
13979
|
+
await expect(this.videoWrapperSelector).toBeHidden({
|
|
13980
|
+
timeout: 15000,
|
|
13981
|
+
});
|
|
13982
|
+
};
|
|
13983
|
+
this.verifyEmojiSelector = async () => {
|
|
13984
|
+
await this.emojiSelector.click();
|
|
13985
|
+
const emojiContainer = this.page.getByTestId(NEETO_EDITOR_SELECTORS.emojiContainer);
|
|
13986
|
+
await expect(emojiContainer).toBeVisible({
|
|
13987
|
+
timeout: 10000,
|
|
13988
|
+
});
|
|
13989
|
+
await emojiContainer
|
|
13990
|
+
.getByPlaceholder(DESCRIPTION_EDITOR_TEXTS.search)
|
|
13991
|
+
.fill(EMOJI_LABEL);
|
|
13992
|
+
await this.page.keyboard.press("Enter");
|
|
13993
|
+
await expect(this.contentField).toContainText("👍");
|
|
13994
|
+
await this.page.keyboard.press("Escape");
|
|
13995
|
+
};
|
|
13996
|
+
this.verifyDynamicVariables = async (dynamicVariables) => {
|
|
13997
|
+
for (const dynamicVariable of dynamicVariables) {
|
|
13998
|
+
await this.dynamicVariablesButton.click();
|
|
13999
|
+
await expect(this.page.getByTestId(COMMON_SELECTORS.dropdownContainer)).toBeVisible();
|
|
13996
14000
|
await this.page
|
|
13997
|
-
.
|
|
14001
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.dynamicVariableSelector(dynamicVariable))
|
|
13998
14002
|
.click();
|
|
13999
|
-
await expect(this.
|
|
14000
|
-
timeout: 10000,
|
|
14001
|
-
});
|
|
14002
|
-
await this.page
|
|
14003
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.emojiContainer)
|
|
14004
|
-
.getByPlaceholder(DESCRIPTION_EDITOR_TEXTS.search)
|
|
14005
|
-
.fill(EMOJI_LABEL);
|
|
14006
|
-
await this.page.keyboard.press("Enter");
|
|
14007
|
-
await expect(editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.contentField)).toContainText("👍");
|
|
14008
|
-
await this.page.keyboard.press("Escape");
|
|
14003
|
+
await expect(this.contentField.getByText(dynamicVariable)).toBeVisible();
|
|
14009
14004
|
}
|
|
14010
|
-
|
|
14011
|
-
|
|
14012
|
-
|
|
14013
|
-
|
|
14014
|
-
|
|
14015
|
-
|
|
14016
|
-
|
|
14017
|
-
|
|
14018
|
-
await expect(this.page.getByTestId(COMMON_SELECTORS.dropdownContainer)).toBeVisible();
|
|
14019
|
-
await this.page
|
|
14020
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.dynamicVariableSelector(dynamicVariable))
|
|
14021
|
-
.click();
|
|
14022
|
-
await expect(editorWrapper
|
|
14023
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
14024
|
-
.getByText(dynamicVariable)).toBeVisible();
|
|
14025
|
-
}
|
|
14005
|
+
};
|
|
14006
|
+
this.verifyDescriptionEditor = async ({ text, dynamicVariables, defaultFontSizeOption = "Paragraph", linkUrl = faker.internet.url(), filePath = "../../../e2e/assets/images/BigBinary.png", imageUrl = "https://picsum.photos/200/300", videoUrl = "https://youtu.be/jNQXAC9IVRw", cannedResponseSuccessMessage, }) => {
|
|
14007
|
+
await this.contentField.fill(text);
|
|
14008
|
+
await this.verifyFontSize(defaultFontSizeOption);
|
|
14009
|
+
if (await this.assertOptionVisibility(this.paragraphSelector)) {
|
|
14010
|
+
await this.paragraphSelector.click();
|
|
14011
|
+
const paragraphRole = DESCRIPTION_EDITOR_TEXTS.paragraphOption;
|
|
14012
|
+
await expect(this.contentField.getByRole(paragraphRole)).toBeVisible();
|
|
14026
14013
|
}
|
|
14014
|
+
(await this.fixedMenuArrowSelector.isVisible()) &&
|
|
14015
|
+
(await this.fixedMenuArrowSelector.click());
|
|
14016
|
+
await this.editorWrapper.getByText(text).click({ clickCount: 3 });
|
|
14017
|
+
await this.verifyTextModifiers();
|
|
14018
|
+
await this.verifyTextDeskModifier();
|
|
14019
|
+
await this.verifyListModifiers();
|
|
14020
|
+
(await this.assertOptionVisibility(this.editorLinkButton)) &&
|
|
14021
|
+
(await this.verifyEditorLinkButton(linkUrl));
|
|
14022
|
+
(await this.assertOptionVisibility(this.editorAttachmentsButton)) &&
|
|
14023
|
+
(await this.verifyEditorAttachmentsButton(filePath));
|
|
14024
|
+
(await this.assertOptionVisibility(this.imageUploadOption)) &&
|
|
14025
|
+
(await this.verifyImageUploadOption({
|
|
14026
|
+
imageUrl,
|
|
14027
|
+
filePath,
|
|
14028
|
+
}));
|
|
14029
|
+
(await this.assertOptionVisibility(this.cannedResponseOption)) &&
|
|
14030
|
+
(await this.verifyCannedResponseOption(cannedResponseSuccessMessage));
|
|
14031
|
+
(await this.assertOptionVisibility(this.videoEmbedOption)) &&
|
|
14032
|
+
(await this.verifyVideoEmbedOption(videoUrl));
|
|
14033
|
+
(await this.assertOptionVisibility(this.emojiSelector)) &&
|
|
14034
|
+
(await this.verifyEmojiSelector());
|
|
14035
|
+
dynamicVariables &&
|
|
14036
|
+
(await this.assertOptionVisibility(this.dynamicVariablesButton)) &&
|
|
14037
|
+
(await this.verifyDynamicVariables(dynamicVariables));
|
|
14027
14038
|
};
|
|
14028
14039
|
this.page = page;
|
|
14029
14040
|
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
14030
14041
|
this.t = getI18nInstance().t;
|
|
14031
|
-
this.
|
|
14032
|
-
|
|
14033
|
-
|
|
14034
|
-
this.
|
|
14035
|
-
this.
|
|
14036
|
-
this.
|
|
14037
|
-
this.
|
|
14038
|
-
this.
|
|
14039
|
-
this.
|
|
14040
|
-
this.
|
|
14042
|
+
this.editorWrapper = this.page;
|
|
14043
|
+
if (editorWrapper)
|
|
14044
|
+
this.editorWrapper = editorWrapper;
|
|
14045
|
+
this.paragraphSelector = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.paragraphOption);
|
|
14046
|
+
this.fixedMenuArrowSelector = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.fixedMenuArrow);
|
|
14047
|
+
this.editorLinkButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.linkOption);
|
|
14048
|
+
this.attachmentPreview = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.attachmentPreview);
|
|
14049
|
+
this.editorAttachmentsButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.editorAttachmentsButton);
|
|
14050
|
+
this.imageWrapper = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.imageWrapper);
|
|
14051
|
+
this.imageUploadDeleteButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadDeleteButton);
|
|
14052
|
+
this.imageUploadOption = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadOption);
|
|
14053
|
+
this.cannedResponseOption = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.cannedResponseOption);
|
|
14054
|
+
this.videoEmbedOption = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.videoEmbedOption);
|
|
14041
14055
|
this.videoEmbedInput = this.page.getByTestId(NEETO_EDITOR_SELECTORS.videoEmbedInput);
|
|
14042
|
-
this.videoWrapperSelector = this.
|
|
14043
|
-
this.
|
|
14044
|
-
|
|
14045
|
-
|
|
14056
|
+
this.videoWrapperSelector = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.videoWrapper);
|
|
14057
|
+
this.emojiSelector = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.emojiOption);
|
|
14058
|
+
this.moreMenuSelector = this.editorWrapper.getByTestId(COMMON_SELECTORS.dropdownIcon);
|
|
14059
|
+
this.contentField = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.contentField);
|
|
14060
|
+
this.dynamicVariablesButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.dynamicVariablesButton);
|
|
14046
14061
|
}
|
|
14047
14062
|
}
|
|
14048
14063
|
|
|
@@ -14249,8 +14264,10 @@ class TeamMembers {
|
|
|
14249
14264
|
.click();
|
|
14250
14265
|
await this.page.getByTestId(MEMBER_SELECTORS.continueButton).click();
|
|
14251
14266
|
}
|
|
14252
|
-
await
|
|
14253
|
-
|
|
14267
|
+
await expect(async () => {
|
|
14268
|
+
await this.page.getByTestId(MEMBER_SELECTORS.submitButton).click();
|
|
14269
|
+
await expect(this.page.getByTestId(COMMON_SELECTORS.paneBody)).toBeHidden();
|
|
14270
|
+
}).toPass({ timeout: 20000 });
|
|
14254
14271
|
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
14255
14272
|
await this.neetoPlaywrightUtilities.verifyToast();
|
|
14256
14273
|
};
|
|
@@ -14261,7 +14278,8 @@ class TeamMembers {
|
|
|
14261
14278
|
});
|
|
14262
14279
|
await this.page.getByTestId(MEMBER_SELECTORS.searchTextField).fill(email);
|
|
14263
14280
|
await searchMembers;
|
|
14264
|
-
|
|
14281
|
+
const emailSubstr = email.length > 20 ? email.substring(0, 20) : email;
|
|
14282
|
+
await expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.searchTermBlock)).toContainText(emailSubstr);
|
|
14265
14283
|
await expect(this.page.getByRole("cell", { name: email, exact: true })).toBeVisible();
|
|
14266
14284
|
await expect(this.page.getByTestId(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
14267
14285
|
};
|