@bigbinary/neeto-playwright-commons 1.13.1 → 1.13.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 +67 -0
- package/index.cjs.js.map +1 -1
- package/index.d.ts +142 -1
- package/index.js +68 -2
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -24118,6 +24118,72 @@ class ZapierPage extends IntegrationBase {
|
|
|
24118
24118
|
}
|
|
24119
24119
|
}
|
|
24120
24120
|
|
|
24121
|
+
class MemberApis {
|
|
24122
|
+
constructor(neetoPlaywrightUtilities) {
|
|
24123
|
+
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
24124
|
+
this.create = (body) => this.neetoPlaywrightUtilities.apiRequest({
|
|
24125
|
+
method: "post",
|
|
24126
|
+
url: "/team_members/teams",
|
|
24127
|
+
body: { user: body },
|
|
24128
|
+
});
|
|
24129
|
+
this.fetch = (params) => this.neetoPlaywrightUtilities.apiRequest({
|
|
24130
|
+
method: "get",
|
|
24131
|
+
url: "/team_members/teams",
|
|
24132
|
+
params,
|
|
24133
|
+
});
|
|
24134
|
+
this.update = (memberId, body) => this.neetoPlaywrightUtilities.apiRequest({
|
|
24135
|
+
method: "put",
|
|
24136
|
+
url: `/team_members/teams/${memberId}`,
|
|
24137
|
+
body: { team: body },
|
|
24138
|
+
});
|
|
24139
|
+
this.bulkUpdate = (body) => this.neetoPlaywrightUtilities.apiRequest({
|
|
24140
|
+
method: "patch",
|
|
24141
|
+
url: "/team_members/teams/bulk_update",
|
|
24142
|
+
body: { users: body },
|
|
24143
|
+
});
|
|
24144
|
+
}
|
|
24145
|
+
}
|
|
24146
|
+
|
|
24147
|
+
class Member {
|
|
24148
|
+
constructor(neetoPlaywrightUtilities) {
|
|
24149
|
+
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
24150
|
+
this.addMemberViaRequest = ({ email, role = MEMBER_TEXTS.agent, appName, }) => test$1.expect
|
|
24151
|
+
.poll(async () => {
|
|
24152
|
+
const response = await this.memberApis.create({
|
|
24153
|
+
emails: [email],
|
|
24154
|
+
organization_role: role,
|
|
24155
|
+
app_roles: [
|
|
24156
|
+
{ app_name: appName, active_role: role, is_enabled: true },
|
|
24157
|
+
],
|
|
24158
|
+
});
|
|
24159
|
+
return response === null || response === void 0 ? void 0 : response.status();
|
|
24160
|
+
}, { timeout: 30000 })
|
|
24161
|
+
.toBe(200);
|
|
24162
|
+
this.editMemberViaRequest = async ({ email, firstName, lastName, newRole, }) => {
|
|
24163
|
+
const response = await this.memberApis.fetch({ search: email });
|
|
24164
|
+
if (response) {
|
|
24165
|
+
const responseBodyBuffer = await response.body();
|
|
24166
|
+
const responseBody = JSON.parse(responseBodyBuffer.toString());
|
|
24167
|
+
const memberDetails = responseBody === null || responseBody === void 0 ? void 0 : responseBody.members[0];
|
|
24168
|
+
await this.memberApis.update(memberDetails.id, {
|
|
24169
|
+
active: true,
|
|
24170
|
+
first_name: firstName,
|
|
24171
|
+
last_name: lastName,
|
|
24172
|
+
organization_role: newRole,
|
|
24173
|
+
});
|
|
24174
|
+
}
|
|
24175
|
+
};
|
|
24176
|
+
this.deactivateMemberViaRequest = (email) => this.memberApis.bulkUpdate({ active: false, emails: [email] });
|
|
24177
|
+
this.generateRandomTeamMembers = ({ count = 1, role = "standard" }) => neetoCist.dynamicArray(count, () => ({
|
|
24178
|
+
firstName: faker.faker.person.firstName(),
|
|
24179
|
+
lastName: faker.faker.person.lastName(),
|
|
24180
|
+
email: faker.faker.internet.exampleEmail(),
|
|
24181
|
+
role,
|
|
24182
|
+
}));
|
|
24183
|
+
this.memberApis = new MemberApis(neetoPlaywrightUtilities);
|
|
24184
|
+
}
|
|
24185
|
+
}
|
|
24186
|
+
|
|
24121
24187
|
const DESCRIPTION_EDITOR_TEXTS = {
|
|
24122
24188
|
fontSize: "Font size",
|
|
24123
24189
|
paragraph: "Paragraph",
|
|
@@ -157354,6 +157420,7 @@ exports.MEMBER_TEXTS = MEMBER_TEXTS;
|
|
|
157354
157420
|
exports.MERGE_TAGS_SELECTORS = MERGE_TAGS_SELECTORS;
|
|
157355
157421
|
exports.MailerUtils = MailerUtils;
|
|
157356
157422
|
exports.MailosaurUtils = MailosaurUtils;
|
|
157423
|
+
exports.Member = Member;
|
|
157357
157424
|
exports.NEETO_AUTH_BASE_URL = NEETO_AUTH_BASE_URL;
|
|
157358
157425
|
exports.NEETO_EDITOR_SELECTORS = NEETO_EDITOR_SELECTORS;
|
|
157359
157426
|
exports.NEETO_FILTERS_SELECTORS = NEETO_FILTERS_SELECTORS;
|