@bigbinary/neeto-playwright-commons 1.14.1 → 1.14.3
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 +14 -10
- package/index.cjs.js.map +1 -1
- package/index.d.ts +13 -2
- package/index.js +15 -11
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -555,6 +555,8 @@ const MEMBER_SELECTORS = {
|
|
|
555
555
|
menubarSubLink: (sublink) => `members-${sublink}-block-sub-link`,
|
|
556
556
|
takeActionStateOption: (option = "") => `ntm-${hyphenize(option)}-members-button`,
|
|
557
557
|
checkboxLabel: (label) => `${hyphenize(label)}-checkbox-label`,
|
|
558
|
+
subscriptionPlanTag: "ntm-member-subscription-plan-tag",
|
|
559
|
+
memberNameCell: (nameOrEmail) => `ntm-member-name-${hyphenize(nameOrEmail)}`,
|
|
558
560
|
};
|
|
559
561
|
const MEMBER_FORM_SELECTORS = {
|
|
560
562
|
emailTextField: "email-select-input-field",
|
|
@@ -21329,7 +21331,7 @@ class EmbedBase {
|
|
|
21329
21331
|
`width: "${embedWidthPercentage}"`,
|
|
21330
21332
|
]);
|
|
21331
21333
|
const inlineEmbedPromise = this.neetoPlaywrightUtilities.interceptMultipleResponses(inlineEmbedInterceptParams);
|
|
21332
|
-
await this.previewTab.click();
|
|
21334
|
+
(await this.previewTab.isVisible()) && (await this.previewTab.click());
|
|
21333
21335
|
await inlineEmbedPromise;
|
|
21334
21336
|
const iframe = this.page.locator("iframe");
|
|
21335
21337
|
await iframe.waitFor({ state: "visible" });
|
|
@@ -21388,7 +21390,7 @@ class EmbedBase {
|
|
|
21388
21390
|
`btnPosition: "${toCamelCase(customizationOptions.buttonPosition)}"`,
|
|
21389
21391
|
`btnText: "${customizationOptions.buttonText}"`,
|
|
21390
21392
|
]);
|
|
21391
|
-
await this.previewTab.click();
|
|
21393
|
+
(await this.previewTab.isVisible()) && (await this.previewTab.click());
|
|
21392
21394
|
const floatingButton = this.page.getByRole("button", {
|
|
21393
21395
|
name: customizationOptions.buttonText,
|
|
21394
21396
|
});
|
|
@@ -21411,7 +21413,7 @@ class EmbedBase {
|
|
|
21411
21413
|
.getByTestId(EMBED_SELECTORS.elementIdInput)
|
|
21412
21414
|
.fill(customizationOptions.customId);
|
|
21413
21415
|
await test$1.expect(this.codeBlock).toContainText(`elementSelector: "#${customizationOptions.customId}"`);
|
|
21414
|
-
await this.previewTab.click();
|
|
21416
|
+
(await this.previewTab.isVisible()) && (await this.previewTab.click());
|
|
21415
21417
|
await test$1.expect(this.page.getByTestId(EMBED_SELECTORS.previewElementPopupButton)).toBeVisible();
|
|
21416
21418
|
await test$1.expect(this.page.locator(`#${customizationOptions.customId}`)).toBeVisible();
|
|
21417
21419
|
};
|
|
@@ -24197,7 +24199,7 @@ class MemberApis {
|
|
|
24197
24199
|
class Member {
|
|
24198
24200
|
constructor(neetoPlaywrightUtilities) {
|
|
24199
24201
|
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
24200
|
-
this.addMemberViaRequest = async ({ email, role = MEMBER_TEXTS.agent, appName, }) => {
|
|
24202
|
+
this.addMemberViaRequest = async ({ email, role = MEMBER_TEXTS.agent, appName, subscriptionPlan = "free", }) => {
|
|
24201
24203
|
let response;
|
|
24202
24204
|
await test$1.expect
|
|
24203
24205
|
.poll(async () => {
|
|
@@ -24207,6 +24209,7 @@ class Member {
|
|
|
24207
24209
|
app_roles: [
|
|
24208
24210
|
{ app_name: appName, active_role: role, is_enabled: true },
|
|
24209
24211
|
],
|
|
24212
|
+
subscription_plan: subscriptionPlan,
|
|
24210
24213
|
});
|
|
24211
24214
|
return response === null || response === void 0 ? void 0 : response.status();
|
|
24212
24215
|
}, { timeout: 30000 })
|
|
@@ -24220,21 +24223,22 @@ class Member {
|
|
|
24220
24223
|
const responseBodyBuffer = await (jobResponse === null || jobResponse === void 0 ? void 0 : jobResponse.body());
|
|
24221
24224
|
const { is_completed: isCompleted } = JSON.parse(String(responseBodyBuffer));
|
|
24222
24225
|
return isCompleted;
|
|
24223
|
-
}, { timeout:
|
|
24226
|
+
}, { timeout: 60000 })
|
|
24224
24227
|
.toBe(true);
|
|
24225
24228
|
};
|
|
24226
|
-
this.editMemberViaRequest = async ({ email, firstName, lastName, newRole, }) => {
|
|
24229
|
+
this.editMemberViaRequest = async ({ email, firstName, lastName, newRole, subscriptionPlan, }) => {
|
|
24227
24230
|
const responseBody = (await this.memberApis
|
|
24228
24231
|
.fetch({ search: email })
|
|
24229
24232
|
.then(response => response === null || response === void 0 ? void 0 : response.json()));
|
|
24230
24233
|
const memberDetails = responseBody === null || responseBody === void 0 ? void 0 : responseBody.members.find(({ email }) => email === email.toLowerCase());
|
|
24231
24234
|
memberDetails &&
|
|
24232
|
-
(await this.memberApis.update(memberDetails.id, {
|
|
24235
|
+
(await this.memberApis.update(memberDetails.id, neetoCist.keysToSnakeCase({
|
|
24233
24236
|
active: true,
|
|
24234
|
-
|
|
24235
|
-
|
|
24237
|
+
firstName,
|
|
24238
|
+
lastName,
|
|
24236
24239
|
organization_role: newRole,
|
|
24237
|
-
|
|
24240
|
+
subscriptionPlan,
|
|
24241
|
+
})));
|
|
24238
24242
|
};
|
|
24239
24243
|
this.deactivateMemberViaRequest = (email) => this.memberApis.bulkUpdate({ active: false, emails: [email] });
|
|
24240
24244
|
this.generateRandomTeamMembers = ({ count = 1, role = "standard" }) => neetoCist.dynamicArray(count, () => ({
|