@bigbinary/neeto-playwright-commons 1.26.8 → 1.26.9
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 +110 -4
- package/index.cjs.js.map +1 -1
- package/index.d.ts +56 -9
- package/index.js +110 -4
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -5468,10 +5468,10 @@ const ZAPIER_SELECTORS = {
|
|
|
5468
5468
|
zapOpenSubstepContainer: "[data-testid='open-sub-step-container']",
|
|
5469
5469
|
modal: "[data-testid='Modal']",
|
|
5470
5470
|
fmPrettytext: ".fm-prettytext",
|
|
5471
|
-
spinner: "
|
|
5471
|
+
spinner: "spinner",
|
|
5472
5472
|
skeletonBlock: "[data-testid='SkeletonBlock']",
|
|
5473
5473
|
accountsLoader: "[data-testid='accounts-loader']",
|
|
5474
|
-
floatingBox: "
|
|
5474
|
+
floatingBox: "floating-box",
|
|
5475
5475
|
connection: "[data-testid='Connection']",
|
|
5476
5476
|
deleteConnectionModal: "[data-testid='DeleteAuthModal-root']",
|
|
5477
5477
|
deleteConnectionDropdownButton: "[data-testid='connection-list-item-dropdown-item-Delete']",
|
|
@@ -5482,6 +5482,16 @@ const ZAPIER_SELECTORS = {
|
|
|
5482
5482
|
iconContainer: "[data-testid='iconContainer']",
|
|
5483
5483
|
deleteApiButton: "delete-apikey-button",
|
|
5484
5484
|
zapierSubLink: "zapier-sub-link",
|
|
5485
|
+
navbar: "top-nav-test-id",
|
|
5486
|
+
authTitle: "auth-title",
|
|
5487
|
+
publishButton: "publish-button-wrapper",
|
|
5488
|
+
panelFooter: "#details-panel-footer",
|
|
5489
|
+
zapToggle: "zap-toggle",
|
|
5490
|
+
stepBlock: `step-node-${process.env.ZAP_ID}`,
|
|
5491
|
+
fmPrettyBox: ".fm-pretty-text-input.pretty-text-box",
|
|
5492
|
+
universalTopbar: "universalTopbar",
|
|
5493
|
+
accountsMenu: "accountsMenu",
|
|
5494
|
+
zapToggleCheckbox: "input[type='checkbox']",
|
|
5485
5495
|
};
|
|
5486
5496
|
|
|
5487
5497
|
const TWILIO_SELECTORS = {
|
|
@@ -113857,6 +113867,14 @@ const SLACK_WEB_TEXTS = {
|
|
|
113857
113867
|
deleteChannel: "Delete channel",
|
|
113858
113868
|
};
|
|
113859
113869
|
const ZAPIER_WEB_TEXTS = {
|
|
113870
|
+
editZap: "Edit Zap",
|
|
113871
|
+
newSubmission: "New Submission",
|
|
113872
|
+
sendOutboundEmail: "Send Outbound Email",
|
|
113873
|
+
moreOptions: "More options",
|
|
113874
|
+
reconnect: "Reconnect this authentication",
|
|
113875
|
+
retestStep: "Retest step",
|
|
113876
|
+
editThisZap: "Edit this Zap",
|
|
113877
|
+
staging: "Staging",
|
|
113860
113878
|
create: "Create",
|
|
113861
113879
|
account: "Account",
|
|
113862
113880
|
email: "Email",
|
|
@@ -116949,6 +116967,90 @@ class ZapierPage extends IntegrationBase {
|
|
|
116949
116967
|
neetoPlaywrightUtilities,
|
|
116950
116968
|
integrationRouteIndex,
|
|
116951
116969
|
});
|
|
116970
|
+
this.gotoZapEditor = async () => {
|
|
116971
|
+
await this.zapierWebPage.goto(THIRD_PARTY_ROUTES.zapier.zapEditor(process.env.ZAP_ID));
|
|
116972
|
+
await this.zapierWebPage.waitForLoadState();
|
|
116973
|
+
await test.expect(this.firstStepBlock).toBeVisible({ timeout: 25000 });
|
|
116974
|
+
};
|
|
116975
|
+
this.editZap = async () => {
|
|
116976
|
+
await this.navbar
|
|
116977
|
+
.getByRole("button", { name: ZAPIER_WEB_TEXTS.editThisZap })
|
|
116978
|
+
.click();
|
|
116979
|
+
await this.zapierWebPage.waitForLoadState();
|
|
116980
|
+
await test.expect(this.navbar.getByTestId(ZAPIER_SELECTORS.publishButton)).toBeVisible({ timeout: 25000 });
|
|
116981
|
+
};
|
|
116982
|
+
this.openMoreOptions = async () => {
|
|
116983
|
+
await this.firstStepBlock.waitFor({ timeout: 25000 });
|
|
116984
|
+
await this.firstStepBlock.click();
|
|
116985
|
+
await test.expect(this.tabPanel).toBeVisible({ timeout: 25000 });
|
|
116986
|
+
await this.tabPanel.getByLabel(ZAPIER_WEB_TEXTS.moreOptions).click();
|
|
116987
|
+
};
|
|
116988
|
+
this.toggleZap = async () => {
|
|
116989
|
+
const checkbox = this.zapToggle.locator(ZAPIER_SELECTORS.zapToggleCheckbox);
|
|
116990
|
+
const isZapTurnedOn = await checkbox.isChecked();
|
|
116991
|
+
if (isZapTurnedOn)
|
|
116992
|
+
return;
|
|
116993
|
+
await this.zapToggle.click();
|
|
116994
|
+
await test.expect(this.zapToggle.getByTestId(ZAPIER_SELECTORS.spinner)).toBeHidden({ timeout: 30000 });
|
|
116995
|
+
await test.expect(checkbox).toBeChecked({ timeout: 15000 });
|
|
116996
|
+
};
|
|
116997
|
+
this.reconnectAccount = async (zapierApiKey) => {
|
|
116998
|
+
var _a;
|
|
116999
|
+
this.stepBlock = this.zapierWebPage.getByTestId(ZAPIER_SELECTORS.stepBlock);
|
|
117000
|
+
this.navbar = this.zapierWebPage.getByTestId(ZAPIER_SELECTORS.navbar);
|
|
117001
|
+
this.tabPanel = this.zapierWebPage.getByRole("tabpanel");
|
|
117002
|
+
this.panelFooter = this.zapierWebPage.locator(ZAPIER_SELECTORS.panelFooter);
|
|
117003
|
+
this.firstStepBlock = this.stepBlock.getByText(ZAPIER_WEB_TEXTS.staging);
|
|
117004
|
+
this.zapToggle = this.navbar.getByTestId(ZAPIER_SELECTORS.zapToggle);
|
|
117005
|
+
await this.gotoZapEditor();
|
|
117006
|
+
await this.editZap();
|
|
117007
|
+
await this.openMoreOptions();
|
|
117008
|
+
const reconnectPopup = this.zapierWebPage.waitForEvent("popup");
|
|
117009
|
+
await this.zapierWebPage
|
|
117010
|
+
.getByTestId(ZAPIER_SELECTORS.floatingBox)
|
|
117011
|
+
.getByRole("button", { name: ZAPIER_WEB_TEXTS.reconnect, exact: true })
|
|
117012
|
+
.click();
|
|
117013
|
+
const reconnectPage = await reconnectPopup;
|
|
117014
|
+
await reconnectPage.waitForLoadState();
|
|
117015
|
+
await test.expect(reconnectPage.getByRole("heading", { name: ZAPIER_WEB_TEXTS.loading })).toBeHidden({ timeout: 15000 });
|
|
117016
|
+
const yesBtn = reconnectPage.getByRole("button", {
|
|
117017
|
+
name: RegExp(ZAPIER_WEB_TEXTS.yesContinueTo),
|
|
117018
|
+
});
|
|
117019
|
+
const prettyTextBox = reconnectPage.locator(ZAPIER_SELECTORS.fmPrettytext);
|
|
117020
|
+
const [subdomainBox, apiKeyBox] = [0, 1].map(index =>
|
|
117021
|
+
// eslint-disable-next-line playwright/no-nth-methods
|
|
117022
|
+
prettyTextBox.nth(index));
|
|
117023
|
+
await test.expect(yesBtn).toBeVisible({ timeout: 25000 });
|
|
117024
|
+
const subdomain = (_a = getGlobalUserState()) === null || _a === void 0 ? void 0 : _a.subdomainName;
|
|
117025
|
+
await subdomainBox.click();
|
|
117026
|
+
await this.setTextEditorValue(reconnectPage, subdomain);
|
|
117027
|
+
await apiKeyBox.click();
|
|
117028
|
+
await this.setTextEditorValue(reconnectPage, zapierApiKey, 1);
|
|
117029
|
+
await yesBtn.click();
|
|
117030
|
+
const continueBtn = this.panelFooter.getByRole("button", {
|
|
117031
|
+
name: ZAPIER_WEB_TEXTS.continue,
|
|
117032
|
+
exact: true,
|
|
117033
|
+
});
|
|
117034
|
+
await this.tabPanel
|
|
117035
|
+
.getByTestId(ZAPIER_SELECTORS.authTitle)
|
|
117036
|
+
.getByText(ZAPIER_WEB_TEXTS.staging)
|
|
117037
|
+
.waitFor({ timeout: 35000 });
|
|
117038
|
+
await continueBtn.waitFor({ timeout: 30000 });
|
|
117039
|
+
await continueBtn.click({ timeout: 30000 });
|
|
117040
|
+
await test.expect(continueBtn).toBeHidden({ timeout: 25000 });
|
|
117041
|
+
await test.expect(this.panelFooter.getByRole("button", {
|
|
117042
|
+
name: ZAPIER_WEB_TEXTS.continueWithSelectedRecord,
|
|
117043
|
+
})).toBeVisible({ timeout: 35000 });
|
|
117044
|
+
await this.toggleZap();
|
|
117045
|
+
};
|
|
117046
|
+
this.setTextEditorValue = (page, value, index = 0) => page.evaluate(({ selector, index, value }) => {
|
|
117047
|
+
const container = document.querySelectorAll(selector)[index];
|
|
117048
|
+
const cmElement = container.querySelector(".CodeMirror");
|
|
117049
|
+
const cm = cmElement.CodeMirror;
|
|
117050
|
+
cm.focus();
|
|
117051
|
+
cm.setValue(value);
|
|
117052
|
+
cm.refresh();
|
|
117053
|
+
}, { selector: ZAPIER_SELECTORS.fmPrettyBox, index, value });
|
|
116952
117054
|
this.loginToZapier = async (zapierWebPage) => {
|
|
116953
117055
|
this.zapierWebPage = zapierWebPage;
|
|
116954
117056
|
this.continueButton = this.zapierWebPage.getByRole("button", {
|
|
@@ -116990,6 +117092,10 @@ class ZapierPage extends IntegrationBase {
|
|
|
116990
117092
|
element: this.continueButton,
|
|
116991
117093
|
page: zapierWebPage,
|
|
116992
117094
|
});
|
|
117095
|
+
await this.zapierWebPage
|
|
117096
|
+
.getByTestId(ZAPIER_SELECTORS.universalTopbar)
|
|
117097
|
+
.getByTestId(ZAPIER_SELECTORS.accountsMenu)
|
|
117098
|
+
.waitFor({ timeout: 25000 });
|
|
116993
117099
|
};
|
|
116994
117100
|
this.logoutFromZapier = async () => {
|
|
116995
117101
|
await this.zapierWebPage.goto(THIRD_PARTY_ROUTES.zapier.logOut, {
|
|
@@ -117040,12 +117146,12 @@ class ZapierPage extends IntegrationBase {
|
|
|
117040
117146
|
await this.continueButton.click({ timeout: 30000 });
|
|
117041
117147
|
await test.expect(this.zapierWebPage
|
|
117042
117148
|
.getByLabel(ZAPIER_WEB_TEXTS.testTrigger)
|
|
117043
|
-
.
|
|
117149
|
+
.getByTestId(ZAPIER_SELECTORS.spinner)).toBeHidden({ timeout: 10000 });
|
|
117044
117150
|
await test.expect(this.zapierWebPage.locator(ZAPIER_SELECTORS.skeletonBlock)).toHaveCount(0, { timeout: 10000 });
|
|
117045
117151
|
const testTriggerButton = this.zapierWebPage.getByRole("button", {
|
|
117046
117152
|
name: ZAPIER_WEB_TEXTS.testTrigger,
|
|
117047
117153
|
});
|
|
117048
|
-
await test.expect(this.zapierWebPage.
|
|
117154
|
+
await test.expect(this.zapierWebPage.getByTestId(ZAPIER_SELECTORS.spinner)).toHaveCount(0, { timeout: 30000 });
|
|
117049
117155
|
const continueWithRecordBtn = this.zapierWebPage.getByRole("button", {
|
|
117050
117156
|
name: ZAPIER_WEB_TEXTS.continueWithSelectedRecord,
|
|
117051
117157
|
});
|