@bigbinary/neeto-playwright-commons 1.14.2 → 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 +11 -7
- package/index.cjs.js.map +1 -1
- package/index.d.ts +13 -2
- package/index.js +12 -8
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1913,16 +1913,19 @@ declare class ZapierPage extends IntegrationBase {
|
|
|
1913
1913
|
*/
|
|
1914
1914
|
disconnectAndVerify: () => Promise<void>;
|
|
1915
1915
|
}
|
|
1916
|
+
type SubscriptionPlan = "free" | "pro";
|
|
1916
1917
|
interface AddMemberProps$1 {
|
|
1917
1918
|
email: string;
|
|
1918
1919
|
role?: string;
|
|
1919
1920
|
appName: string;
|
|
1921
|
+
subscriptionPlan?: SubscriptionPlan;
|
|
1920
1922
|
}
|
|
1921
1923
|
interface EditMemberProps$2 {
|
|
1922
1924
|
email: string;
|
|
1923
1925
|
firstName?: string;
|
|
1924
1926
|
lastName?: string;
|
|
1925
1927
|
newRole?: string;
|
|
1928
|
+
subscriptionPlan?: SubscriptionPlan;
|
|
1926
1929
|
}
|
|
1927
1930
|
declare class Member {
|
|
1928
1931
|
private neetoPlaywrightUtilities;
|
|
@@ -1965,7 +1968,8 @@ declare class Member {
|
|
|
1965
1968
|
addMemberViaRequest: ({
|
|
1966
1969
|
email,
|
|
1967
1970
|
role,
|
|
1968
|
-
appName
|
|
1971
|
+
appName,
|
|
1972
|
+
subscriptionPlan
|
|
1969
1973
|
}: AddMemberProps$1) => Promise<void>;
|
|
1970
1974
|
/**
|
|
1971
1975
|
*
|
|
@@ -2009,7 +2013,8 @@ declare class Member {
|
|
|
2009
2013
|
email,
|
|
2010
2014
|
firstName,
|
|
2011
2015
|
lastName,
|
|
2012
|
-
newRole
|
|
2016
|
+
newRole,
|
|
2017
|
+
subscriptionPlan
|
|
2013
2018
|
}: EditMemberProps$2) => Promise<void>;
|
|
2014
2019
|
/**
|
|
2015
2020
|
*
|
|
@@ -4553,6 +4558,10 @@ declare const LOGIN_SELECTORS: {
|
|
|
4553
4558
|
*
|
|
4554
4559
|
* statusTag: Selector for the member status tag.
|
|
4555
4560
|
*
|
|
4561
|
+
* subscriptionPlanTag: Selector for subscription plan tag.
|
|
4562
|
+
*
|
|
4563
|
+
* memberNameCell: Selector for member name or email cell in members table.
|
|
4564
|
+
*
|
|
4556
4565
|
*/
|
|
4557
4566
|
declare const MEMBER_SELECTORS: {
|
|
4558
4567
|
membersTab: string;
|
|
@@ -4582,6 +4591,8 @@ declare const MEMBER_SELECTORS: {
|
|
|
4582
4591
|
menubarSubLink: (sublink: string) => string;
|
|
4583
4592
|
takeActionStateOption: (option?: string) => string;
|
|
4584
4593
|
checkboxLabel: (label: string) => string;
|
|
4594
|
+
subscriptionPlanTag: string;
|
|
4595
|
+
memberNameCell: (nameOrEmail: string) => string;
|
|
4585
4596
|
};
|
|
4586
4597
|
/**
|
|
4587
4598
|
*
|
package/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import stealth$1 from 'puppeteer-extra-plugin-stealth';
|
|
|
15
15
|
import Stream$4 from 'stream';
|
|
16
16
|
import require$$0$4 from 'events';
|
|
17
17
|
import { getI18nInstance, initI18n } from 'playwright-i18next-fixture';
|
|
18
|
-
import { isNotPresent, isNotEmpty, humanize, dynamicArray, truncate, isPresent } from '@bigbinary/neeto-cist';
|
|
18
|
+
import { isNotPresent, isNotEmpty, humanize, keysToSnakeCase, dynamicArray, truncate, isPresent } from '@bigbinary/neeto-cist';
|
|
19
19
|
import http$1 from 'http';
|
|
20
20
|
import Url from 'url';
|
|
21
21
|
import require$$0$5 from 'punycode';
|
|
@@ -535,6 +535,8 @@ const MEMBER_SELECTORS = {
|
|
|
535
535
|
menubarSubLink: (sublink) => `members-${sublink}-block-sub-link`,
|
|
536
536
|
takeActionStateOption: (option = "") => `ntm-${hyphenize(option)}-members-button`,
|
|
537
537
|
checkboxLabel: (label) => `${hyphenize(label)}-checkbox-label`,
|
|
538
|
+
subscriptionPlanTag: "ntm-member-subscription-plan-tag",
|
|
539
|
+
memberNameCell: (nameOrEmail) => `ntm-member-name-${hyphenize(nameOrEmail)}`,
|
|
538
540
|
};
|
|
539
541
|
const MEMBER_FORM_SELECTORS = {
|
|
540
542
|
emailTextField: "email-select-input-field",
|
|
@@ -24177,7 +24179,7 @@ class MemberApis {
|
|
|
24177
24179
|
class Member {
|
|
24178
24180
|
constructor(neetoPlaywrightUtilities) {
|
|
24179
24181
|
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
24180
|
-
this.addMemberViaRequest = async ({ email, role = MEMBER_TEXTS.agent, appName, }) => {
|
|
24182
|
+
this.addMemberViaRequest = async ({ email, role = MEMBER_TEXTS.agent, appName, subscriptionPlan = "free", }) => {
|
|
24181
24183
|
let response;
|
|
24182
24184
|
await expect
|
|
24183
24185
|
.poll(async () => {
|
|
@@ -24187,6 +24189,7 @@ class Member {
|
|
|
24187
24189
|
app_roles: [
|
|
24188
24190
|
{ app_name: appName, active_role: role, is_enabled: true },
|
|
24189
24191
|
],
|
|
24192
|
+
subscription_plan: subscriptionPlan,
|
|
24190
24193
|
});
|
|
24191
24194
|
return response === null || response === void 0 ? void 0 : response.status();
|
|
24192
24195
|
}, { timeout: 30000 })
|
|
@@ -24200,21 +24203,22 @@ class Member {
|
|
|
24200
24203
|
const responseBodyBuffer = await (jobResponse === null || jobResponse === void 0 ? void 0 : jobResponse.body());
|
|
24201
24204
|
const { is_completed: isCompleted } = JSON.parse(String(responseBodyBuffer));
|
|
24202
24205
|
return isCompleted;
|
|
24203
|
-
}, { timeout:
|
|
24206
|
+
}, { timeout: 60000 })
|
|
24204
24207
|
.toBe(true);
|
|
24205
24208
|
};
|
|
24206
|
-
this.editMemberViaRequest = async ({ email, firstName, lastName, newRole, }) => {
|
|
24209
|
+
this.editMemberViaRequest = async ({ email, firstName, lastName, newRole, subscriptionPlan, }) => {
|
|
24207
24210
|
const responseBody = (await this.memberApis
|
|
24208
24211
|
.fetch({ search: email })
|
|
24209
24212
|
.then(response => response === null || response === void 0 ? void 0 : response.json()));
|
|
24210
24213
|
const memberDetails = responseBody === null || responseBody === void 0 ? void 0 : responseBody.members.find(({ email }) => email === email.toLowerCase());
|
|
24211
24214
|
memberDetails &&
|
|
24212
|
-
(await this.memberApis.update(memberDetails.id, {
|
|
24215
|
+
(await this.memberApis.update(memberDetails.id, keysToSnakeCase({
|
|
24213
24216
|
active: true,
|
|
24214
|
-
|
|
24215
|
-
|
|
24217
|
+
firstName,
|
|
24218
|
+
lastName,
|
|
24216
24219
|
organization_role: newRole,
|
|
24217
|
-
|
|
24220
|
+
subscriptionPlan,
|
|
24221
|
+
})));
|
|
24218
24222
|
};
|
|
24219
24223
|
this.deactivateMemberViaRequest = (email) => this.memberApis.bulkUpdate({ active: false, emails: [email] });
|
|
24220
24224
|
this.generateRandomTeamMembers = ({ count = 1, role = "standard" }) => dynamicArray(count, () => ({
|