@bigbinary/neeto-playwright-commons 1.11.12 → 1.11.14
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 +24 -13
- package/index.cjs.js.map +1 -1
- package/index.d.ts +18 -7
- package/index.js +24 -13
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -58,9 +58,10 @@ interface FieldValue {
|
|
|
58
58
|
}
|
|
59
59
|
type VerifyFieldValue = (values: FieldValue | FieldValue[]) => Promise<void> | Promise<void[]>;
|
|
60
60
|
interface SelectOptionFromDropdownParams {
|
|
61
|
-
selectValueContainer
|
|
62
|
-
selectMenu
|
|
61
|
+
selectValueContainer?: string;
|
|
62
|
+
selectMenu?: string;
|
|
63
63
|
value: string;
|
|
64
|
+
page?: Page;
|
|
64
65
|
options?: Partial<{
|
|
65
66
|
visibilityTimeout: number;
|
|
66
67
|
textAssertionTimeout: number;
|
|
@@ -232,12 +233,14 @@ declare class CustomCommands {
|
|
|
232
233
|
*
|
|
233
234
|
* operation is completed. It takes the following parameters:
|
|
234
235
|
*
|
|
235
|
-
* selectValueContainer: is the selector for the select input container.
|
|
236
|
+
* selectValueContainer (optional): is the selector for the select input container. Default is nui-select-value-container.
|
|
236
237
|
*
|
|
237
|
-
* selectMenu: is the selector for the select input menu.
|
|
238
|
+
* selectMenu (optional): is the selector for the select input menu. Default is nui-select-menu.
|
|
238
239
|
*
|
|
239
240
|
* value: is the value to be selected.
|
|
240
241
|
*
|
|
242
|
+
* page (optional): is the custom page context. Default is POM's page.
|
|
243
|
+
*
|
|
241
244
|
* options: is an object with the following optional parameters:
|
|
242
245
|
*
|
|
243
246
|
* visiblityTimeout: is the time to wait for the select input to be visible. Default is 2000ms.
|
|
@@ -272,6 +275,7 @@ declare class CustomCommands {
|
|
|
272
275
|
selectValueContainer,
|
|
273
276
|
selectMenu,
|
|
274
277
|
value,
|
|
278
|
+
page,
|
|
275
279
|
options
|
|
276
280
|
}: SelectOptionFromDropdownParams) => Promise<void>;
|
|
277
281
|
/**
|
|
@@ -1496,7 +1500,7 @@ declare class ZapierPage extends IntegrationBase {
|
|
|
1496
1500
|
* await zapierPage.reconnectAccountAndPublish("your-zapier-api-key");
|
|
1497
1501
|
* @endexample
|
|
1498
1502
|
*/
|
|
1499
|
-
reconnectAccountAndPublish: (zapierApiKey: string) => Promise<void>;
|
|
1503
|
+
reconnectAccountAndPublish: (zapierApiKey: string, appName: string) => Promise<void>;
|
|
1500
1504
|
/**
|
|
1501
1505
|
*
|
|
1502
1506
|
* Deletes all connections in zapier. It takes the following parameters:
|
|
@@ -4106,6 +4110,7 @@ declare const ZAPIER_SELECTORS: {
|
|
|
4106
4110
|
universalSidebar: string;
|
|
4107
4111
|
sidebarFooter: string;
|
|
4108
4112
|
contextualSideBar: string;
|
|
4113
|
+
iconContainer: string;
|
|
4109
4114
|
};
|
|
4110
4115
|
/**
|
|
4111
4116
|
*
|
|
@@ -4389,7 +4394,11 @@ declare const SLACK_WEB_TEXTS: {
|
|
|
4389
4394
|
*
|
|
4390
4395
|
* welcomeText(zapierLoginEmail): Method to generate welcome text for Zapier login.
|
|
4391
4396
|
*
|
|
4392
|
-
*
|
|
4397
|
+
* connectStagingApp: Text for connecting to Staging application.
|
|
4398
|
+
*
|
|
4399
|
+
* zapierWorkflowTriggered: Text subject for the Outbound email.
|
|
4400
|
+
*
|
|
4401
|
+
* confirmPublishing: Text to confirm the publishing of the updated Zap.
|
|
4393
4402
|
*
|
|
4394
4403
|
*/
|
|
4395
4404
|
declare const ZAPIER_WEB_TEXTS: {
|
|
@@ -4415,7 +4424,9 @@ declare const ZAPIER_WEB_TEXTS: {
|
|
|
4415
4424
|
trialEndsRegExp: string;
|
|
4416
4425
|
testCurrentlyInQueue: string;
|
|
4417
4426
|
welcomeText: (zapierLoginEmail: string) => string;
|
|
4418
|
-
|
|
4427
|
+
connectStagingApp: (appName: string) => string;
|
|
4428
|
+
zapierWorkflowTriggered: string;
|
|
4429
|
+
confirmPublishing: string;
|
|
4419
4430
|
};
|
|
4420
4431
|
/**
|
|
4421
4432
|
*
|
package/index.js
CHANGED
|
@@ -3552,23 +3552,23 @@ class CustomCommands {
|
|
|
3552
3552
|
})}`;
|
|
3553
3553
|
return await this.request[method](formattedUrl, requestOptions);
|
|
3554
3554
|
};
|
|
3555
|
-
this.selectOptionFromDropdown = async ({ selectValueContainer, selectMenu, value, options = {}, }) => {
|
|
3555
|
+
this.selectOptionFromDropdown = async ({ selectValueContainer = COMMON_SELECTORS.selectValueContainer, selectMenu = COMMON_SELECTORS.dropdownMenu, value, page = this.page, options = {}, }) => {
|
|
3556
3556
|
Object.assign({
|
|
3557
3557
|
visibilityTimeout: 2000,
|
|
3558
3558
|
textAssertionTimeout: 1000,
|
|
3559
3559
|
retryTimeout: 20000,
|
|
3560
3560
|
}, options);
|
|
3561
3561
|
await expect(async () => {
|
|
3562
|
-
await
|
|
3563
|
-
await expect(
|
|
3562
|
+
await page.getByTestId(selectValueContainer).click();
|
|
3563
|
+
await expect(page.getByTestId(selectMenu)).toBeVisible({
|
|
3564
3564
|
timeout: options.visibilityTimeout,
|
|
3565
3565
|
});
|
|
3566
|
-
await
|
|
3567
|
-
await
|
|
3566
|
+
await page.keyboard.type(value);
|
|
3567
|
+
await page
|
|
3568
3568
|
.getByTestId(selectMenu)
|
|
3569
3569
|
.getByText(value, { exact: true })
|
|
3570
3570
|
.click();
|
|
3571
|
-
await expect(
|
|
3571
|
+
await expect(page.getByTestId(selectValueContainer)).toContainText(value, { timeout: options.textAssertionTimeout });
|
|
3572
3572
|
}).toPass({ timeout: options.retryTimeout });
|
|
3573
3573
|
};
|
|
3574
3574
|
this.verifyFieldValue = values => {
|
|
@@ -13069,7 +13069,9 @@ const ZAPIER_WEB_TEXTS = {
|
|
|
13069
13069
|
trialEndsRegExp: "Trial ends on",
|
|
13070
13070
|
testCurrentlyInQueue: "Test currently in queue",
|
|
13071
13071
|
welcomeText: (zapierLoginEmail) => `Welcome back ${zapierLoginEmail}`,
|
|
13072
|
-
|
|
13072
|
+
connectStagingApp: (appName) => `Connect ${appName} Staging`,
|
|
13073
|
+
zapierWorkflowTriggered: "Zapier Workflow Triggered",
|
|
13074
|
+
confirmPublishing: "Confirm Publishing",
|
|
13073
13075
|
};
|
|
13074
13076
|
const TOASTR_MESSAGES = {
|
|
13075
13077
|
zapierApiKeyGenerated: "Zapier API key is generated successfully!",
|
|
@@ -15641,6 +15643,7 @@ const ZAPIER_SELECTORS = {
|
|
|
15641
15643
|
universalSidebar: "[data-testid='universalSidebar']",
|
|
15642
15644
|
sidebarFooter: "css=[class$=InAppSidebarFooter__footerWrapper]",
|
|
15643
15645
|
contextualSideBar: "[data-testid='contextual-sidebar']",
|
|
15646
|
+
iconContainer: "[data-testid='iconContainer']",
|
|
15644
15647
|
};
|
|
15645
15648
|
|
|
15646
15649
|
class ZapierPage extends IntegrationBase {
|
|
@@ -15674,7 +15677,7 @@ class ZapierPage extends IntegrationBase {
|
|
|
15674
15677
|
});
|
|
15675
15678
|
await this.zapierWebPage.close();
|
|
15676
15679
|
};
|
|
15677
|
-
this.reconnectAccountAndPublish = async (zapierApiKey) => {
|
|
15680
|
+
this.reconnectAccountAndPublish = async (zapierApiKey, appName) => {
|
|
15678
15681
|
var _a;
|
|
15679
15682
|
await this.zapierWebPage.goto(THIRD_PARTY_ROUTES.zapier.zapEditor(process.env.ZAP_ID));
|
|
15680
15683
|
await this.zapierWebPage
|
|
@@ -15688,7 +15691,9 @@ class ZapierPage extends IntegrationBase {
|
|
|
15688
15691
|
}
|
|
15689
15692
|
const signInPagePromise = this.zapierWebPage.waitForEvent("popup");
|
|
15690
15693
|
await this.zapierWebPage
|
|
15691
|
-
.getByRole("button", {
|
|
15694
|
+
.getByRole("button", {
|
|
15695
|
+
name: ZAPIER_WEB_TEXTS.connectStagingApp(appName),
|
|
15696
|
+
})
|
|
15692
15697
|
.click();
|
|
15693
15698
|
const signInPage = await signInPagePromise;
|
|
15694
15699
|
await signInPage.waitForLoadState();
|
|
@@ -15728,9 +15733,10 @@ class ZapierPage extends IntegrationBase {
|
|
|
15728
15733
|
.getByRole("button", {
|
|
15729
15734
|
name: ZAPIER_WEB_TEXTS.continueWithSelectedRecord,
|
|
15730
15735
|
})
|
|
15731
|
-
.click({ timeout:
|
|
15732
|
-
await this.continueButton.click();
|
|
15733
|
-
await this.
|
|
15736
|
+
.click({ timeout: 30000 });
|
|
15737
|
+
await this.continueButton.click({ timeout: 20000 });
|
|
15738
|
+
await expect(this.zapierWebPage.getByText(ZAPIER_WEB_TEXTS.zapierWorkflowTriggered)).toBeVisible();
|
|
15739
|
+
await this.continueButton.click({ timeout: 20000 });
|
|
15734
15740
|
await this.zapierWebPage
|
|
15735
15741
|
.getByLabel(ZAPIER_WEB_TEXTS.publish, { exact: true })
|
|
15736
15742
|
.or(this.zapierWebPage
|
|
@@ -15738,11 +15744,16 @@ class ZapierPage extends IntegrationBase {
|
|
|
15738
15744
|
.getByRole("button", { name: ZAPIER_WEB_TEXTS.publish }))
|
|
15739
15745
|
.click({ timeout: 20000 });
|
|
15740
15746
|
await this.zapierWebPage
|
|
15747
|
+
.getByRole("button", { name: ZAPIER_WEB_TEXTS.confirmPublishing })
|
|
15748
|
+
.or(this.zapierWebPage
|
|
15741
15749
|
.locator(ZAPIER_SELECTORS.modal)
|
|
15742
15750
|
.getByLabel(ZAPIER_WEB_TEXTS.publish)
|
|
15743
15751
|
.or(this.zapierWebPage
|
|
15744
15752
|
.locator(ZAPIER_SELECTORS.modal)
|
|
15745
|
-
.getByRole("button", {
|
|
15753
|
+
.getByRole("button", {
|
|
15754
|
+
name: ZAPIER_WEB_TEXTS.publish,
|
|
15755
|
+
exact: true,
|
|
15756
|
+
})))
|
|
15746
15757
|
.click();
|
|
15747
15758
|
await this.zapierWebPage
|
|
15748
15759
|
.getByLabel(ZAPIER_WEB_TEXTS.publishingZapHeading)
|