@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.cjs.js
CHANGED
|
@@ -117768,46 +117768,42 @@ class EmbedBase {
|
|
|
117768
117768
|
await this.backToEmbedSelection();
|
|
117769
117769
|
};
|
|
117770
117770
|
this.backToEmbedSelection = () => this.page.getByTestId(EMBED_SELECTORS.backToEmbedSelectionButton).click();
|
|
117771
|
+
this.pickColor = async (colorHex, colorPickerLocator) => {
|
|
117772
|
+
const textbox = this.page
|
|
117773
|
+
.getByTestId(EMBED_SELECTORS.colorpickerEditableInput)
|
|
117774
|
+
.getByTestId(EMBED_SELECTORS.colorpickerEditableInputTextbox);
|
|
117775
|
+
await test.expect(async () => {
|
|
117776
|
+
(await textbox.isHidden()) && (await colorPickerLocator.click());
|
|
117777
|
+
await textbox.fill(colorHex);
|
|
117778
|
+
await test.expect(textbox).toHaveValue(colorHex);
|
|
117779
|
+
}).toPass({ timeout: 25000 });
|
|
117780
|
+
// This additional click is to close the previously opened color picker.
|
|
117781
|
+
await colorPickerLocator.click();
|
|
117782
|
+
await test.expect(textbox).toBeHidden();
|
|
117783
|
+
};
|
|
117771
117784
|
this.verifyFloatingPopupCustomization = async (customizationOptions) => {
|
|
117785
|
+
const selectContainer = this.page.getByTestId(EMBED_SELECTORS.buttonPositionSelectContainer);
|
|
117772
117786
|
await this.page
|
|
117773
117787
|
.getByTestId(EMBED_SELECTORS.buttonTextInput)
|
|
117774
117788
|
.fill(customizationOptions.buttonText);
|
|
117775
|
-
await
|
|
117776
|
-
.getByTestId(EMBED_SELECTORS.buttonPositionSelectContainer)
|
|
117777
|
-
.click();
|
|
117789
|
+
await selectContainer.click();
|
|
117778
117790
|
await this.page
|
|
117779
117791
|
.getByTestId(EMBED_SELECTORS.buttonPositionSelectMenu)
|
|
117780
117792
|
.getByText(customizationOptions.buttonPosition)
|
|
117781
117793
|
.click();
|
|
117782
|
-
await test.expect(
|
|
117783
|
-
|
|
117784
|
-
|
|
117785
|
-
.getByTestId(EMBED_SELECTORS.colorPickerTarget)
|
|
117786
|
-
|
|
117787
|
-
|
|
117788
|
-
.getByTestId(EMBED_SELECTORS.
|
|
117789
|
-
.getByTestId(EMBED_SELECTORS.colorpickerEditableInputTextbox)
|
|
117790
|
-
.fill(customizationOptions.buttonColorHex);
|
|
117791
|
-
const buttonTextColorLabel = this.page.getByTestId(EMBED_SELECTORS.buttonTextColorLabel);
|
|
117792
|
-
// This additional click is to close the previously opened color picker for buttonColor.
|
|
117793
|
-
await buttonTextColorLabel
|
|
117794
|
-
.getByTestId(EMBED_SELECTORS.colorPickerTarget)
|
|
117795
|
-
.click();
|
|
117796
|
-
await buttonTextColorLabel
|
|
117797
|
-
.getByTestId(EMBED_SELECTORS.colorPickerTarget)
|
|
117798
|
-
.click();
|
|
117799
|
-
await this.page
|
|
117800
|
-
.getByTestId(EMBED_SELECTORS.colorpickerEditableInput)
|
|
117801
|
-
.getByTestId(EMBED_SELECTORS.colorpickerEditableInputTextbox)
|
|
117802
|
-
.fill(customizationOptions.buttonTextColorHex);
|
|
117794
|
+
await test.expect(selectContainer).toContainText(customizationOptions.buttonPosition);
|
|
117795
|
+
await this.pickColor(customizationOptions.buttonColorHex, this.page
|
|
117796
|
+
.getByTestId(EMBED_SELECTORS.buttonColorLabel)
|
|
117797
|
+
.getByTestId(EMBED_SELECTORS.colorPickerTarget));
|
|
117798
|
+
await this.pickColor(customizationOptions.buttonTextColorHex, this.page
|
|
117799
|
+
.getByTestId(EMBED_SELECTORS.buttonTextColorLabel)
|
|
117800
|
+
.getByTestId(EMBED_SELECTORS.colorPickerTarget));
|
|
117803
117801
|
const showIconCheckbox = this.page.getByTestId(EMBED_SELECTORS.showIconCheckbox);
|
|
117804
|
-
if (customizationOptions.showIcon
|
|
117805
|
-
|
|
117806
|
-
|
|
117807
|
-
|
|
117808
|
-
|
|
117809
|
-
await showIconCheckbox.uncheck();
|
|
117810
|
-
await test.expect(this.codeBlock).toContainText("showIcon: false");
|
|
117802
|
+
if (neetoCist.isPresent(customizationOptions.showIcon)) {
|
|
117803
|
+
const shouldShowIcon = customizationOptions.showIcon;
|
|
117804
|
+
const showIconAction = shouldShowIcon ? "check" : "uncheck";
|
|
117805
|
+
await showIconCheckbox[showIconAction]();
|
|
117806
|
+
await test.expect(this.codeBlock).toContainText(`showIcon: ${shouldShowIcon}`);
|
|
117811
117807
|
}
|
|
117812
117808
|
await this.expectMultipleTextsInCodeblock([
|
|
117813
117809
|
`btnColor: "${customizationOptions.buttonColorHex}"`,
|
|
@@ -117827,13 +117823,10 @@ class EmbedBase {
|
|
|
117827
117823
|
test.expect(floatingButton).toHaveCSS("background-color", hexToRGB(customizationOptions.buttonColorHex)),
|
|
117828
117824
|
test.expect(floatingButton).toHaveCSS("color", hexToRGB(customizationOptions.buttonTextColorHex)),
|
|
117829
117825
|
]);
|
|
117830
|
-
|
|
117831
|
-
|
|
117832
|
-
|
|
117833
|
-
|
|
117834
|
-
else if (customizationOptions.showIcon === false) {
|
|
117835
|
-
await test.expect(floatingButtonIcon).toBeHidden();
|
|
117836
|
-
}
|
|
117826
|
+
neetoCist.isPresent(customizationOptions.showIcon) &&
|
|
117827
|
+
(await test.expect(floatingButton.locator("svg")).toBeVisible({
|
|
117828
|
+
visible: customizationOptions.showIcon,
|
|
117829
|
+
}));
|
|
117837
117830
|
await this.backToEmbedSelection();
|
|
117838
117831
|
};
|
|
117839
117832
|
this.verifyElementClickCustomization = async (customizationOptions) => {
|