@bigbinary/neeto-playwright-commons 1.24.4 → 1.24.5
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 +82 -33
- package/index.cjs.js.map +1 -1
- package/index.d.ts +529 -476
- package/index.js +82 -35
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -4445,6 +4445,11 @@ const DATE_RANGES = {
|
|
|
4445
4445
|
};
|
|
4446
4446
|
const CERTIFICATE_LIMIT_EXCEEDED_REGEXP = `too many certificates \\(\\d+\\) already issued for "${CUSTOM_DOMAIN_SUFFIX}"`;
|
|
4447
4447
|
const CERTIFICATE_LIMIT_EXCEEDED_MESSAGE = "Certificate limit exceeded for custom domain";
|
|
4448
|
+
const EXPORT_FILE_TYPES = {
|
|
4449
|
+
pdf: "pdf",
|
|
4450
|
+
excel: "excel",
|
|
4451
|
+
csv: "csv",
|
|
4452
|
+
};
|
|
4448
4453
|
|
|
4449
4454
|
const COMMON_SELECTORS = {
|
|
4450
4455
|
emailInputError: "email-input-error",
|
|
@@ -4598,6 +4603,7 @@ const COMMON_SELECTORS = {
|
|
|
4598
4603
|
columnSortableItem: "column-sortable-item",
|
|
4599
4604
|
columnsDropdownIcon: "columns-dropdown-icon",
|
|
4600
4605
|
columnDragHandle: "column-drag-handle",
|
|
4606
|
+
reactSelectContainer: ".neeto-ui-react-select__container",
|
|
4601
4607
|
};
|
|
4602
4608
|
|
|
4603
4609
|
const THANK_YOU_SELECTORS = {
|
|
@@ -5652,15 +5658,18 @@ class CustomCommands {
|
|
|
5652
5658
|
await test.expect(breadcrumbHeader).toHaveCount(titlesAndRoutes.length);
|
|
5653
5659
|
await Promise.all(titlesAndRoutes.map(({ title, route }) => test.expect(breadcrumbHeader.getByRole("link", { name: title, exact: true })).toHaveAttribute("href", route)));
|
|
5654
5660
|
};
|
|
5655
|
-
this.uploadFileViaDispatchV2 = async ({ droppableZone = this.page.getByTestId(COMMON_SELECTORS.fileUploadBody), dispatchEvent = "drop", file, }) => {
|
|
5661
|
+
this.uploadFileViaDispatchV2 = async ({ droppableZone = this.page.getByTestId(COMMON_SELECTORS.fileUploadBody), dispatchEvent = "drop", timeout = 30000, file, }) => {
|
|
5656
5662
|
const serializedFile = await serializeFileForBrowser(file);
|
|
5657
|
-
const dataTransfer = await
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5663
|
+
const dataTransfer = await Promise.race([
|
|
5664
|
+
droppableZone.evaluateHandle(async (_, { name, type, buffer, lastModified }) => {
|
|
5665
|
+
const uint8Array = new Uint8Array(buffer);
|
|
5666
|
+
const file = new File([uint8Array], name, { type, lastModified });
|
|
5667
|
+
const dataTransfer = new DataTransfer();
|
|
5668
|
+
dataTransfer.items.add(file);
|
|
5669
|
+
return dataTransfer;
|
|
5670
|
+
}, serializedFile),
|
|
5671
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error("File injection timed out")), timeout)),
|
|
5672
|
+
]);
|
|
5664
5673
|
await droppableZone.dispatchEvent(dispatchEvent, { dataTransfer });
|
|
5665
5674
|
};
|
|
5666
5675
|
this.verifyUnsavedChangesModal = async (shouldLeavePage = false) => {
|
|
@@ -116957,6 +116966,20 @@ class Member {
|
|
|
116957
116966
|
email: faker.faker.internet.exampleEmail(),
|
|
116958
116967
|
role,
|
|
116959
116968
|
}));
|
|
116969
|
+
this.getUserIdViaAPI = async (email) => {
|
|
116970
|
+
const response = await this.memberApis.fetch();
|
|
116971
|
+
const { members } = (await (response === null || response === void 0 ? void 0 : response.json()));
|
|
116972
|
+
const member = neetoCist.findBy({ email }, members);
|
|
116973
|
+
return member === null || member === void 0 ? void 0 : member.id;
|
|
116974
|
+
};
|
|
116975
|
+
this.updateEmailViaAPI = async ({ oldEmail, newEmail, role = "Admin", }) => {
|
|
116976
|
+
const userId = await this.getUserIdViaAPI(oldEmail);
|
|
116977
|
+
await this.memberApis.update(userId, neetoCist.keysToSnakeCase({
|
|
116978
|
+
organizationRole: role,
|
|
116979
|
+
email: newEmail,
|
|
116980
|
+
active: true,
|
|
116981
|
+
}));
|
|
116982
|
+
};
|
|
116960
116983
|
this.memberApis = new MemberApis(neetoPlaywrightUtilities);
|
|
116961
116984
|
}
|
|
116962
116985
|
}
|
|
@@ -117630,6 +117653,31 @@ class ImageUploader {
|
|
|
117630
117653
|
}
|
|
117631
117654
|
}
|
|
117632
117655
|
|
|
117656
|
+
const openFilterPane = async (page) => {
|
|
117657
|
+
await page.getByTestId(NEETO_FILTERS_SELECTORS.filterButton).click();
|
|
117658
|
+
await test.expect(page.getByTestId(COMMON_SELECTORS.paneHeader)).toHaveText(playwrightI18nextFixture.getI18nInstance().t("neetoFilters.common.filters"));
|
|
117659
|
+
};
|
|
117660
|
+
const clearFiltersFromActionBlock = async (page) => {
|
|
117661
|
+
const isClearButtonVisible = await page
|
|
117662
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
|
|
117663
|
+
.isVisible();
|
|
117664
|
+
if (isClearButtonVisible) {
|
|
117665
|
+
await page
|
|
117666
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
|
|
117667
|
+
.click();
|
|
117668
|
+
await Promise.all([
|
|
117669
|
+
test.expect(page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeHidden(),
|
|
117670
|
+
test.expect(page.locator(COMMON_SELECTORS.tableSpinner)).toHaveCount(0, {
|
|
117671
|
+
timeout: 15000,
|
|
117672
|
+
}),
|
|
117673
|
+
]);
|
|
117674
|
+
}
|
|
117675
|
+
};
|
|
117676
|
+
const filterUtils = {
|
|
117677
|
+
openFilterPane,
|
|
117678
|
+
clearFiltersFromActionBlock,
|
|
117679
|
+
};
|
|
117680
|
+
|
|
117633
117681
|
class TeamMembers {
|
|
117634
117682
|
constructor({ page, neetoPlaywrightUtilities, }) {
|
|
117635
117683
|
this.navigateToTeamMembers = async () => {
|
|
@@ -117829,6 +117877,26 @@ class TeamMembers {
|
|
|
117829
117877
|
.getByTestId(NEETO_FILTERS_SELECTORS.filterDoneButton)
|
|
117830
117878
|
.click();
|
|
117831
117879
|
};
|
|
117880
|
+
this.exportDetails = async (fileType, adminEmail) => {
|
|
117881
|
+
await this.page.getByTestId(MEMBER_SELECTORS.downloadButton).click();
|
|
117882
|
+
await test.expect(this.page.getByTestId(MEMBER_SELECTORS.exportMemberHeading)).toHaveText(this.t("neetoTeamMembers.exportPane.title"));
|
|
117883
|
+
await this.page
|
|
117884
|
+
.getByTestId(MEMBER_SELECTORS.downloadAsRadioItem(fileType))
|
|
117885
|
+
.check();
|
|
117886
|
+
const exportStartTime = new Date();
|
|
117887
|
+
await this.page.getByTestId(MEMBER_SELECTORS.exportSubmitBtn).click();
|
|
117888
|
+
await this.neetoPlaywrightUtilities.verifyToast({
|
|
117889
|
+
message: this.t("toastr.success.exportMembers", { email: adminEmail }),
|
|
117890
|
+
});
|
|
117891
|
+
return exportStartTime;
|
|
117892
|
+
};
|
|
117893
|
+
this.verifyNoDataTitle = async (email) => {
|
|
117894
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
117895
|
+
await this.page.getByTestId(MEMBER_SELECTORS.searchTextField).fill(email);
|
|
117896
|
+
await test.expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeVisible();
|
|
117897
|
+
await test.expect(this.page.getByTestId(COMMON_SELECTORS.noDataTitle)).toBeVisible({ timeout: 10000 });
|
|
117898
|
+
await filterUtils.clearFiltersFromActionBlock(this.page);
|
|
117899
|
+
};
|
|
117832
117900
|
this.page = page;
|
|
117833
117901
|
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
117834
117902
|
this.t = playwrightI18nextFixture.getI18nInstance().t;
|
|
@@ -118661,6 +118729,10 @@ const FILE_FORMATS = {
|
|
|
118661
118729
|
gif: "gif",
|
|
118662
118730
|
};
|
|
118663
118731
|
|
|
118732
|
+
const TEAM_MEMBER_TEXTS = {
|
|
118733
|
+
emailSubject: "Your team members export is here",
|
|
118734
|
+
};
|
|
118735
|
+
|
|
118664
118736
|
const PHONE_NUMBER_FORMATS = [
|
|
118665
118737
|
{ name: "Afghanistan", code: "+93", format: "70#######", flag: "🇦🇫" },
|
|
118666
118738
|
{ name: "Aland", code: "+358", format: "5####", flag: "🇦🇽" },
|
|
@@ -119170,31 +119242,6 @@ const executeWithThrottledResources = async ({ code: emulatedCode, kind = "both"
|
|
|
119170
119242
|
await cpuThrottlingUsingCDP({ cdpSession, rate: 1 });
|
|
119171
119243
|
};
|
|
119172
119244
|
|
|
119173
|
-
const openFilterPane = async (page) => {
|
|
119174
|
-
await page.getByTestId(NEETO_FILTERS_SELECTORS.filterButton).click();
|
|
119175
|
-
await test.expect(page.getByTestId(COMMON_SELECTORS.paneHeader)).toHaveText(playwrightI18nextFixture.getI18nInstance().t("neetoFilters.common.filters"));
|
|
119176
|
-
};
|
|
119177
|
-
const clearFiltersFromActionBlock = async (page) => {
|
|
119178
|
-
const isClearButtonVisible = await page
|
|
119179
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
|
|
119180
|
-
.isVisible();
|
|
119181
|
-
if (isClearButtonVisible) {
|
|
119182
|
-
await page
|
|
119183
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
|
|
119184
|
-
.click();
|
|
119185
|
-
await Promise.all([
|
|
119186
|
-
test.expect(page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeHidden(),
|
|
119187
|
-
test.expect(page.locator(COMMON_SELECTORS.tableSpinner)).toHaveCount(0, {
|
|
119188
|
-
timeout: 15000,
|
|
119189
|
-
}),
|
|
119190
|
-
]);
|
|
119191
|
-
}
|
|
119192
|
-
};
|
|
119193
|
-
const filterUtils = {
|
|
119194
|
-
openFilterPane,
|
|
119195
|
-
clearFiltersFromActionBlock,
|
|
119196
|
-
};
|
|
119197
|
-
|
|
119198
119245
|
const getAmountWithSymbol = (amount, options) => {
|
|
119199
119246
|
const formatter = new Intl.NumberFormat(dayjs.locale(), {
|
|
119200
119247
|
...options,
|
|
@@ -124069,6 +124116,7 @@ exports.EMPTY_STORAGE_STATE = EMPTY_STORAGE_STATE;
|
|
|
124069
124116
|
exports.ENGAGE_TEXTS = ENGAGE_TEXTS;
|
|
124070
124117
|
exports.ENVIRONMENT = ENVIRONMENT;
|
|
124071
124118
|
exports.EXPANDED_FONT_SIZE = EXPANDED_FONT_SIZE;
|
|
124119
|
+
exports.EXPORT_FILE_TYPES = EXPORT_FILE_TYPES;
|
|
124072
124120
|
exports.EditorPage = EditorPage;
|
|
124073
124121
|
exports.EmbedBase = EmbedBase;
|
|
124074
124122
|
exports.FILE_FORMATS = FILE_FORMATS;
|
|
@@ -124139,6 +124187,7 @@ exports.SlackPage = SlackPage;
|
|
|
124139
124187
|
exports.TABLE_SELECTORS = TABLE_SELECTORS;
|
|
124140
124188
|
exports.TAB_SELECTORS = TAB_SELECTORS;
|
|
124141
124189
|
exports.TAGS_SELECTORS = TAGS_SELECTORS;
|
|
124190
|
+
exports.TEAM_MEMBER_TEXTS = TEAM_MEMBER_TEXTS;
|
|
124142
124191
|
exports.TEXT_MODIFIER_ROLES = TEXT_MODIFIER_ROLES;
|
|
124143
124192
|
exports.TEXT_MODIFIER_SELECTORS = TEXT_MODIFIER_SELECTORS;
|
|
124144
124193
|
exports.TEXT_MODIFIER_TAGS = TEXT_MODIFIER_TAGS;
|