@bigbinary/neeto-playwright-commons 1.8.25 → 1.8.26
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 +13 -4
- package/index.cjs.js.map +1 -1
- package/index.d.ts +8 -3
- package/index.js +13 -4
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -137,13 +137,16 @@ declare class HelpAndProfilePage {
|
|
|
137
137
|
|
|
138
138
|
type Integration = "dailyco" | "github" | "google-calendar" | "google-analytics" | "google-sheets" | "microsoft-teams" | "neeto-chat" | "neeto-crm" | "slack" | "twilio" | "whereby" | "zapier" | "zoom";
|
|
139
139
|
type IntegrationStatus = "connected" | "disconnected";
|
|
140
|
+
type PartialInterceptMultipleResponsesParams = Partial<InterceptMultipleResponsesParams>;
|
|
140
141
|
interface IntegrationBaseParams {
|
|
141
142
|
page: Page;
|
|
142
143
|
neetoPlaywrightUtilities: CustomCommands;
|
|
143
144
|
integration: Integration;
|
|
144
|
-
integrationRouteIndex?: string;
|
|
145
145
|
connectedHeader?: string;
|
|
146
146
|
connectHeader?: string;
|
|
147
|
+
pageloaderTimeout?: number;
|
|
148
|
+
integrationRouteIndex?: string;
|
|
149
|
+
integrationRouteResponsesParams?: PartialInterceptMultipleResponsesParams;
|
|
147
150
|
}
|
|
148
151
|
declare class IntegrationBase {
|
|
149
152
|
readonly page: Page;
|
|
@@ -153,9 +156,11 @@ declare class IntegrationBase {
|
|
|
153
156
|
readonly integrationCard: Locator;
|
|
154
157
|
readonly connectHeader: string;
|
|
155
158
|
readonly connectedHeader: string;
|
|
159
|
+
pageloaderTimeout: number;
|
|
156
160
|
integrationRouteIndex: string;
|
|
157
|
-
|
|
158
|
-
|
|
161
|
+
integrationRouteResponsesParams: PartialInterceptMultipleResponsesParams;
|
|
162
|
+
constructor({ page, neetoPlaywrightUtilities, integration, connectHeader, connectedHeader, pageloaderTimeout, integrationRouteIndex, integrationRouteResponsesParams, }: IntegrationBaseParams);
|
|
163
|
+
disconnect: (interceptMultipleResponsesParams?: PartialInterceptMultipleResponsesParams) => Promise<void>;
|
|
159
164
|
connect: (skipGoTo?: boolean) => Promise<void>;
|
|
160
165
|
verifyIntegrationStatus: (status?: IntegrationStatus) => Promise<void>;
|
|
161
166
|
clickOnIntegrationCard: () => Promise<void>;
|
package/index.js
CHANGED
|
@@ -12529,7 +12529,7 @@ const INTEGRATION_SELECTORS = {
|
|
|
12529
12529
|
};
|
|
12530
12530
|
|
|
12531
12531
|
class IntegrationBase {
|
|
12532
|
-
constructor({ page, neetoPlaywrightUtilities, integration,
|
|
12532
|
+
constructor({ page, neetoPlaywrightUtilities, integration, connectHeader, connectedHeader, pageloaderTimeout, integrationRouteIndex, integrationRouteResponsesParams, }) {
|
|
12533
12533
|
this.disconnect = async (interceptMultipleResponsesParams = {}) => {
|
|
12534
12534
|
await this.gotoIntegrationIndex();
|
|
12535
12535
|
await this.clickOnIntegrationCard();
|
|
@@ -12564,18 +12564,27 @@ class IntegrationBase {
|
|
|
12564
12564
|
await expect(this.page.getByTestId(COMMON_SELECTORS.spinner)).toHaveCount(0);
|
|
12565
12565
|
await this.integrationCard.scrollIntoViewIfNeeded();
|
|
12566
12566
|
await this.integrationCard.click();
|
|
12567
|
-
await expect(this.page.getByTestId(COMMON_SELECTORS.pageLoader)).toBeHidden();
|
|
12567
|
+
await expect(this.page.getByTestId(COMMON_SELECTORS.pageLoader)).toBeHidden({ timeout: this.pageloaderTimeout });
|
|
12568
12568
|
};
|
|
12569
12569
|
this.gotoIntegrationIndex = async () => {
|
|
12570
|
-
isNotEmpty(this.integrationRouteIndex)
|
|
12571
|
-
|
|
12570
|
+
if (isNotEmpty(this.integrationRouteIndex)) {
|
|
12571
|
+
const integrationIndexPromise = this.neetoPlaywrightUtilities.interceptMultipleResponses({
|
|
12572
|
+
times: 0,
|
|
12573
|
+
...this.integrationRouteResponsesParams,
|
|
12574
|
+
});
|
|
12575
|
+
await this.page.goto(this.integrationRouteIndex);
|
|
12576
|
+
await integrationIndexPromise;
|
|
12577
|
+
}
|
|
12572
12578
|
};
|
|
12573
12579
|
this.page = page;
|
|
12574
12580
|
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
12575
12581
|
this.t = getI18nInstance().t;
|
|
12576
12582
|
this.integration = integration;
|
|
12577
12583
|
this.integrationCard = this.page.getByTestId(INTEGRATION_SELECTORS.integrationCard(integration));
|
|
12584
|
+
this.pageloaderTimeout = pageloaderTimeout || 10000;
|
|
12578
12585
|
this.integrationRouteIndex = integrationRouteIndex || "";
|
|
12586
|
+
this.integrationRouteResponsesParams =
|
|
12587
|
+
integrationRouteResponsesParams || {};
|
|
12579
12588
|
this.connectHeader =
|
|
12580
12589
|
connectHeader ||
|
|
12581
12590
|
INTEGRATIONS_TEXTS.connectHeader(humanize(this.integration));
|