@bigbinary/neeto-playwright-commons 1.22.37 → 1.22.39
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 +33 -1
- package/index.cjs.js.map +1 -1
- package/index.d.ts +6 -0
- package/index.js +33 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2547,6 +2547,7 @@ declare class EditorPage {
|
|
|
2547
2547
|
redoSelector: Locator;
|
|
2548
2548
|
undoSelector: Locator;
|
|
2549
2549
|
tableOption: Locator;
|
|
2550
|
+
calloutSelector: Locator;
|
|
2550
2551
|
videoUploadOption: Locator;
|
|
2551
2552
|
todoListSelector: Locator;
|
|
2552
2553
|
filePath: string;
|
|
@@ -2580,6 +2581,7 @@ declare class EditorPage {
|
|
|
2580
2581
|
private verifyVideoUploadOption;
|
|
2581
2582
|
private verifyTodoListSelector;
|
|
2582
2583
|
verifyDynamicVariables: (dynamicVariables: KeyValuePair[]) => Promise<void>;
|
|
2584
|
+
private verifyCalloutSelector;
|
|
2583
2585
|
private buttonsAndVerifications;
|
|
2584
2586
|
/**
|
|
2585
2587
|
*
|
|
@@ -5401,6 +5403,7 @@ declare const NEETO_EDITOR_SELECTORS: {
|
|
|
5401
5403
|
videoEmbedSubmit: string;
|
|
5402
5404
|
videoWrapper: string;
|
|
5403
5405
|
paragraphOption: string;
|
|
5406
|
+
calloutOption: string;
|
|
5404
5407
|
attachmentPreview: string;
|
|
5405
5408
|
imageUploadLinkButton: string;
|
|
5406
5409
|
errorText: string;
|
|
@@ -5414,6 +5417,9 @@ declare const NEETO_EDITOR_SELECTORS: {
|
|
|
5414
5417
|
videoUploadOption: string;
|
|
5415
5418
|
todoListOption: string;
|
|
5416
5419
|
editorMenuWrapper: string;
|
|
5420
|
+
dataEmojiType: (type: string) => string;
|
|
5421
|
+
calloutContent: string;
|
|
5422
|
+
calloutTypeOption: string;
|
|
5417
5423
|
editorMediaUploaderTab: string;
|
|
5418
5424
|
dynamicVariableSelector: (variable: string) => string;
|
|
5419
5425
|
neetoEditorFixedMenuFontSize: string;
|
package/index.js
CHANGED
|
@@ -118,7 +118,7 @@ const PROFILE_LINKS = {
|
|
|
118
118
|
class ApiKeysApi {
|
|
119
119
|
constructor(neetoPlaywrightUtilities) {
|
|
120
120
|
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
121
|
-
this.API_KEYS_BASE_URL = `
|
|
121
|
+
this.API_KEYS_BASE_URL = `neeto_api_keys${BASE_URL}`;
|
|
122
122
|
this.create = (label, type = "general") => this.neetoPlaywrightUtilities.apiRequest({
|
|
123
123
|
url: `${this.API_KEYS_BASE_URL}/api_keys`,
|
|
124
124
|
method: "post",
|
|
@@ -3734,6 +3734,7 @@ const NEETO_EDITOR_SELECTORS = {
|
|
|
3734
3734
|
videoEmbedSubmit: "neeto-editor-embed-cancel",
|
|
3735
3735
|
videoWrapper: "neeto-editor-video-wrapper",
|
|
3736
3736
|
paragraphOption: fixedMenuSelector("font-size-option-body2"),
|
|
3737
|
+
calloutOption: fixedMenuSelector("callout-option"),
|
|
3737
3738
|
attachmentPreview: "ne-attachments-wrapper",
|
|
3738
3739
|
imageUploadLinkButton: "neeto-editor-media-uploader-link-tab",
|
|
3739
3740
|
errorText: "neeto-editor-error-text",
|
|
@@ -3747,6 +3748,11 @@ const NEETO_EDITOR_SELECTORS = {
|
|
|
3747
3748
|
videoUploadOption: optionSelector("video-upload"),
|
|
3748
3749
|
todoListOption: optionSelector("todoList"),
|
|
3749
3750
|
editorMenuWrapper: "neeto-editor-fixed-menu-wrapper",
|
|
3751
|
+
dataEmojiType: (type) => `[data-emoji="${type}"]`,
|
|
3752
|
+
//Use data-cy once https://github.com/neetozone/neeto-editor/issues/1651 is resolved
|
|
3753
|
+
calloutContent: ".callout-content",
|
|
3754
|
+
//Use data-cy once https://github.com/neetozone/neeto-editor/issues/1648 is resolved
|
|
3755
|
+
calloutTypeOption: ".neeto-editor-callout-dropdown__type-option",
|
|
3750
3756
|
editorMediaUploaderTab: "neeto-editor-media-uploader-local-tab",
|
|
3751
3757
|
dynamicVariableSelector: (variable) => `dynamic-variables-list-item-${joinHyphenCase(variable)}`,
|
|
3752
3758
|
neetoEditorFixedMenuFontSize: "neeto-editor-fixed-menu-font-size-option",
|
|
@@ -192859,6 +192865,30 @@ class EditorPage {
|
|
|
192859
192865
|
await expect(this.contentField.getByText(truncate(value, 25))).toBeVisible();
|
|
192860
192866
|
}
|
|
192861
192867
|
};
|
|
192868
|
+
this.verifyCalloutSelector = async (isButtonInMoreMenu) => {
|
|
192869
|
+
isButtonInMoreMenu && (await this.moreMenuSelector.click());
|
|
192870
|
+
const calloutTypes = ["default", "info", "warning", "error", "success"];
|
|
192871
|
+
const calloutContentField = this.contentField.locator(NEETO_EDITOR_SELECTORS.calloutContent);
|
|
192872
|
+
const calloutTypeOption = this.page.locator(NEETO_EDITOR_SELECTORS.calloutTypeOption);
|
|
192873
|
+
await this.moveCursorAtBottom();
|
|
192874
|
+
for (const [index, type] of calloutTypes.entries()) {
|
|
192875
|
+
await this.calloutSelector.click();
|
|
192876
|
+
const calloutType = calloutTypeOption.filter({ hasText: type });
|
|
192877
|
+
await expect(calloutType).toBeVisible({ timeout: 10000 });
|
|
192878
|
+
await calloutType.click();
|
|
192879
|
+
await Promise.all([
|
|
192880
|
+
expect(calloutTypeOption).toBeHidden(),
|
|
192881
|
+
expect(this.contentField.locator(NEETO_EDITOR_SELECTORS.dataEmojiType(type))).toBeVisible(),
|
|
192882
|
+
]);
|
|
192883
|
+
const randomText = faker.lorem.word(10);
|
|
192884
|
+
await this.page.keyboard.type(randomText);
|
|
192885
|
+
// The index is important here as it determines which callout content field to interact with
|
|
192886
|
+
// eslint-disable-next-line playwright/no-nth-methods
|
|
192887
|
+
await expect(calloutContentField.nth(index)).toContainText(randomText);
|
|
192888
|
+
await this.moveCursorAtBottom();
|
|
192889
|
+
}
|
|
192890
|
+
return [{ key: "callout" }];
|
|
192891
|
+
};
|
|
192862
192892
|
this.buttonsAndVerifications = {
|
|
192863
192893
|
"font-size": () => this.verifyFontSize(),
|
|
192864
192894
|
emoji: isButtonInMoreMenu => this.verifyEmojiSelector(isButtonInMoreMenu),
|
|
@@ -192884,6 +192914,7 @@ class EditorPage {
|
|
|
192884
192914
|
undo: isButtonInMoreMenu => this.verifyUndoSelector(isButtonInMoreMenu),
|
|
192885
192915
|
redo: isButtonInMoreMenu => this.verifyRedoSelector(isButtonInMoreMenu),
|
|
192886
192916
|
table: isButtonInMoreMenu => this.verifyTableSelector(isButtonInMoreMenu),
|
|
192917
|
+
callout: isButtonInMoreMenu => this.verifyCalloutSelector(isButtonInMoreMenu),
|
|
192887
192918
|
"video-upload": isButtonInMoreMenu => this.verifyVideoUploadOption({
|
|
192888
192919
|
filePath: this.videoPath,
|
|
192889
192920
|
isButtonInMoreMenu,
|
|
@@ -192960,6 +192991,7 @@ class EditorPage {
|
|
|
192960
192991
|
.getByTestId(COMMON_SELECTORS.dropdownIcon);
|
|
192961
192992
|
this.contentField = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.contentField);
|
|
192962
192993
|
this.dynamicVariablesButton = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.dynamicVariablesButton);
|
|
192994
|
+
this.calloutSelector = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.calloutOption);
|
|
192963
192995
|
this.undoSelector = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.undoOption);
|
|
192964
192996
|
this.redoSelector = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.redoOption);
|
|
192965
192997
|
this.tableOption = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.tableOption);
|