@bigbinary/neeto-playwright-commons 1.10.1 → 1.10.3
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 +238 -222
- package/index.cjs.js.map +1 -1
- package/index.d.ts +50 -10
- package/index.js +238 -222
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -375,6 +375,7 @@ const COMMON_SELECTORS = {
|
|
|
375
375
|
nuiRadioLabel: "nui-radio-label",
|
|
376
376
|
submitButton: "submit-button",
|
|
377
377
|
tableRow: ".ant-table-row",
|
|
378
|
+
navigationHeaderLeftBlock: "navigation-header-left-block",
|
|
378
379
|
};
|
|
379
380
|
|
|
380
381
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -13786,49 +13787,54 @@ const LIST_MODIFIER_TAGS = {
|
|
|
13786
13787
|
orderedListOption: "ol",
|
|
13787
13788
|
};
|
|
13788
13789
|
|
|
13790
|
+
const optionSelector = (option) => `neeto-editor-fixed-menu-${option}-option`;
|
|
13791
|
+
const fixedMenuSelector = (selector) => `neeto-editor-fixed-menu-${selector}`;
|
|
13792
|
+
|
|
13789
13793
|
const NEETO_EDITOR_SELECTORS = {
|
|
13790
|
-
boldOption: "
|
|
13791
|
-
italicOption: "
|
|
13792
|
-
underlineOption: "
|
|
13793
|
-
strikeOption: "
|
|
13794
|
-
codeBlockOption: "
|
|
13795
|
-
highlightOption: "
|
|
13796
|
-
|
|
13797
|
-
|
|
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"),
|
|
13798
13804
|
commandList: (index) => `neeto-editor-command-list-item-${index}`,
|
|
13799
13805
|
imageUploadUrlSubmitButton: "neeto-editor-media-upload-url-submit",
|
|
13800
13806
|
imageUploadUrlInputTextField: "neeto-editor-media-upload-url-input",
|
|
13801
13807
|
uploadInput: "neeto-editor-media-uploader-input",
|
|
13802
|
-
editorMenuBarWrapper: "
|
|
13803
|
-
undoOption: "
|
|
13804
|
-
redoOption: "
|
|
13808
|
+
editorMenuBarWrapper: fixedMenuSelector("wrapper"),
|
|
13809
|
+
undoOption: optionSelector("undo"),
|
|
13810
|
+
redoOption: optionSelector("redo"),
|
|
13805
13811
|
imageWrapper: "neeto-editor-image-wrapper",
|
|
13806
13812
|
contentField: "neeto-editor-content",
|
|
13807
|
-
addLinkButton: "
|
|
13813
|
+
addLinkButton: optionSelector("link"),
|
|
13808
13814
|
addLinkTextField: "neeto-editor-add-link-text-input",
|
|
13809
13815
|
addURLTextField: "neeto-editor-add-link-url-input",
|
|
13810
13816
|
submitLinkButton: "neeto-editor-add-link",
|
|
13811
13817
|
fontSizeDropdown: (currentOption) => `${joinHyphenCase(currentOption)}-dropdown-icon`,
|
|
13812
|
-
fixedMenuArrow: "
|
|
13813
|
-
cannedResponseOption: "
|
|
13818
|
+
fixedMenuArrow: fixedMenuSelector("arrow"),
|
|
13819
|
+
cannedResponseOption: optionSelector("canned-responses"),
|
|
13814
13820
|
cannedResponseSelectContainer: "select-a-canned-response-select-container",
|
|
13815
|
-
fixedMenuWrapper: "
|
|
13816
|
-
linkOption: "
|
|
13821
|
+
fixedMenuWrapper: optionSelector("wrapper"),
|
|
13822
|
+
linkOption: optionSelector("link"),
|
|
13817
13823
|
addLinkUrlInput: "neeto-editor-add-link-url-input",
|
|
13818
13824
|
addLinkDoneButton: "neeto-editor-add-link",
|
|
13819
13825
|
unlinkButton: "neeto-editor-link-popover-unlink",
|
|
13820
|
-
editorAttachmentsButton: "
|
|
13826
|
+
editorAttachmentsButton: optionSelector("attachments"),
|
|
13821
13827
|
attachmentPreviewDeleteButton: "neeto-editor-preview-delete-button",
|
|
13822
|
-
imageUploadOption: "
|
|
13828
|
+
imageUploadOption: optionSelector("image-upload"),
|
|
13823
13829
|
imageUploadLinkInput: "neeto-editor-media-upload-url-input",
|
|
13824
13830
|
imageUploadButton: "neeto-editor-media-uploader-dnd",
|
|
13825
13831
|
imageUploadLinkSubmitButton: "neeto-editor-media-upload-url-submit",
|
|
13826
13832
|
applyButton: "apply-button",
|
|
13827
|
-
videoEmbedOption: "
|
|
13833
|
+
videoEmbedOption: optionSelector("video-embed"),
|
|
13828
13834
|
videoEmbedInput: "neeto-editor-embed-input",
|
|
13829
13835
|
videoEmbedSubmit: "neeto-editor-embed-cancel",
|
|
13830
13836
|
videoWrapper: "neeto-editor-video-wrapper",
|
|
13831
|
-
paragraphOption: "
|
|
13837
|
+
paragraphOption: fixedMenuSelector("font-size-option-body2"),
|
|
13832
13838
|
attachmentPreview: "ne-attachments-wrapper",
|
|
13833
13839
|
imageUploadLinkButton: "neeto-editor-media-uploader-link-tab",
|
|
13834
13840
|
errorText: "neeto-editor-error-text",
|
|
@@ -13839,256 +13845,266 @@ const NEETO_EDITOR_SELECTORS = {
|
|
|
13839
13845
|
dynamicVariableSelector: (variable) => `dynamic-variables-list-item-${neetoCist.hyphenate(variable)}`,
|
|
13840
13846
|
};
|
|
13841
13847
|
const NEETO_TEXT_MODIFIER_SELECTORS = {
|
|
13842
|
-
strikeOption: "
|
|
13843
|
-
underlineOption: "
|
|
13844
|
-
highlightOption: "
|
|
13848
|
+
strikeOption: optionSelector("strike"),
|
|
13849
|
+
underlineOption: optionSelector("underline"),
|
|
13850
|
+
highlightOption: optionSelector("highlight"),
|
|
13845
13851
|
};
|
|
13846
13852
|
const TEXT_MODIFIER_SELECTORS = {
|
|
13847
|
-
boldOption: "
|
|
13848
|
-
italicsOption: "
|
|
13849
|
-
codeOption: "
|
|
13850
|
-
blockquoteOption: "
|
|
13851
|
-
codeblockOption: "
|
|
13853
|
+
boldOption: optionSelector("bold"),
|
|
13854
|
+
italicsOption: optionSelector("italic"),
|
|
13855
|
+
codeOption: optionSelector("code"),
|
|
13856
|
+
blockquoteOption: optionSelector("blockquote"),
|
|
13857
|
+
codeblockOption: optionSelector("codeBlock"),
|
|
13852
13858
|
};
|
|
13853
13859
|
const LIST_MODIFIER_SELECTORS = {
|
|
13854
|
-
bulletListOption: "
|
|
13855
|
-
orderedListOption: "
|
|
13860
|
+
bulletListOption: optionSelector("bulletList"),
|
|
13861
|
+
orderedListOption: optionSelector("orderedList"),
|
|
13856
13862
|
};
|
|
13857
13863
|
const FONT_SIZE_SELECTORS = {
|
|
13858
|
-
h1: "
|
|
13859
|
-
h2: "
|
|
13860
|
-
h3: "
|
|
13861
|
-
h4: "
|
|
13862
|
-
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"),
|
|
13863
13869
|
};
|
|
13864
13870
|
|
|
13865
|
-
/* eslint-disable playwright/no-nth-methods */
|
|
13866
13871
|
class EditorPage {
|
|
13867
|
-
constructor(page, neetoPlaywrightUtilities) {
|
|
13868
|
-
this.
|
|
13869
|
-
if (
|
|
13870
|
-
|
|
13871
|
-
await
|
|
13872
|
-
.
|
|
13873
|
-
|
|
13874
|
-
|
|
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
|
|
13875
13882
|
.getByTestId(NEETO_EDITOR_SELECTORS.fontSizeDropdown(defaultFontSizeOption))
|
|
13876
13883
|
.click();
|
|
13877
13884
|
const fontSize = Object.keys(FONT_SIZE_SELECTORS);
|
|
13878
13885
|
for (const font of fontSize) {
|
|
13879
13886
|
const fontKey = font;
|
|
13880
|
-
await editorWrapper
|
|
13881
|
-
|
|
13882
|
-
.
|
|
13883
|
-
|
|
13884
|
-
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
|
|
13885
13892
|
.getByTestId(NEETO_EDITOR_SELECTORS.fontSizeDropdown(EXPANDED_FONT_SIZE[fontKey]))
|
|
13886
13893
|
.click();
|
|
13887
13894
|
}
|
|
13888
|
-
|
|
13889
|
-
|
|
13890
|
-
const paragraphRole = DESCRIPTION_EDITOR_TEXTS.paragraphOption;
|
|
13891
|
-
await test$1.expect(editorWrapper
|
|
13892
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
13893
|
-
.getByRole(paragraphRole)).toBeVisible();
|
|
13894
|
-
}
|
|
13895
|
-
(await this.fixedMenuArrowSelector.isVisible()) &&
|
|
13896
|
-
(await this.fixedMenuArrowSelector.click());
|
|
13897
|
-
await editorWrapper.getByText(text).click({ clickCount: 3 });
|
|
13895
|
+
};
|
|
13896
|
+
this.verifyTextModifiers = async () => {
|
|
13898
13897
|
const textModifier = Object.keys(TEXT_MODIFIER_SELECTORS);
|
|
13899
13898
|
for (const modifier of textModifier) {
|
|
13900
13899
|
const modifierKey = modifier;
|
|
13901
13900
|
const textModifierRole = TEXT_MODIFIER_ROLES[modifierKey];
|
|
13902
|
-
const textModifierSelector = editorWrapper.getByTestId(TEXT_MODIFIER_SELECTORS[modifierKey]);
|
|
13903
|
-
if (await
|
|
13901
|
+
const textModifierSelector = this.editorWrapper.getByTestId(TEXT_MODIFIER_SELECTORS[modifierKey]);
|
|
13902
|
+
if (await this.assertOptionVisibility(textModifierSelector)) {
|
|
13904
13903
|
await textModifierSelector.click();
|
|
13905
|
-
await test$1.expect(
|
|
13906
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
13907
|
-
.getByRole(textModifierRole)).toBeVisible();
|
|
13904
|
+
await test$1.expect(this.contentField.getByRole(textModifierRole)).toBeVisible();
|
|
13908
13905
|
await textModifierSelector.click();
|
|
13909
13906
|
}
|
|
13910
13907
|
}
|
|
13908
|
+
};
|
|
13909
|
+
this.verifyTextDeskModifier = async () => {
|
|
13911
13910
|
const textDeskModifier = Object.keys(NEETO_TEXT_MODIFIER_SELECTORS);
|
|
13912
13911
|
for (const modifier of textDeskModifier) {
|
|
13913
13912
|
const modifierKey = modifier;
|
|
13914
|
-
const textModifierSelector = editorWrapper.getByTestId(NEETO_TEXT_MODIFIER_SELECTORS[modifierKey]);
|
|
13915
|
-
if (await
|
|
13913
|
+
const textModifierSelector = this.editorWrapper.getByTestId(NEETO_TEXT_MODIFIER_SELECTORS[modifierKey]);
|
|
13914
|
+
if (await this.assertOptionVisibility(textModifierSelector)) {
|
|
13916
13915
|
await textModifierSelector.click();
|
|
13917
|
-
await test$1.expect(
|
|
13918
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
13919
|
-
.locator(TEXT_MODIFIER_TAGS[modifierKey])).toBeVisible();
|
|
13916
|
+
await test$1.expect(this.contentField.locator(TEXT_MODIFIER_TAGS[modifierKey])).toBeVisible();
|
|
13920
13917
|
await textModifierSelector.click();
|
|
13921
13918
|
}
|
|
13922
13919
|
}
|
|
13920
|
+
};
|
|
13921
|
+
this.verifyListModifiers = async () => {
|
|
13923
13922
|
const listModifier = Object.keys(LIST_MODIFIER_SELECTORS);
|
|
13924
13923
|
for (const modifier of listModifier) {
|
|
13925
13924
|
const modifierKey = modifier;
|
|
13926
|
-
const listModifierSelector = editorWrapper.getByTestId(LIST_MODIFIER_SELECTORS[modifierKey]);
|
|
13927
|
-
if (await
|
|
13925
|
+
const listModifierSelector = this.editorWrapper.getByTestId(LIST_MODIFIER_SELECTORS[modifierKey]);
|
|
13926
|
+
if (await this.assertOptionVisibility(listModifierSelector)) {
|
|
13928
13927
|
await listModifierSelector.click();
|
|
13929
|
-
await test$1.expect(
|
|
13930
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
13931
|
-
.locator(LIST_MODIFIER_TAGS[modifierKey])).toBeVisible();
|
|
13928
|
+
await test$1.expect(this.contentField.locator(LIST_MODIFIER_TAGS[modifierKey])).toBeVisible();
|
|
13932
13929
|
await listModifierSelector.click();
|
|
13933
13930
|
}
|
|
13934
13931
|
}
|
|
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
|
-
|
|
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
|
-
|
|
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();
|
|
14042
14047
|
await this.page
|
|
14043
|
-
.
|
|
14048
|
+
.getByTestId(NEETO_EDITOR_SELECTORS.dynamicVariableSelector(dynamicVariable))
|
|
14044
14049
|
.click();
|
|
14045
|
-
await test$1.expect(this.
|
|
14046
|
-
timeout: 10000,
|
|
14047
|
-
});
|
|
14048
|
-
await this.page
|
|
14049
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.emojiContainer)
|
|
14050
|
-
.getByPlaceholder(DESCRIPTION_EDITOR_TEXTS.search)
|
|
14051
|
-
.fill(EMOJI_LABEL);
|
|
14052
|
-
await this.page.keyboard.press("Enter");
|
|
14053
|
-
await test$1.expect(editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.contentField)).toContainText("👍");
|
|
14054
|
-
await this.page.keyboard.press("Escape");
|
|
14050
|
+
await test$1.expect(this.contentField.getByText(dynamicVariable)).toBeVisible();
|
|
14055
14051
|
}
|
|
14056
|
-
|
|
14057
|
-
|
|
14058
|
-
|
|
14059
|
-
|
|
14060
|
-
|
|
14061
|
-
|
|
14062
|
-
|
|
14063
|
-
|
|
14064
|
-
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.dropdownContainer)).toBeVisible();
|
|
14065
|
-
await this.page
|
|
14066
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.dynamicVariableSelector(dynamicVariable))
|
|
14067
|
-
.click();
|
|
14068
|
-
await test$1.expect(editorWrapper
|
|
14069
|
-
.getByTestId(NEETO_EDITOR_SELECTORS.contentField)
|
|
14070
|
-
.getByText(dynamicVariable)).toBeVisible();
|
|
14071
|
-
}
|
|
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();
|
|
14072
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));
|
|
14073
14085
|
};
|
|
14074
14086
|
this.page = page;
|
|
14075
14087
|
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
14076
14088
|
this.t = playwrightI18nextFixture.getI18nInstance().t;
|
|
14077
|
-
this.
|
|
14078
|
-
|
|
14079
|
-
|
|
14080
|
-
this.
|
|
14081
|
-
this.
|
|
14082
|
-
this.
|
|
14083
|
-
this.
|
|
14084
|
-
this.
|
|
14085
|
-
this.
|
|
14086
|
-
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);
|
|
14087
14102
|
this.videoEmbedInput = this.page.getByTestId(NEETO_EDITOR_SELECTORS.videoEmbedInput);
|
|
14088
|
-
this.videoWrapperSelector = this.
|
|
14089
|
-
this.
|
|
14090
|
-
|
|
14091
|
-
|
|
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);
|
|
14092
14108
|
}
|
|
14093
14109
|
}
|
|
14094
14110
|
|