@bigbinary/neeto-playwright-commons 1.23.6 → 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 +55 -60
- package/index.cjs.js.map +1 -1
- package/index.d.ts +2 -0
- package/index.js +55 -60
- 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) => {
|
|
@@ -117887,6 +117880,7 @@ const SLACK_WEB_TEXTS = {
|
|
|
117887
117880
|
deleteChannel: "Delete channel",
|
|
117888
117881
|
};
|
|
117889
117882
|
const ZAPIER_WEB_TEXTS = {
|
|
117883
|
+
create: "Create",
|
|
117890
117884
|
account: "Account",
|
|
117891
117885
|
email: "Email",
|
|
117892
117886
|
continue: "Continue",
|
|
@@ -120904,9 +120898,7 @@ class ZapierPage extends IntegrationBase {
|
|
|
120904
120898
|
await apiKeyBox.click();
|
|
120905
120899
|
await apiKeyBox.pressSequentially(zapierApiKey, { delay: 100 });
|
|
120906
120900
|
await signInPage
|
|
120907
|
-
.getByRole("button", {
|
|
120908
|
-
name: RegExp(ZAPIER_WEB_TEXTS.yesContinueTo),
|
|
120909
|
-
})
|
|
120901
|
+
.getByRole("button", { name: RegExp(ZAPIER_WEB_TEXTS.yesContinueTo) })
|
|
120910
120902
|
.click();
|
|
120911
120903
|
await this.continueButton.click({ timeout: 30000 });
|
|
120912
120904
|
await test.expect(this.zapierWebPage
|
|
@@ -120916,17 +120908,20 @@ class ZapierPage extends IntegrationBase {
|
|
|
120916
120908
|
const testTriggerButton = this.zapierWebPage.getByRole("button", {
|
|
120917
120909
|
name: ZAPIER_WEB_TEXTS.testTrigger,
|
|
120918
120910
|
});
|
|
120919
|
-
await test.expect(this.zapierWebPage.locator(ZAPIER_SELECTORS.spinner)).
|
|
120920
|
-
timeout: 25000,
|
|
120921
|
-
});
|
|
120922
|
-
await testTriggerButton.click();
|
|
120923
|
-
await test.expect(this.zapierWebPage.getByText(ZAPIER_WEB_TEXTS.testCurrentlyInQueue)).toBeHidden({ timeout: 20000 });
|
|
120924
|
-
await test.expect(this.zapierWebPage.getByLabel(ZAPIER_WEB_TEXTS.statusLabel, {
|
|
120925
|
-
exact: true,
|
|
120926
|
-
})).toBeVisible({ timeout: 10000 });
|
|
120911
|
+
await test.expect(this.zapierWebPage.locator(ZAPIER_SELECTORS.spinner)).toHaveCount(0, { timeout: 30000 });
|
|
120927
120912
|
const continueWithRecordBtn = this.zapierWebPage.getByRole("button", {
|
|
120928
120913
|
name: ZAPIER_WEB_TEXTS.continueWithSelectedRecord,
|
|
120929
120914
|
});
|
|
120915
|
+
await test.expect(testTriggerButton.or(continueWithRecordBtn)).toBeVisible({
|
|
120916
|
+
timeout: 30000,
|
|
120917
|
+
});
|
|
120918
|
+
if (await testTriggerButton.isVisible()) {
|
|
120919
|
+
await testTriggerButton.click();
|
|
120920
|
+
await test.expect(this.zapierWebPage.getByText(ZAPIER_WEB_TEXTS.testCurrentlyInQueue)).toBeHidden({ timeout: 20000 });
|
|
120921
|
+
await test.expect(this.zapierWebPage.getByLabel(ZAPIER_WEB_TEXTS.statusLabel, {
|
|
120922
|
+
exact: true,
|
|
120923
|
+
})).toBeVisible({ timeout: 10000 });
|
|
120924
|
+
}
|
|
120930
120925
|
await continueWithRecordBtn.click({ timeout: 30000 });
|
|
120931
120926
|
await test.expect(continueWithRecordBtn).toBeHidden({ timeout: 15000 });
|
|
120932
120927
|
await this.continueButton.click({ timeout: 20000 });
|
|
@@ -120970,18 +120965,20 @@ class ZapierPage extends IntegrationBase {
|
|
|
120970
120965
|
.click();
|
|
120971
120966
|
}).toPass({ timeout: 40000 });
|
|
120972
120967
|
}
|
|
120973
|
-
await test.expect(connectionLocator).toHaveCount(0, {
|
|
120974
|
-
timeout: 10000,
|
|
120975
|
-
});
|
|
120968
|
+
await test.expect(connectionLocator).toHaveCount(0, { timeout: 10000 });
|
|
120976
120969
|
};
|
|
120977
120970
|
this.verifyZapIsTriggered = ({ productName, submittedEmail, zapTriggeredAfter, timeout = 2 * 60000, }) => this.mailerUtils.findMessage({ to: ZAPIER_TEST_EMAIL(productName), body: submittedEmail }, { timeout, receivedAfter: zapTriggeredAfter });
|
|
120978
120971
|
this.skipIfTaskLimitIsExhausted = async () => {
|
|
120979
|
-
var _a;
|
|
120980
120972
|
// Zapier provides 100 free task limit for free account; skip test if it's exhausted
|
|
120981
|
-
|
|
120982
|
-
|
|
120983
|
-
});
|
|
120984
|
-
await test.expect(
|
|
120973
|
+
var _a;
|
|
120974
|
+
const universalSidebar = this.zapierWebPage.locator(ZAPIER_SELECTORS.universalSidebar);
|
|
120975
|
+
await test.expect(universalSidebar).toBeVisible({ timeout: 30000 });
|
|
120976
|
+
await test.expect(async () => {
|
|
120977
|
+
await universalSidebar
|
|
120978
|
+
.getByRole("button", { name: ZAPIER_WEB_TEXTS.create })
|
|
120979
|
+
.hover();
|
|
120980
|
+
await test.expect(this.zapierWebPage.locator(ZAPIER_SELECTORS.sidebarFooter)).toBeVisible();
|
|
120981
|
+
}).toPass({ timeout: 30000 });
|
|
120985
120982
|
if (await this.zapierWebPage
|
|
120986
120983
|
.getByText(RegExp(ZAPIER_WEB_TEXTS.trialEndsRegExp))
|
|
120987
120984
|
.isVisible()) {
|
|
@@ -121024,9 +121021,7 @@ class ZapierPage extends IntegrationBase {
|
|
|
121024
121021
|
await this.page
|
|
121025
121022
|
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
121026
121023
|
.click();
|
|
121027
|
-
await this.neetoPlaywrightUtilities.verifyToast({
|
|
121028
|
-
message: toastMessage,
|
|
121029
|
-
});
|
|
121024
|
+
await this.neetoPlaywrightUtilities.verifyToast({ message: toastMessage });
|
|
121030
121025
|
await this.verifyIntegrationStatus("disconnected");
|
|
121031
121026
|
};
|
|
121032
121027
|
this.generateAPIKey = async (apiKeyLabel) => {
|