@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.cjs.js
CHANGED
|
@@ -13787,49 +13787,54 @@ const LIST_MODIFIER_TAGS = {
|
|
|
13787
13787
|
orderedListOption: "ol",
|
|
13788
13788
|
};
|
|
13789
13789
|
|
|
13790
|
+
const optionSelector = (option) => `neeto-editor-fixed-menu-${option}-option`;
|
|
13791
|
+
const fixedMenuSelector = (selector) => `neeto-editor-fixed-menu-${selector}`;
|
|
13792
|
+
|
|
13790
13793
|
const NEETO_EDITOR_SELECTORS = {
|
|
13791
|
-
boldOption: "
|
|
13792
|
-
italicOption: "
|
|
13793
|
-
underlineOption: "
|
|
13794
|
-
strikeOption: "
|
|
13795
|
-
codeBlockOption: "
|
|
13796
|
-
highlightOption: "
|
|
13797
|
-
|
|
13798
|
-
|
|
13794
|
+
boldOption: optionSelector("bold"),
|
|
13795
|
+
italicOption: optionSelector("italic"),
|
|
13796
|
+
underlineOption: optionSelector("underline"),
|
|
13797
|
+
strikeOption: optionSelector("strike"),
|
|
13798
|
+
codeBlockOption: optionSelector("code"),
|
|
13799
|
+
highlightOption: optionSelector("highlight"),
|
|
13800
|
+
emojiOption: optionSelector("emoji"),
|
|
13801
|
+
emojiDropdownIcon: "emoji-dropdown-icon",
|
|
13802
|
+
linkInput: fixedMenuSelector("link-option-input"),
|
|
13803
|
+
linkSubmitButton: fixedMenuSelector("link-option-link-button"),
|
|
13799
13804
|
commandList: (index) => `neeto-editor-command-list-item-${index}`,
|
|
13800
13805
|
imageUploadUrlSubmitButton: "neeto-editor-media-upload-url-submit",
|
|
13801
13806
|
imageUploadUrlInputTextField: "neeto-editor-media-upload-url-input",
|
|
13802
13807
|
uploadInput: "neeto-editor-media-uploader-input",
|
|
13803
|
-
editorMenuBarWrapper: "
|
|
13804
|
-
undoOption: "
|
|
13805
|
-
redoOption: "
|
|
13808
|
+
editorMenuBarWrapper: fixedMenuSelector("wrapper"),
|
|
13809
|
+
undoOption: optionSelector("undo"),
|
|
13810
|
+
redoOption: optionSelector("redo"),
|
|
13806
13811
|
imageWrapper: "neeto-editor-image-wrapper",
|
|
13807
13812
|
contentField: "neeto-editor-content",
|
|
13808
|
-
addLinkButton: "
|
|
13813
|
+
addLinkButton: optionSelector("link"),
|
|
13809
13814
|
addLinkTextField: "neeto-editor-add-link-text-input",
|
|
13810
13815
|
addURLTextField: "neeto-editor-add-link-url-input",
|
|
13811
13816
|
submitLinkButton: "neeto-editor-add-link",
|
|
13812
13817
|
fontSizeDropdown: (currentOption) => `${joinHyphenCase(currentOption)}-dropdown-icon`,
|
|
13813
|
-
fixedMenuArrow: "
|
|
13814
|
-
cannedResponseOption: "
|
|
13818
|
+
fixedMenuArrow: fixedMenuSelector("arrow"),
|
|
13819
|
+
cannedResponseOption: optionSelector("canned-responses"),
|
|
13815
13820
|
cannedResponseSelectContainer: "select-a-canned-response-select-container",
|
|
13816
|
-
fixedMenuWrapper: "
|
|
13817
|
-
linkOption: "
|
|
13821
|
+
fixedMenuWrapper: optionSelector("wrapper"),
|
|
13822
|
+
linkOption: optionSelector("link"),
|
|
13818
13823
|
addLinkUrlInput: "neeto-editor-add-link-url-input",
|
|
13819
13824
|
addLinkDoneButton: "neeto-editor-add-link",
|
|
13820
13825
|
unlinkButton: "neeto-editor-link-popover-unlink",
|
|
13821
|
-
editorAttachmentsButton: "
|
|
13826
|
+
editorAttachmentsButton: optionSelector("attachments"),
|
|
13822
13827
|
attachmentPreviewDeleteButton: "neeto-editor-preview-delete-button",
|
|
13823
|
-
imageUploadOption: "
|
|
13828
|
+
imageUploadOption: optionSelector("image-upload"),
|
|
13824
13829
|
imageUploadLinkInput: "neeto-editor-media-upload-url-input",
|
|
13825
13830
|
imageUploadButton: "neeto-editor-media-uploader-dnd",
|
|
13826
13831
|
imageUploadLinkSubmitButton: "neeto-editor-media-upload-url-submit",
|
|
13827
13832
|
applyButton: "apply-button",
|
|
13828
|
-
videoEmbedOption: "
|
|
13833
|
+
videoEmbedOption: optionSelector("video-embed"),
|
|
13829
13834
|
videoEmbedInput: "neeto-editor-embed-input",
|
|
13830
13835
|
videoEmbedSubmit: "neeto-editor-embed-cancel",
|
|
13831
13836
|
videoWrapper: "neeto-editor-video-wrapper",
|
|
13832
|
-
paragraphOption: "
|
|
13837
|
+
paragraphOption: fixedMenuSelector("font-size-option-body2"),
|
|
13833
13838
|
attachmentPreview: "ne-attachments-wrapper",
|
|
13834
13839
|
imageUploadLinkButton: "neeto-editor-media-uploader-link-tab",
|
|
13835
13840
|
errorText: "neeto-editor-error-text",
|
|
@@ -13840,256 +13845,266 @@ const NEETO_EDITOR_SELECTORS = {
|
|
|
13840
13845
|
dynamicVariableSelector: (variable) => `dynamic-variables-list-item-${neetoCist.hyphenate(variable)}`,
|
|
13841
13846
|
};
|
|
13842
13847
|
const NEETO_TEXT_MODIFIER_SELECTORS = {
|
|
13843
|
-
strikeOption: "
|
|
13844
|
-
underlineOption: "
|
|
13845
|
-
highlightOption: "
|
|
13848
|
+
strikeOption: optionSelector("strike"),
|
|
13849
|
+
underlineOption: optionSelector("underline"),
|
|
13850
|
+
highlightOption: optionSelector("highlight"),
|
|
13846
13851
|
};
|
|
13847
13852
|
const TEXT_MODIFIER_SELECTORS = {
|
|
13848
|
-
boldOption: "
|
|
13849
|
-
italicsOption: "
|
|
13850
|
-
codeOption: "
|
|
13851
|
-
blockquoteOption: "
|
|
13852
|
-
codeblockOption: "
|
|
13853
|
+
boldOption: optionSelector("bold"),
|
|
13854
|
+
italicsOption: optionSelector("italic"),
|
|
13855
|
+
codeOption: optionSelector("code"),
|
|
13856
|
+
blockquoteOption: optionSelector("blockquote"),
|
|
13857
|
+
codeblockOption: optionSelector("codeBlock"),
|
|
13853
13858
|
};
|
|
13854
13859
|
const LIST_MODIFIER_SELECTORS = {
|
|
13855
|
-
bulletListOption: "
|
|
13856
|
-
orderedListOption: "
|
|
13860
|
+
bulletListOption: optionSelector("bulletList"),
|
|
13861
|
+
orderedListOption: optionSelector("orderedList"),
|
|
13857
13862
|
};
|
|
13858
13863
|
const FONT_SIZE_SELECTORS = {
|
|
13859
|
-
h1: "
|
|
13860
|
-
h2: "
|
|
13861
|
-
h3: "
|
|
13862
|
-
h4: "
|
|
13863
|
-
h5: "
|
|
13864
|
+
h1: fixedMenuSelector("font-size-option-h1"),
|
|
13865
|
+
h2: fixedMenuSelector("font-size-option-h2"),
|
|
13866
|
+
h3: fixedMenuSelector("font-size-option-h3"),
|
|
13867
|
+
h4: fixedMenuSelector("font-size-option-h4"),
|
|
13868
|
+
h5: fixedMenuSelector("font-size-option-h5"),
|
|
13864
13869
|
};
|
|
13865
13870
|
|
|
13866
|
-
/* eslint-disable playwright/no-nth-methods */
|
|
13867
13871
|
class EditorPage {
|
|
13868
|
-
constructor(page, neetoPlaywrightUtilities) {
|
|
13869
|
-
this.
|
|
13870
|
-
if (
|
|
13871
|
-
|
|
13872
|
-
await
|
|
13873
|
-
.
|
|
13874
|
-
|
|
13875
|
-
|
|
13872
|
+
constructor(page, neetoPlaywrightUtilities, editorWrapper) {
|
|
13873
|
+
this.assertOptionVisibility = async (optionLocator) => {
|
|
13874
|
+
if (await optionLocator.isVisible())
|
|
13875
|
+
return true;
|
|
13876
|
+
(await this.moreMenuSelector.isVisible()) &&
|
|
13877
|
+
(await this.moreMenuSelector.click());
|
|
13878
|
+
return optionLocator.isVisible();
|
|
13879
|
+
};
|
|
13880
|
+
this.verifyFontSize = async (defaultFontSizeOption) => {
|
|
13881
|
+
await this.editorWrapper
|
|
13876
13882
|
.getByTestId(NEETO_EDITOR_SELECTORS.fontSizeDropdown(defaultFontSizeOption))
|
|
13877
13883
|
.click();
|
|
13878
13884
|
const fontSize = Object.keys(FONT_SIZE_SELECTORS);
|
|
13879
13885
|
for (const font of fontSize) {
|
|
13880
13886
|
const fontKey = font;
|
|
13881
|
-
await editorWrapper
|
|
13882
|
-
|
|
13883
|
-
.
|
|
13884
|
-
|
|
13885
|
-
await editorWrapper
|
|
13887
|
+
await this.editorWrapper
|
|
13888
|
+
.getByTestId(FONT_SIZE_SELECTORS[fontKey])
|
|
13889
|
+
.click();
|
|
13890
|
+
await test$1.expect(this.contentField.getByRole("heading", { level: Number(font.slice(1)) })).toBeVisible();
|
|
13891
|
+
await this.editorWrapper
|
|
13886
13892
|
.getByTestId(NEETO_EDITOR_SELECTORS.fontSizeDropdown(EXPANDED_FONT_SIZE[fontKey]))
|
|
13887
13893
|
.click();
|
|
13888
13894
|
}
|
|
13889
|
-
|
|
13890
|
-
|
|
13891
|
-
const paragraphRole = DESCRIPTION_EDITOR_TEXTS.paragraphOption;
|
|
13892
|
-
await test$1.expect(editorWrapper
|
|
13893
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
13894
|
-
.getByRole(paragraphRole)).toBeVisible();
|
|
13895
|
-
}
|
|
13896
|
-
(await this.fixedMenuArrowSelector.isVisible()) &&
|
|
13897
|
-
(await this.fixedMenuArrowSelector.click());
|
|
13898
|
-
await editorWrapper.getByText(text).click({ clickCount: 3 });
|
|
13895
|
+
};
|
|
13896
|
+
this.verifyTextModifiers = async () => {
|
|
13899
13897
|
const textModifier = Object.keys(TEXT_MODIFIER_SELECTORS);
|
|
13900
13898
|
for (const modifier of textModifier) {
|
|
13901
13899
|
const modifierKey = modifier;
|
|
13902
13900
|
const textModifierRole = TEXT_MODIFIER_ROLES[modifierKey];
|
|
13903
|
-
const textModifierSelector = editorWrapper.getByTestId(TEXT_MODIFIER_SELECTORS[modifierKey]);
|
|
13904
|
-
if (await
|
|
13901
|
+
const textModifierSelector = this.editorWrapper.getByTestId(TEXT_MODIFIER_SELECTORS[modifierKey]);
|
|
13902
|
+
if (await this.assertOptionVisibility(textModifierSelector)) {
|
|
13905
13903
|
await textModifierSelector.click();
|
|
13906
|
-
await test$1.expect(
|
|
13907
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
13908
|
-
.getByRole(textModifierRole)).toBeVisible();
|
|
13904
|
+
await test$1.expect(this.contentField.getByRole(textModifierRole)).toBeVisible();
|
|
13909
13905
|
await textModifierSelector.click();
|
|
13910
13906
|
}
|
|
13911
13907
|
}
|
|
13908
|
+
};
|
|
13909
|
+
this.verifyTextDeskModifier = async () => {
|
|
13912
13910
|
const textDeskModifier = Object.keys(NEETO_TEXT_MODIFIER_SELECTORS);
|
|
13913
13911
|
for (const modifier of textDeskModifier) {
|
|
13914
13912
|
const modifierKey = modifier;
|
|
13915
|
-
const textModifierSelector = editorWrapper.getByTestId(NEETO_TEXT_MODIFIER_SELECTORS[modifierKey]);
|
|
13916
|
-
if (await
|
|
13913
|
+
const textModifierSelector = this.editorWrapper.getByTestId(NEETO_TEXT_MODIFIER_SELECTORS[modifierKey]);
|
|
13914
|
+
if (await this.assertOptionVisibility(textModifierSelector)) {
|
|
13917
13915
|
await textModifierSelector.click();
|
|
13918
|
-
await test$1.expect(
|
|
13919
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
13920
|
-
.locator(TEXT_MODIFIER_TAGS[modifierKey])).toBeVisible();
|
|
13916
|
+
await test$1.expect(this.contentField.locator(TEXT_MODIFIER_TAGS[modifierKey])).toBeVisible();
|
|
13921
13917
|
await textModifierSelector.click();
|
|
13922
13918
|
}
|
|
13923
13919
|
}
|
|
13920
|
+
};
|
|
13921
|
+
this.verifyListModifiers = async () => {
|
|
13924
13922
|
const listModifier = Object.keys(LIST_MODIFIER_SELECTORS);
|
|
13925
13923
|
for (const modifier of listModifier) {
|
|
13926
13924
|
const modifierKey = modifier;
|
|
13927
|
-
const listModifierSelector = editorWrapper.getByTestId(LIST_MODIFIER_SELECTORS[modifierKey]);
|
|
13928
|
-
if (await
|
|
13925
|
+
const listModifierSelector = this.editorWrapper.getByTestId(LIST_MODIFIER_SELECTORS[modifierKey]);
|
|
13926
|
+
if (await this.assertOptionVisibility(listModifierSelector)) {
|
|
13929
13927
|
await listModifierSelector.click();
|
|
13930
|
-
await test$1.expect(
|
|
13931
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
13932
|
-
.locator(LIST_MODIFIER_TAGS[modifierKey])).toBeVisible();
|
|
13928
|
+
await test$1.expect(this.contentField.locator(LIST_MODIFIER_TAGS[modifierKey])).toBeVisible();
|
|
13933
13929
|
await listModifierSelector.click();
|
|
13934
13930
|
}
|
|
13935
13931
|
}
|
|
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
|
-
|
|
13996
|
-
|
|
13997
|
-
|
|
13998
|
-
|
|
13999
|
-
|
|
14000
|
-
|
|
14001
|
-
|
|
14002
|
-
|
|
14003
|
-
|
|
14004
|
-
|
|
14005
|
-
|
|
14006
|
-
|
|
14007
|
-
|
|
14008
|
-
|
|
14009
|
-
|
|
14010
|
-
|
|
14011
|
-
|
|
14012
|
-
|
|
14013
|
-
|
|
14014
|
-
|
|
14015
|
-
|
|
14016
|
-
|
|
14017
|
-
|
|
14018
|
-
|
|
14019
|
-
|
|
14020
|
-
|
|
14021
|
-
|
|
14022
|
-
|
|
14023
|
-
|
|
14024
|
-
|
|
14025
|
-
|
|
14026
|
-
|
|
14027
|
-
|
|
14028
|
-
|
|
14029
|
-
|
|
14030
|
-
|
|
14031
|
-
|
|
14032
|
-
|
|
14033
|
-
|
|
14034
|
-
|
|
14035
|
-
|
|
14036
|
-
|
|
14037
|
-
|
|
14038
|
-
|
|
14039
|
-
|
|
14040
|
-
|
|
14041
|
-
|
|
14042
|
-
|
|
13932
|
+
};
|
|
13933
|
+
this.verifyEditorLinkButton = async (linkUrl) => {
|
|
13934
|
+
await this.editorLinkButton.click();
|
|
13935
|
+
await this.page
|
|
13936
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.addLinkUrlInput)
|
|
13937
|
+
.fill(linkUrl);
|
|
13938
|
+
await this.page
|
|
13939
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.addLinkDoneButton)
|
|
13940
|
+
.click();
|
|
13941
|
+
const linkRole = DESCRIPTION_EDITOR_TEXTS.link;
|
|
13942
|
+
await test$1.expect(this.contentField.getByRole(linkRole)).toBeVisible();
|
|
13943
|
+
await this.page.getByTestId(NEETO_EDITOR_SELECTORS.unlinkButton).click();
|
|
13944
|
+
};
|
|
13945
|
+
this.verifyEditorAttachmentsButton = async (filePath) => {
|
|
13946
|
+
const fileUploaderPromise = this.page.waitForEvent("filechooser");
|
|
13947
|
+
await this.editorAttachmentsButton.click();
|
|
13948
|
+
const fileUploader = await fileUploaderPromise;
|
|
13949
|
+
const imagePath = Path__namespace.join(__dirname, filePath);
|
|
13950
|
+
await fileUploader.setFiles(imagePath);
|
|
13951
|
+
await this.neetoPlaywrightUtilities.interceptMultipleResponses({
|
|
13952
|
+
responseUrl: ROUTES.attachment,
|
|
13953
|
+
});
|
|
13954
|
+
await this.neetoPlaywrightUtilities.verifyToast();
|
|
13955
|
+
await test$1.expect(this.attachmentPreview).toBeVisible();
|
|
13956
|
+
await this.attachmentPreview
|
|
13957
|
+
.getByTestId(COMMON_SELECTORS.dropdownIcon)
|
|
13958
|
+
.click();
|
|
13959
|
+
await this.page
|
|
13960
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.attachmentPreviewDeleteButton)
|
|
13961
|
+
.click();
|
|
13962
|
+
await this.page
|
|
13963
|
+
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
13964
|
+
.click();
|
|
13965
|
+
await this.neetoPlaywrightUtilities.verifyToast({
|
|
13966
|
+
message: ATTACHMENT_DELETION_TOASTR_MESSAGE,
|
|
13967
|
+
});
|
|
13968
|
+
};
|
|
13969
|
+
this.verifyImageUploadOption = async ({ imageUrl, filePath, }) => {
|
|
13970
|
+
await this.imageUploadOption.click();
|
|
13971
|
+
const fileUploaderPromise = this.page.waitForEvent("filechooser");
|
|
13972
|
+
await this.page
|
|
13973
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadButton)
|
|
13974
|
+
.click();
|
|
13975
|
+
const fileUploader = await fileUploaderPromise;
|
|
13976
|
+
const imagePath = Path__namespace.join(__dirname, filePath);
|
|
13977
|
+
await fileUploader.setFiles(imagePath);
|
|
13978
|
+
await test$1.expect(this.imageWrapper).toBeVisible({ timeout: 15000 });
|
|
13979
|
+
await this.imageWrapper.getByTestId(COMMON_SELECTORS.dropdownIcon).click();
|
|
13980
|
+
await this.imageUploadDeleteButton.click();
|
|
13981
|
+
await test$1.expect(this.imageWrapper).toBeHidden({
|
|
13982
|
+
timeout: 15000,
|
|
13983
|
+
});
|
|
13984
|
+
await this.imageUploadOption.click();
|
|
13985
|
+
await this.page
|
|
13986
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadLinkButton)
|
|
13987
|
+
.click();
|
|
13988
|
+
await this.page
|
|
13989
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadLinkInput)
|
|
13990
|
+
.fill(imageUrl);
|
|
13991
|
+
await this.page
|
|
13992
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadLinkSubmitButton)
|
|
13993
|
+
.click();
|
|
13994
|
+
await test$1.expect(this.imageWrapper).toBeVisible({ timeout: 15000 });
|
|
13995
|
+
await this.imageWrapper.getByTestId(COMMON_SELECTORS.dropdownIcon).click();
|
|
13996
|
+
await this.imageUploadDeleteButton.click();
|
|
13997
|
+
await test$1.expect(this.imageWrapper).toBeHidden({
|
|
13998
|
+
timeout: 15000,
|
|
13999
|
+
});
|
|
14000
|
+
};
|
|
14001
|
+
this.verifyCannedResponseOption = async (cannedResponseSuccessMessage) => {
|
|
14002
|
+
await this.cannedResponseOption.click();
|
|
14003
|
+
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.paneHeader)).toContainText(DESCRIPTION_EDITOR_TEXTS.cannedResponseHeader);
|
|
14004
|
+
await this.page
|
|
14005
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.cannedResponseSelectContainer)
|
|
14006
|
+
.fill(this.t("neetoRules.labels.feedback"));
|
|
14007
|
+
await this.page
|
|
14008
|
+
.getByTestId(COMMON_SELECTORS.selectOption(this.t("neetoRules.labels.feedback")))
|
|
14009
|
+
.click();
|
|
14010
|
+
await this.page.getByTestId(NEETO_EDITOR_SELECTORS.applyButton).click();
|
|
14011
|
+
await this.neetoPlaywrightUtilities.verifyToast({
|
|
14012
|
+
message: cannedResponseSuccessMessage,
|
|
14013
|
+
});
|
|
14014
|
+
};
|
|
14015
|
+
this.verifyVideoEmbedOption = async (videoUrl) => {
|
|
14016
|
+
await this.videoEmbedOption.click();
|
|
14017
|
+
await this.videoEmbedInput.fill(videoUrl);
|
|
14018
|
+
await this.page
|
|
14019
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.videoEmbedSubmit)
|
|
14020
|
+
.click();
|
|
14021
|
+
await test$1.expect(this.videoWrapperSelector).toBeVisible({ timeout: 15000 });
|
|
14022
|
+
await this.videoWrapperSelector
|
|
14023
|
+
.getByTestId(COMMON_SELECTORS.dropdownIcon)
|
|
14024
|
+
.click();
|
|
14025
|
+
await this.imageUploadDeleteButton.click();
|
|
14026
|
+
await test$1.expect(this.videoWrapperSelector).toBeHidden({
|
|
14027
|
+
timeout: 15000,
|
|
14028
|
+
});
|
|
14029
|
+
};
|
|
14030
|
+
this.verifyEmojiSelector = async () => {
|
|
14031
|
+
await this.emojiSelector.click();
|
|
14032
|
+
const emojiContainer = this.page.getByTestId(NEETO_EDITOR_SELECTORS.emojiContainer);
|
|
14033
|
+
await test$1.expect(emojiContainer).toBeVisible({
|
|
14034
|
+
timeout: 10000,
|
|
14035
|
+
});
|
|
14036
|
+
await emojiContainer
|
|
14037
|
+
.getByPlaceholder(DESCRIPTION_EDITOR_TEXTS.search)
|
|
14038
|
+
.fill(EMOJI_LABEL);
|
|
14039
|
+
await this.page.keyboard.press("Enter");
|
|
14040
|
+
await test$1.expect(this.contentField).toContainText("👍");
|
|
14041
|
+
await this.page.keyboard.press("Escape");
|
|
14042
|
+
};
|
|
14043
|
+
this.verifyDynamicVariables = async (dynamicVariables) => {
|
|
14044
|
+
for (const dynamicVariable of dynamicVariables) {
|
|
14045
|
+
await this.dynamicVariablesButton.click();
|
|
14046
|
+
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.dropdownContainer)).toBeVisible();
|
|
14043
14047
|
await this.page
|
|
14044
|
-
.
|
|
14048
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.dynamicVariableSelector(dynamicVariable))
|
|
14045
14049
|
.click();
|
|
14046
|
-
await test$1.expect(this.
|
|
14047
|
-
timeout: 10000,
|
|
14048
|
-
});
|
|
14049
|
-
await this.page
|
|
14050
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.emojiContainer)
|
|
14051
|
-
.getByPlaceholder(DESCRIPTION_EDITOR_TEXTS.search)
|
|
14052
|
-
.fill(EMOJI_LABEL);
|
|
14053
|
-
await this.page.keyboard.press("Enter");
|
|
14054
|
-
await test$1.expect(editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.contentField)).toContainText("👍");
|
|
14055
|
-
await this.page.keyboard.press("Escape");
|
|
14050
|
+
await test$1.expect(this.contentField.getByText(dynamicVariable)).toBeVisible();
|
|
14056
14051
|
}
|
|
14057
|
-
|
|
14058
|
-
|
|
14059
|
-
|
|
14060
|
-
|
|
14061
|
-
|
|
14062
|
-
|
|
14063
|
-
|
|
14064
|
-
|
|
14065
|
-
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.dropdownContainer)).toBeVisible();
|
|
14066
|
-
await this.page
|
|
14067
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.dynamicVariableSelector(dynamicVariable))
|
|
14068
|
-
.click();
|
|
14069
|
-
await test$1.expect(editorWrapper
|
|
14070
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
14071
|
-
.getByText(dynamicVariable)).toBeVisible();
|
|
14072
|
-
}
|
|
14052
|
+
};
|
|
14053
|
+
this.verifyDescriptionEditor = async ({ text, dynamicVariables, defaultFontSizeOption = "Paragraph", linkUrl = faker.faker.internet.url(), filePath = "../../../e2e/assets/images/BigBinary.png", imageUrl = "https://picsum.photos/200/300", videoUrl = "https://youtu.be/jNQXAC9IVRw", cannedResponseSuccessMessage, }) => {
|
|
14054
|
+
await this.contentField.fill(text);
|
|
14055
|
+
await this.verifyFontSize(defaultFontSizeOption);
|
|
14056
|
+
if (await this.assertOptionVisibility(this.paragraphSelector)) {
|
|
14057
|
+
await this.paragraphSelector.click();
|
|
14058
|
+
const paragraphRole = DESCRIPTION_EDITOR_TEXTS.paragraphOption;
|
|
14059
|
+
await test$1.expect(this.contentField.getByRole(paragraphRole)).toBeVisible();
|
|
14073
14060
|
}
|
|
14061
|
+
(await this.fixedMenuArrowSelector.isVisible()) &&
|
|
14062
|
+
(await this.fixedMenuArrowSelector.click());
|
|
14063
|
+
await this.editorWrapper.getByText(text).click({ clickCount: 3 });
|
|
14064
|
+
await this.verifyTextModifiers();
|
|
14065
|
+
await this.verifyTextDeskModifier();
|
|
14066
|
+
await this.verifyListModifiers();
|
|
14067
|
+
(await this.assertOptionVisibility(this.editorLinkButton)) &&
|
|
14068
|
+
(await this.verifyEditorLinkButton(linkUrl));
|
|
14069
|
+
(await this.assertOptionVisibility(this.editorAttachmentsButton)) &&
|
|
14070
|
+
(await this.verifyEditorAttachmentsButton(filePath));
|
|
14071
|
+
(await this.assertOptionVisibility(this.imageUploadOption)) &&
|
|
14072
|
+
(await this.verifyImageUploadOption({
|
|
14073
|
+
imageUrl,
|
|
14074
|
+
filePath,
|
|
14075
|
+
}));
|
|
14076
|
+
(await this.assertOptionVisibility(this.cannedResponseOption)) &&
|
|
14077
|
+
(await this.verifyCannedResponseOption(cannedResponseSuccessMessage));
|
|
14078
|
+
(await this.assertOptionVisibility(this.videoEmbedOption)) &&
|
|
14079
|
+
(await this.verifyVideoEmbedOption(videoUrl));
|
|
14080
|
+
(await this.assertOptionVisibility(this.emojiSelector)) &&
|
|
14081
|
+
(await this.verifyEmojiSelector());
|
|
14082
|
+
dynamicVariables &&
|
|
14083
|
+
(await this.assertOptionVisibility(this.dynamicVariablesButton)) &&
|
|
14084
|
+
(await this.verifyDynamicVariables(dynamicVariables));
|
|
14074
14085
|
};
|
|
14075
14086
|
this.page = page;
|
|
14076
14087
|
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
14077
14088
|
this.t = playwrightI18nextFixture.getI18nInstance().t;
|
|
14078
|
-
this.
|
|
14079
|
-
|
|
14080
|
-
|
|
14081
|
-
this.
|
|
14082
|
-
this.
|
|
14083
|
-
this.
|
|
14084
|
-
this.
|
|
14085
|
-
this.
|
|
14086
|
-
this.
|
|
14087
|
-
this.
|
|
14089
|
+
this.editorWrapper = this.page;
|
|
14090
|
+
if (editorWrapper)
|
|
14091
|
+
this.editorWrapper = editorWrapper;
|
|
14092
|
+
this.paragraphSelector = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.paragraphOption);
|
|
14093
|
+
this.fixedMenuArrowSelector = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.fixedMenuArrow);
|
|
14094
|
+
this.editorLinkButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.linkOption);
|
|
14095
|
+
this.attachmentPreview = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.attachmentPreview);
|
|
14096
|
+
this.editorAttachmentsButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.editorAttachmentsButton);
|
|
14097
|
+
this.imageWrapper = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.imageWrapper);
|
|
14098
|
+
this.imageUploadDeleteButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadDeleteButton);
|
|
14099
|
+
this.imageUploadOption = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.imageUploadOption);
|
|
14100
|
+
this.cannedResponseOption = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.cannedResponseOption);
|
|
14101
|
+
this.videoEmbedOption = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.videoEmbedOption);
|
|
14088
14102
|
this.videoEmbedInput = this.page.getByTestId(NEETO_EDITOR_SELECTORS.videoEmbedInput);
|
|
14089
|
-
this.videoWrapperSelector = this.
|
|
14090
|
-
this.
|
|
14091
|
-
|
|
14092
|
-
|
|
14103
|
+
this.videoWrapperSelector = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.videoWrapper);
|
|
14104
|
+
this.emojiSelector = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.emojiOption);
|
|
14105
|
+
this.moreMenuSelector = this.editorWrapper.getByTestId(COMMON_SELECTORS.dropdownIcon);
|
|
14106
|
+
this.contentField = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.contentField);
|
|
14107
|
+
this.dynamicVariablesButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.dynamicVariablesButton);
|
|
14093
14108
|
}
|
|
14094
14109
|
}
|
|
14095
14110
|
|
|
@@ -14296,8 +14311,10 @@ class TeamMembers {
|
|
|
14296
14311
|
.click();
|
|
14297
14312
|
await this.page.getByTestId(MEMBER_SELECTORS.continueButton).click();
|
|
14298
14313
|
}
|
|
14299
|
-
await
|
|
14300
|
-
|
|
14314
|
+
await test$1.expect(async () => {
|
|
14315
|
+
await this.page.getByTestId(MEMBER_SELECTORS.submitButton).click();
|
|
14316
|
+
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.paneBody)).toBeHidden();
|
|
14317
|
+
}).toPass({ timeout: 20000 });
|
|
14301
14318
|
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
14302
14319
|
await this.neetoPlaywrightUtilities.verifyToast();
|
|
14303
14320
|
};
|
|
@@ -14308,7 +14325,8 @@ class TeamMembers {
|
|
|
14308
14325
|
});
|
|
14309
14326
|
await this.page.getByTestId(MEMBER_SELECTORS.searchTextField).fill(email);
|
|
14310
14327
|
await searchMembers;
|
|
14311
|
-
|
|
14328
|
+
const emailSubstr = email.length > 20 ? email.substring(0, 20) : email;
|
|
14329
|
+
await test$1.expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.searchTermBlock)).toContainText(emailSubstr);
|
|
14312
14330
|
await test$1.expect(this.page.getByRole("cell", { name: email, exact: true })).toBeVisible();
|
|
14313
14331
|
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
14314
14332
|
};
|