@bigbinary/neeto-playwright-commons 1.23.7 → 1.23.8
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 +31 -38
- package/index.cjs.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +31 -38
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1590,6 +1590,7 @@ declare class EmbedBase {
|
|
|
1590
1590
|
customizationOptions
|
|
1591
1591
|
}: VerifyInlineCustomizationParams) => Promise<void>;
|
|
1592
1592
|
backToEmbedSelection: () => Promise<void>;
|
|
1593
|
+
private pickColor;
|
|
1593
1594
|
/**
|
|
1594
1595
|
*
|
|
1595
1596
|
* Verifies floating popup customization of embedded content. It takes the following parameters:
|
package/index.js
CHANGED
|
@@ -117747,46 +117747,42 @@ class EmbedBase {
|
|
|
117747
117747
|
await this.backToEmbedSelection();
|
|
117748
117748
|
};
|
|
117749
117749
|
this.backToEmbedSelection = () => this.page.getByTestId(EMBED_SELECTORS.backToEmbedSelectionButton).click();
|
|
117750
|
+
this.pickColor = async (colorHex, colorPickerLocator) => {
|
|
117751
|
+
const textbox = this.page
|
|
117752
|
+
.getByTestId(EMBED_SELECTORS.colorpickerEditableInput)
|
|
117753
|
+
.getByTestId(EMBED_SELECTORS.colorpickerEditableInputTextbox);
|
|
117754
|
+
await expect(async () => {
|
|
117755
|
+
(await textbox.isHidden()) && (await colorPickerLocator.click());
|
|
117756
|
+
await textbox.fill(colorHex);
|
|
117757
|
+
await expect(textbox).toHaveValue(colorHex);
|
|
117758
|
+
}).toPass({ timeout: 25000 });
|
|
117759
|
+
// This additional click is to close the previously opened color picker.
|
|
117760
|
+
await colorPickerLocator.click();
|
|
117761
|
+
await expect(textbox).toBeHidden();
|
|
117762
|
+
};
|
|
117750
117763
|
this.verifyFloatingPopupCustomization = async (customizationOptions) => {
|
|
117764
|
+
const selectContainer = this.page.getByTestId(EMBED_SELECTORS.buttonPositionSelectContainer);
|
|
117751
117765
|
await this.page
|
|
117752
117766
|
.getByTestId(EMBED_SELECTORS.buttonTextInput)
|
|
117753
117767
|
.fill(customizationOptions.buttonText);
|
|
117754
|
-
await
|
|
117755
|
-
.getByTestId(EMBED_SELECTORS.buttonPositionSelectContainer)
|
|
117756
|
-
.click();
|
|
117768
|
+
await selectContainer.click();
|
|
117757
117769
|
await this.page
|
|
117758
117770
|
.getByTestId(EMBED_SELECTORS.buttonPositionSelectMenu)
|
|
117759
117771
|
.getByText(customizationOptions.buttonPosition)
|
|
117760
117772
|
.click();
|
|
117761
|
-
await expect(
|
|
117762
|
-
|
|
117763
|
-
|
|
117764
|
-
.getByTestId(EMBED_SELECTORS.colorPickerTarget)
|
|
117765
|
-
|
|
117766
|
-
|
|
117767
|
-
.getByTestId(EMBED_SELECTORS.
|
|
117768
|
-
.getByTestId(EMBED_SELECTORS.colorpickerEditableInputTextbox)
|
|
117769
|
-
.fill(customizationOptions.buttonColorHex);
|
|
117770
|
-
const buttonTextColorLabel = this.page.getByTestId(EMBED_SELECTORS.buttonTextColorLabel);
|
|
117771
|
-
// This additional click is to close the previously opened color picker for buttonColor.
|
|
117772
|
-
await buttonTextColorLabel
|
|
117773
|
-
.getByTestId(EMBED_SELECTORS.colorPickerTarget)
|
|
117774
|
-
.click();
|
|
117775
|
-
await buttonTextColorLabel
|
|
117776
|
-
.getByTestId(EMBED_SELECTORS.colorPickerTarget)
|
|
117777
|
-
.click();
|
|
117778
|
-
await this.page
|
|
117779
|
-
.getByTestId(EMBED_SELECTORS.colorpickerEditableInput)
|
|
117780
|
-
.getByTestId(EMBED_SELECTORS.colorpickerEditableInputTextbox)
|
|
117781
|
-
.fill(customizationOptions.buttonTextColorHex);
|
|
117773
|
+
await expect(selectContainer).toContainText(customizationOptions.buttonPosition);
|
|
117774
|
+
await this.pickColor(customizationOptions.buttonColorHex, this.page
|
|
117775
|
+
.getByTestId(EMBED_SELECTORS.buttonColorLabel)
|
|
117776
|
+
.getByTestId(EMBED_SELECTORS.colorPickerTarget));
|
|
117777
|
+
await this.pickColor(customizationOptions.buttonTextColorHex, this.page
|
|
117778
|
+
.getByTestId(EMBED_SELECTORS.buttonTextColorLabel)
|
|
117779
|
+
.getByTestId(EMBED_SELECTORS.colorPickerTarget));
|
|
117782
117780
|
const showIconCheckbox = this.page.getByTestId(EMBED_SELECTORS.showIconCheckbox);
|
|
117783
|
-
if (customizationOptions.showIcon
|
|
117784
|
-
|
|
117785
|
-
|
|
117786
|
-
|
|
117787
|
-
|
|
117788
|
-
await showIconCheckbox.uncheck();
|
|
117789
|
-
await expect(this.codeBlock).toContainText("showIcon: false");
|
|
117781
|
+
if (isPresent(customizationOptions.showIcon)) {
|
|
117782
|
+
const shouldShowIcon = customizationOptions.showIcon;
|
|
117783
|
+
const showIconAction = shouldShowIcon ? "check" : "uncheck";
|
|
117784
|
+
await showIconCheckbox[showIconAction]();
|
|
117785
|
+
await expect(this.codeBlock).toContainText(`showIcon: ${shouldShowIcon}`);
|
|
117790
117786
|
}
|
|
117791
117787
|
await this.expectMultipleTextsInCodeblock([
|
|
117792
117788
|
`btnColor: "${customizationOptions.buttonColorHex}"`,
|
|
@@ -117806,13 +117802,10 @@ class EmbedBase {
|
|
|
117806
117802
|
expect(floatingButton).toHaveCSS("background-color", hexToRGB(customizationOptions.buttonColorHex)),
|
|
117807
117803
|
expect(floatingButton).toHaveCSS("color", hexToRGB(customizationOptions.buttonTextColorHex)),
|
|
117808
117804
|
]);
|
|
117809
|
-
|
|
117810
|
-
|
|
117811
|
-
|
|
117812
|
-
|
|
117813
|
-
else if (customizationOptions.showIcon === false) {
|
|
117814
|
-
await expect(floatingButtonIcon).toBeHidden();
|
|
117815
|
-
}
|
|
117805
|
+
isPresent(customizationOptions.showIcon) &&
|
|
117806
|
+
(await expect(floatingButton.locator("svg")).toBeVisible({
|
|
117807
|
+
visible: customizationOptions.showIcon,
|
|
117808
|
+
}));
|
|
117816
117809
|
await this.backToEmbedSelection();
|
|
117817
117810
|
};
|
|
117818
117811
|
this.verifyElementClickCustomization = async (customizationOptions) => {
|