@bigbinary/neeto-playwright-commons 3.3.9 → 3.3.11
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 +313 -294
- package/index.cjs.js.map +1 -1
- package/index.d.ts +6 -9
- package/index.js +313 -295
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -83,7 +83,7 @@ const ROUTES = {
|
|
|
83
83
|
dashboard: "/dashboard",
|
|
84
84
|
neetoThankYou: "/neeto_thank_you_engine",
|
|
85
85
|
adminPanel: {
|
|
86
|
-
roles: "/admin/
|
|
86
|
+
roles: "/admin/admin-panel/general/roles",
|
|
87
87
|
index: "/admin/admin-panel",
|
|
88
88
|
auditLogs: "/admin/admin-panel/general/audit-logs",
|
|
89
89
|
apiKeys: "/admin/admin-panel/general/apiKeys",
|
|
@@ -245,6 +245,14 @@ const APP_RESOURCES = [
|
|
|
245
245
|
"**/neeto_widget_tokens",
|
|
246
246
|
];
|
|
247
247
|
const ALL_RESOURCES = Array.from(new Set([...THIRD_PARTY_RESOURCES, ...APP_RESOURCES]));
|
|
248
|
+
const PRODUCT_ROLES_ROUTE_MAP = {
|
|
249
|
+
crm: "/admin/admin-panel/manageUsers/roles",
|
|
250
|
+
planner: "/admin-panel/general/roles",
|
|
251
|
+
...Object.fromEntries(["code", "runner", "ci", "git", "tower", "quiz"].map(product => [
|
|
252
|
+
product,
|
|
253
|
+
"/admin/admin-panel/roles",
|
|
254
|
+
])),
|
|
255
|
+
};
|
|
248
256
|
|
|
249
257
|
class ApiKeysApi {
|
|
250
258
|
neetoPlaywrightUtilities;
|
|
@@ -934,7 +942,7 @@ const COMMON_SELECTORS = {
|
|
|
934
942
|
profileSidebar: "profile-section",
|
|
935
943
|
selectOption: (label) => `${neetoCist.hyphenate(label)}-select-option`,
|
|
936
944
|
radioLabel: (embedLabel) => `${neetoCist.hyphenate(embedLabel)}-radio-label`,
|
|
937
|
-
neetoUiToastr: ".Toastify__toast", // TODO: Replace this with ".neeto-ui-toastr"
|
|
945
|
+
neetoUiToastr: ".Toastify__toast, .cn-toast", // TODO: Replace this with ".neeto-ui-toastr"
|
|
938
946
|
toastMessage: (type) => `toastr-${type}-container`,
|
|
939
947
|
toastCloseButton: "toastr-close-button",
|
|
940
948
|
windowAlert: "#alert-box",
|
|
@@ -2478,278 +2486,6 @@ const THEMES_TEXTS = {
|
|
|
2478
2486
|
darkThemeClass: /neeto-ui-theme--dark/,
|
|
2479
2487
|
};
|
|
2480
2488
|
|
|
2481
|
-
const openFilterPane = async (page) => {
|
|
2482
|
-
await page
|
|
2483
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.filterButton)
|
|
2484
|
-
.or(page.getByTestId(COMMON_SELECTORS.filterButon))
|
|
2485
|
-
.click();
|
|
2486
|
-
await test.expect(page.getByTestId(COMMON_SELECTORS.paneHeader)).toHaveText(playwrightI18nextFixture.getI18nInstance().t("neetoFilters.common.filters"));
|
|
2487
|
-
};
|
|
2488
|
-
const clearFiltersFromActionBlock = async (page) => {
|
|
2489
|
-
const isClearButtonVisible = await page
|
|
2490
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
|
|
2491
|
-
.isVisible();
|
|
2492
|
-
if (isClearButtonVisible) {
|
|
2493
|
-
await page
|
|
2494
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
|
|
2495
|
-
.click();
|
|
2496
|
-
await Promise.all([
|
|
2497
|
-
test.expect(page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeHidden(),
|
|
2498
|
-
test.expect(page.locator(COMMON_SELECTORS.tableSpinner)).toHaveCount(0, {
|
|
2499
|
-
timeout: 15_000,
|
|
2500
|
-
}),
|
|
2501
|
-
]);
|
|
2502
|
-
}
|
|
2503
|
-
};
|
|
2504
|
-
const filterUtils = {
|
|
2505
|
-
openFilterPane,
|
|
2506
|
-
clearFiltersFromActionBlock,
|
|
2507
|
-
};
|
|
2508
|
-
|
|
2509
|
-
class TeamMembers {
|
|
2510
|
-
page;
|
|
2511
|
-
neetoPlaywrightUtilities;
|
|
2512
|
-
t;
|
|
2513
|
-
constructor({ page, neetoPlaywrightUtilities, }) {
|
|
2514
|
-
this.page = page;
|
|
2515
|
-
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
2516
|
-
this.t = playwrightI18nextFixture.getI18nInstance().t;
|
|
2517
|
-
}
|
|
2518
|
-
navigateToTeamMembers = async () => {
|
|
2519
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2520
|
-
await this.page.getByTestId(MEMBER_SELECTORS.membersTab).click();
|
|
2521
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2522
|
-
};
|
|
2523
|
-
openMemberPane = async () => {
|
|
2524
|
-
await this.page.getByTestId(MEMBER_SELECTORS.newButton).click();
|
|
2525
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2526
|
-
const continueButton = this.page.getByTestId(MEMBER_SELECTORS.continueButton);
|
|
2527
|
-
await test.expect(continueButton).toBeVisible();
|
|
2528
|
-
await test.expect(continueButton.getByTestId(COMMON_SELECTORS.uiSpinner)).toBeHidden({ timeout: 35_000 });
|
|
2529
|
-
};
|
|
2530
|
-
fillMemberForm = async (emails, role) => {
|
|
2531
|
-
await this.page
|
|
2532
|
-
.getByTestId(MEMBER_FORM_SELECTORS.emailTextField)
|
|
2533
|
-
.fill(emails.join(", "));
|
|
2534
|
-
await this.page.keyboard.press("Enter");
|
|
2535
|
-
role &&
|
|
2536
|
-
(await this.neetoPlaywrightUtilities.toggleElement({
|
|
2537
|
-
locator: this.page.getByTestId(MEMBER_SELECTORS.roleLabel(role)),
|
|
2538
|
-
}));
|
|
2539
|
-
const continueBtn = this.page.getByTestId(MEMBER_SELECTORS.continueButton);
|
|
2540
|
-
await continueBtn.click();
|
|
2541
|
-
if (IS_DEV_ENV)
|
|
2542
|
-
return;
|
|
2543
|
-
await this.page
|
|
2544
|
-
.getByTestId(COMMON_SELECTORS.paneBody)
|
|
2545
|
-
.getByTestId(COMMON_SELECTORS.checkboxLabel)
|
|
2546
|
-
.click();
|
|
2547
|
-
await continueBtn.click();
|
|
2548
|
-
};
|
|
2549
|
-
addMemberViaUI = async ({ emails = [faker.faker.internet.exampleEmail()], role = "standard", } = {}) => {
|
|
2550
|
-
await this.openMemberPane();
|
|
2551
|
-
await this.fillMemberForm(emails, role);
|
|
2552
|
-
await this.submit();
|
|
2553
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2554
|
-
};
|
|
2555
|
-
submit = async () => {
|
|
2556
|
-
const pane = this.page.getByTestId(COMMON_SELECTORS.paneBody);
|
|
2557
|
-
const submitBtn = this.page.getByTestId(MEMBER_SELECTORS.submitButton);
|
|
2558
|
-
const buttonSpinner = submitBtn.getByTestId(COMMON_SELECTORS.uiSpinner);
|
|
2559
|
-
await test.expect(submitBtn).toBeVisible({ timeout: 10_000 });
|
|
2560
|
-
await test.expect(async () => {
|
|
2561
|
-
if (await pane.isHidden())
|
|
2562
|
-
return;
|
|
2563
|
-
(await buttonSpinner.isHidden()) && (await submitBtn.click());
|
|
2564
|
-
await test.expect(buttonSpinner).toBeHidden({ timeout: 10_000 });
|
|
2565
|
-
await test.expect(pane).toBeHidden();
|
|
2566
|
-
}).toPass({ timeout: 60_000 });
|
|
2567
|
-
await this.neetoPlaywrightUtilities.verifyToast();
|
|
2568
|
-
};
|
|
2569
|
-
searchAndVerifyMemberByEmail = async ({ email }) => {
|
|
2570
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2571
|
-
await this.page.getByTestId(MEMBER_SELECTORS.searchTextField).fill(email);
|
|
2572
|
-
const emailSubstr = email.length > 20 ? email.substring(0, 20) : email;
|
|
2573
|
-
await test.expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.searchTermBlock)).toContainText(emailSubstr);
|
|
2574
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2575
|
-
await test.expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
2576
|
-
await test.expect(this.page.getByRole("cell", { name: email, exact: true })).toBeVisible();
|
|
2577
|
-
};
|
|
2578
|
-
editMemberViaUI = async ({ email = "", firstName = "", lastName = "", role = "standard", } = {}) => {
|
|
2579
|
-
await this.page.getByTestId(MEMBER_SELECTORS.dropDownIcon).click();
|
|
2580
|
-
await this.page.getByTestId(MEMBER_SELECTORS.editButton).click();
|
|
2581
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2582
|
-
neetoCist.isPresent(email) &&
|
|
2583
|
-
(await this.page
|
|
2584
|
-
.getByTestId(MEMBER_FORM_SELECTORS.emailInput)
|
|
2585
|
-
.fill(email));
|
|
2586
|
-
neetoCist.isPresent(firstName) &&
|
|
2587
|
-
(await this.page
|
|
2588
|
-
.getByTestId(MEMBER_FORM_SELECTORS.firstNameTextField)
|
|
2589
|
-
.fill(firstName));
|
|
2590
|
-
neetoCist.isPresent(lastName) &&
|
|
2591
|
-
(await this.page
|
|
2592
|
-
.getByTestId(MEMBER_FORM_SELECTORS.lastNameTextField)
|
|
2593
|
-
.fill(lastName));
|
|
2594
|
-
await this.neetoPlaywrightUtilities.toggleElement({
|
|
2595
|
-
locator: this.page.getByTestId(MEMBER_SELECTORS.roleLabel(role)),
|
|
2596
|
-
});
|
|
2597
|
-
await this.submit();
|
|
2598
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2599
|
-
};
|
|
2600
|
-
removeMemberViaUI = async (parentLocator = this.page) => {
|
|
2601
|
-
await parentLocator.getByTestId(MEMBER_SELECTORS.dropDownIcon).click();
|
|
2602
|
-
await this.page.getByTestId(MEMBER_SELECTORS.removeMember).click();
|
|
2603
|
-
await this.page
|
|
2604
|
-
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
2605
|
-
.click();
|
|
2606
|
-
await this.neetoPlaywrightUtilities.verifyToast();
|
|
2607
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2608
|
-
};
|
|
2609
|
-
filterMembersByMultiSelect = async ({ selectedOptions = [], selectContainerLocator = NEETO_FILTERS_SELECTORS.roleSelectContainer, }) => {
|
|
2610
|
-
await this.page
|
|
2611
|
-
.getByTestId(selectContainerLocator)
|
|
2612
|
-
.getByTestId(COMMON_SELECTORS.actionSelectIndicator)
|
|
2613
|
-
.click();
|
|
2614
|
-
for (const option of selectedOptions) {
|
|
2615
|
-
await this.page
|
|
2616
|
-
.getByTestId(COMMON_SELECTORS.selectOption(option))
|
|
2617
|
-
.click();
|
|
2618
|
-
}
|
|
2619
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2620
|
-
await test.expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
2621
|
-
};
|
|
2622
|
-
filterMembers = async ({ email = { id: "", condition: "Is" }, roles = [], name = "", }) => {
|
|
2623
|
-
await filterUtils.clearFiltersFromActionBlock(this.page);
|
|
2624
|
-
await filterUtils.openFilterPane(this.page);
|
|
2625
|
-
if (neetoCist.isPresent(email.id)) {
|
|
2626
|
-
await this.page
|
|
2627
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.emailSelectContainer)
|
|
2628
|
-
.getByTestId(COMMON_SELECTORS.actionSelectIndicator)
|
|
2629
|
-
.click();
|
|
2630
|
-
await this.page
|
|
2631
|
-
.getByTestId(COMMON_SELECTORS.selectOption(email.condition))
|
|
2632
|
-
.click();
|
|
2633
|
-
await this.page
|
|
2634
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.filtersEmailFilter)
|
|
2635
|
-
.fill(email.id);
|
|
2636
|
-
}
|
|
2637
|
-
neetoCist.isPresent(name) &&
|
|
2638
|
-
(await this.page
|
|
2639
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersNameFilterField)
|
|
2640
|
-
.fill(name));
|
|
2641
|
-
neetoCist.isPresent(roles) &&
|
|
2642
|
-
(await this.filterMembersByMultiSelect({ selectedOptions: roles }));
|
|
2643
|
-
await this.applyFilter();
|
|
2644
|
-
};
|
|
2645
|
-
getMemberRowByName = (name) => this.page.getByRole("row").filter({
|
|
2646
|
-
has: this.page.getByTestId(MEMBER_SELECTORS.memberNameCell(name)),
|
|
2647
|
-
});
|
|
2648
|
-
takeActionOnMembers = async ({ names = [], state, action, }) => {
|
|
2649
|
-
if (neetoCist.isPresent(names)) {
|
|
2650
|
-
for (const name of names) {
|
|
2651
|
-
await this.getMemberRowByName(name).getByRole("checkbox").click();
|
|
2652
|
-
}
|
|
2653
|
-
}
|
|
2654
|
-
else {
|
|
2655
|
-
await this.page
|
|
2656
|
-
.getByRole("columnheader", { name: MEMBER_TEXTS.selectAll })
|
|
2657
|
-
.click();
|
|
2658
|
-
}
|
|
2659
|
-
await this.page.getByTestId(COMMON_SELECTORS.takeActionDropdown).click();
|
|
2660
|
-
if (neetoCist.isPresent(state)) {
|
|
2661
|
-
await this.page
|
|
2662
|
-
.getByTestId(MEMBER_SELECTORS.takeActionStateOption(state))
|
|
2663
|
-
.click();
|
|
2664
|
-
}
|
|
2665
|
-
else {
|
|
2666
|
-
await this.page
|
|
2667
|
-
.getByRole("button", { name: action?.actionButtonText })
|
|
2668
|
-
.click();
|
|
2669
|
-
await this.page
|
|
2670
|
-
.getByRole("button", { name: action?.valueButtonText })
|
|
2671
|
-
.click();
|
|
2672
|
-
}
|
|
2673
|
-
await this.page
|
|
2674
|
-
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
2675
|
-
.click();
|
|
2676
|
-
await this.neetoPlaywrightUtilities.verifyToast();
|
|
2677
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2678
|
-
};
|
|
2679
|
-
performColumnAction = async ({ columnName = "Name", actionButtonText = "Ascending", } = {}) => {
|
|
2680
|
-
await this.page
|
|
2681
|
-
.getByTestId(MEMBER_SELECTORS.teamMembersTable)
|
|
2682
|
-
.getByLabel(columnName)
|
|
2683
|
-
.getByTestId(TABLE_SELECTORS.columnMenuButton)
|
|
2684
|
-
.click();
|
|
2685
|
-
await this.page.getByRole("button", { name: actionButtonText }).click();
|
|
2686
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2687
|
-
await test.expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
2688
|
-
};
|
|
2689
|
-
toggleMemberColumns = async ({ columns = [], bulkAction, }) => {
|
|
2690
|
-
await test.expect(async () => {
|
|
2691
|
-
await this.page
|
|
2692
|
-
.getByTestId(COMMON_SELECTORS.columnsDropdownButton)
|
|
2693
|
-
.click();
|
|
2694
|
-
await test.expect(this.page.getByTestId(COMMON_SELECTORS.columnsSearchInput)).toBeVisible();
|
|
2695
|
-
}).toPass({ timeout: 15_000 });
|
|
2696
|
-
if (neetoCist.isPresent(bulkAction)) {
|
|
2697
|
-
await this.page
|
|
2698
|
-
.getByTestId(COMMON_SELECTORS.columnVisibilityBtn(bulkAction === "hide" ? "hide-all" : "reset"))
|
|
2699
|
-
.click();
|
|
2700
|
-
}
|
|
2701
|
-
else {
|
|
2702
|
-
for (const column of columns) {
|
|
2703
|
-
await this.page
|
|
2704
|
-
.getByTestId(COMMON_SELECTORS.columnsSearchInput)
|
|
2705
|
-
.fill(column);
|
|
2706
|
-
const columnCheckbox = this.page
|
|
2707
|
-
.getByTestId(COMMON_SELECTORS.nuiCheckboxContainer)
|
|
2708
|
-
.filter({ hasText: column })
|
|
2709
|
-
.getByTestId(MEMBER_SELECTORS.columnCheckBox);
|
|
2710
|
-
const isChecked = await columnCheckbox.isChecked();
|
|
2711
|
-
await columnCheckbox.click();
|
|
2712
|
-
await test.expect(columnCheckbox).toBeChecked({ checked: !isChecked });
|
|
2713
|
-
}
|
|
2714
|
-
}
|
|
2715
|
-
await this.page.getByTestId(COMMON_SELECTORS.columnsDropdownButton).click();
|
|
2716
|
-
};
|
|
2717
|
-
verifyMemberInTable = ({ name, email }) => test.expect(this.getMemberRowByName(name).getByRole("cell", {
|
|
2718
|
-
name: email,
|
|
2719
|
-
exact: true,
|
|
2720
|
-
})).toBeVisible();
|
|
2721
|
-
applyFilter = async () => {
|
|
2722
|
-
await test.expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeVisible();
|
|
2723
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2724
|
-
await test.expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden({
|
|
2725
|
-
timeout: 30_000,
|
|
2726
|
-
});
|
|
2727
|
-
await this.page
|
|
2728
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.filterDoneButton)
|
|
2729
|
-
.click();
|
|
2730
|
-
};
|
|
2731
|
-
exportDetails = async (fileType, adminEmail) => {
|
|
2732
|
-
await this.page.getByTestId(MEMBER_SELECTORS.downloadButton).click();
|
|
2733
|
-
await test.expect(this.page.getByTestId(MEMBER_SELECTORS.exportMemberHeading)).toHaveText(this.t("neetoTeamMembers.exportPane.title"));
|
|
2734
|
-
await this.page
|
|
2735
|
-
.getByTestId(MEMBER_SELECTORS.downloadAsRadioItem(fileType))
|
|
2736
|
-
.check();
|
|
2737
|
-
const exportStartTime = new Date();
|
|
2738
|
-
await this.page.getByTestId(MEMBER_SELECTORS.exportSubmitBtn).click();
|
|
2739
|
-
await this.neetoPlaywrightUtilities.verifyToast({
|
|
2740
|
-
message: this.t("toastr.success.exportMembers", { email: adminEmail }),
|
|
2741
|
-
});
|
|
2742
|
-
return exportStartTime;
|
|
2743
|
-
};
|
|
2744
|
-
verifyNoDataTitle = async (email) => {
|
|
2745
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2746
|
-
await this.page.getByTestId(MEMBER_SELECTORS.searchTextField).fill(email);
|
|
2747
|
-
await test.expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeVisible();
|
|
2748
|
-
await test.expect(this.page.getByTestId(COMMON_SELECTORS.noDataTitle)).toBeVisible({ timeout: 10_000 });
|
|
2749
|
-
await filterUtils.clearFiltersFromActionBlock(this.page);
|
|
2750
|
-
};
|
|
2751
|
-
}
|
|
2752
|
-
|
|
2753
2489
|
const fillCredentialsAndSubmit = async ({ page, loginPath, email = CREDENTIALS.email, }) => {
|
|
2754
2490
|
loginPath && (await page.goto(loginPath, { timeout: 30_000 }));
|
|
2755
2491
|
await page.waitForLoadState("load", { timeout: 35_000 });
|
|
@@ -18336,18 +18072,23 @@ class Health {
|
|
|
18336
18072
|
neetoPlaywrightUtilities;
|
|
18337
18073
|
email = process.env.PLAYWRIGHT_PRODUCTION_EMAIL;
|
|
18338
18074
|
loginPage;
|
|
18339
|
-
teamMembers;
|
|
18340
18075
|
constructor(page, neetoPlaywrightUtilities) {
|
|
18341
18076
|
this.page = page;
|
|
18342
18077
|
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
18343
18078
|
if (!process.env.PLAYWRIGHT_PRODUCTION_EMAIL ||
|
|
18344
|
-
!process.env.PLAYWRIGHT_PRODUCTION_2FA_SECRET_KEY
|
|
18345
|
-
|
|
18346
|
-
throw new Error("One or more required env variables are missing: PLAYWRIGHT_PRODUCTION_EMAIL, PLAYWRIGHT_PRODUCTION_2FA_SECRET_KEY, FASTMAIL_DOMAIN_NAME");
|
|
18079
|
+
!process.env.PLAYWRIGHT_PRODUCTION_2FA_SECRET_KEY) {
|
|
18080
|
+
throw new Error("One or more required env variables are missing: PLAYWRIGHT_PRODUCTION_EMAIL, PLAYWRIGHT_PRODUCTION_2FA_SECRET_KEY");
|
|
18347
18081
|
}
|
|
18348
18082
|
this.loginPage = new OrganizationPage(page, neetoPlaywrightUtilities);
|
|
18349
|
-
this.teamMembers = new TeamMembers({ page, neetoPlaywrightUtilities });
|
|
18350
18083
|
}
|
|
18084
|
+
getProductSpecificRolesRoute = () => {
|
|
18085
|
+
const { hostname } = new URL(process.env.PLAYWRIGHT_PRODUCTION_BASE_URL);
|
|
18086
|
+
const domain = hostname
|
|
18087
|
+
.split(".")
|
|
18088
|
+
.find(domain => domain.startsWith("neeto"));
|
|
18089
|
+
const product = domain.replace(/^neeto/, "").toLowerCase();
|
|
18090
|
+
return PRODUCT_ROLES_ROUTE_MAP[product] ?? ROUTES.adminPanel.roles;
|
|
18091
|
+
};
|
|
18351
18092
|
loginToApp = async (route = ROUTES.adminPanel.index) => {
|
|
18352
18093
|
await this.page.goto(route);
|
|
18353
18094
|
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
@@ -18361,25 +18102,30 @@ class Health {
|
|
|
18361
18102
|
verifyAppIsLive = async (customSteps) => {
|
|
18362
18103
|
await test.step("1: Login to the application", () => this.loginToApp());
|
|
18363
18104
|
await test.step("2: Verify application UI", this.verifyAppUI);
|
|
18364
|
-
await test.step("3: Navigate to
|
|
18365
|
-
await this.page.goto(
|
|
18105
|
+
await test.step("3: Navigate to roles page", async () => {
|
|
18106
|
+
await this.page.goto(this.getProductSpecificRolesRoute());
|
|
18366
18107
|
await this.neetoPlaywrightUtilities.waitForFloatingMenu();
|
|
18367
18108
|
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
18368
18109
|
});
|
|
18369
|
-
await test.step("4: Verify adding & removing
|
|
18370
|
-
const
|
|
18371
|
-
|
|
18372
|
-
|
|
18373
|
-
|
|
18374
|
-
|
|
18110
|
+
await test.step("4: Verify adding & removing roles", async () => {
|
|
18111
|
+
const roleName = faker.faker.string.alphanumeric(8);
|
|
18112
|
+
await this.page.getByTestId(ROLES_SELECTORS.newButton).click();
|
|
18113
|
+
await this.page.getByTestId(ROLES_SELECTORS.nameTextField).fill(roleName);
|
|
18114
|
+
await this.neetoPlaywrightUtilities.clickButtonAndAwaitLoad({
|
|
18115
|
+
locator: this.page.getByTestId(ROLES_SELECTORS.proceedButton),
|
|
18375
18116
|
});
|
|
18376
|
-
await this.
|
|
18377
|
-
|
|
18378
|
-
|
|
18379
|
-
|
|
18380
|
-
|
|
18381
|
-
await
|
|
18382
|
-
await
|
|
18117
|
+
await this.neetoPlaywrightUtilities.verifyToast();
|
|
18118
|
+
const roleHeaderDropDown = this.page
|
|
18119
|
+
.getByTestId(ROLES_SELECTORS.tableHeaderRoleName)
|
|
18120
|
+
.filter({ hasText: roleName })
|
|
18121
|
+
.getByTestId(ROLES_SELECTORS.dropDownIcon);
|
|
18122
|
+
await roleHeaderDropDown.click();
|
|
18123
|
+
await this.page.getByTestId(ROLES_SELECTORS.deleteRoleButton).click();
|
|
18124
|
+
await this.neetoPlaywrightUtilities.clickButtonAndAwaitLoad({
|
|
18125
|
+
locator: this.page.getByTestId(COMMON_SELECTORS.alertModalSubmitButton),
|
|
18126
|
+
});
|
|
18127
|
+
await this.neetoPlaywrightUtilities.verifyToast();
|
|
18128
|
+
await test.expect(roleHeaderDropDown).toBeHidden({ timeout: 10_000 });
|
|
18383
18129
|
});
|
|
18384
18130
|
await customSteps?.();
|
|
18385
18131
|
};
|
|
@@ -121621,6 +121367,278 @@ class ImageUploader {
|
|
|
121621
121367
|
};
|
|
121622
121368
|
}
|
|
121623
121369
|
|
|
121370
|
+
const openFilterPane = async (page) => {
|
|
121371
|
+
await page
|
|
121372
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.filterButton)
|
|
121373
|
+
.or(page.getByTestId(COMMON_SELECTORS.filterButon))
|
|
121374
|
+
.click();
|
|
121375
|
+
await test.expect(page.getByTestId(COMMON_SELECTORS.paneHeader)).toHaveText(playwrightI18nextFixture.getI18nInstance().t("neetoFilters.common.filters"));
|
|
121376
|
+
};
|
|
121377
|
+
const clearFiltersFromActionBlock = async (page) => {
|
|
121378
|
+
const isClearButtonVisible = await page
|
|
121379
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
|
|
121380
|
+
.isVisible();
|
|
121381
|
+
if (isClearButtonVisible) {
|
|
121382
|
+
await page
|
|
121383
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
|
|
121384
|
+
.click();
|
|
121385
|
+
await Promise.all([
|
|
121386
|
+
test.expect(page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeHidden(),
|
|
121387
|
+
test.expect(page.locator(COMMON_SELECTORS.tableSpinner)).toHaveCount(0, {
|
|
121388
|
+
timeout: 15_000,
|
|
121389
|
+
}),
|
|
121390
|
+
]);
|
|
121391
|
+
}
|
|
121392
|
+
};
|
|
121393
|
+
const filterUtils = {
|
|
121394
|
+
openFilterPane,
|
|
121395
|
+
clearFiltersFromActionBlock,
|
|
121396
|
+
};
|
|
121397
|
+
|
|
121398
|
+
class TeamMembers {
|
|
121399
|
+
page;
|
|
121400
|
+
neetoPlaywrightUtilities;
|
|
121401
|
+
t;
|
|
121402
|
+
constructor({ page, neetoPlaywrightUtilities, }) {
|
|
121403
|
+
this.page = page;
|
|
121404
|
+
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
121405
|
+
this.t = playwrightI18nextFixture.getI18nInstance().t;
|
|
121406
|
+
}
|
|
121407
|
+
navigateToTeamMembers = async () => {
|
|
121408
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121409
|
+
await this.page.getByTestId(MEMBER_SELECTORS.membersTab).click();
|
|
121410
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121411
|
+
};
|
|
121412
|
+
openMemberPane = async () => {
|
|
121413
|
+
await this.page.getByTestId(MEMBER_SELECTORS.newButton).click();
|
|
121414
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121415
|
+
const continueButton = this.page.getByTestId(MEMBER_SELECTORS.continueButton);
|
|
121416
|
+
await test.expect(continueButton).toBeVisible();
|
|
121417
|
+
await test.expect(continueButton.getByTestId(COMMON_SELECTORS.uiSpinner)).toBeHidden({ timeout: 35_000 });
|
|
121418
|
+
};
|
|
121419
|
+
fillMemberForm = async (emails, role) => {
|
|
121420
|
+
await this.page
|
|
121421
|
+
.getByTestId(MEMBER_FORM_SELECTORS.emailTextField)
|
|
121422
|
+
.fill(emails.join(", "));
|
|
121423
|
+
await this.page.keyboard.press("Enter");
|
|
121424
|
+
role &&
|
|
121425
|
+
(await this.neetoPlaywrightUtilities.toggleElement({
|
|
121426
|
+
locator: this.page.getByTestId(MEMBER_SELECTORS.roleLabel(role)),
|
|
121427
|
+
}));
|
|
121428
|
+
const continueBtn = this.page.getByTestId(MEMBER_SELECTORS.continueButton);
|
|
121429
|
+
await continueBtn.click();
|
|
121430
|
+
if (IS_DEV_ENV)
|
|
121431
|
+
return;
|
|
121432
|
+
await this.page
|
|
121433
|
+
.getByTestId(COMMON_SELECTORS.paneBody)
|
|
121434
|
+
.getByTestId(COMMON_SELECTORS.checkboxLabel)
|
|
121435
|
+
.click();
|
|
121436
|
+
await continueBtn.click();
|
|
121437
|
+
};
|
|
121438
|
+
addMemberViaUI = async ({ emails = [faker.faker.internet.exampleEmail()], role = "standard", } = {}) => {
|
|
121439
|
+
await this.openMemberPane();
|
|
121440
|
+
await this.fillMemberForm(emails, role);
|
|
121441
|
+
await this.submit();
|
|
121442
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121443
|
+
};
|
|
121444
|
+
submit = async () => {
|
|
121445
|
+
const pane = this.page.getByTestId(COMMON_SELECTORS.paneBody);
|
|
121446
|
+
const submitBtn = this.page.getByTestId(MEMBER_SELECTORS.submitButton);
|
|
121447
|
+
const buttonSpinner = submitBtn.getByTestId(COMMON_SELECTORS.uiSpinner);
|
|
121448
|
+
await test.expect(submitBtn).toBeVisible({ timeout: 10_000 });
|
|
121449
|
+
await test.expect(async () => {
|
|
121450
|
+
if (await pane.isHidden())
|
|
121451
|
+
return;
|
|
121452
|
+
(await buttonSpinner.isHidden()) && (await submitBtn.click());
|
|
121453
|
+
await test.expect(buttonSpinner).toBeHidden({ timeout: 10_000 });
|
|
121454
|
+
await test.expect(pane).toBeHidden();
|
|
121455
|
+
}).toPass({ timeout: 60_000 });
|
|
121456
|
+
await this.neetoPlaywrightUtilities.verifyToast();
|
|
121457
|
+
};
|
|
121458
|
+
searchAndVerifyMemberByEmail = async ({ email }) => {
|
|
121459
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121460
|
+
await this.page.getByTestId(MEMBER_SELECTORS.searchTextField).fill(email);
|
|
121461
|
+
const emailSubstr = email.length > 20 ? email.substring(0, 20) : email;
|
|
121462
|
+
await test.expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.searchTermBlock)).toContainText(emailSubstr);
|
|
121463
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121464
|
+
await test.expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
121465
|
+
await test.expect(this.page.getByRole("cell", { name: email, exact: true })).toBeVisible();
|
|
121466
|
+
};
|
|
121467
|
+
editMemberViaUI = async ({ email = "", firstName = "", lastName = "", role = "standard", } = {}) => {
|
|
121468
|
+
await this.page.getByTestId(MEMBER_SELECTORS.dropDownIcon).click();
|
|
121469
|
+
await this.page.getByTestId(MEMBER_SELECTORS.editButton).click();
|
|
121470
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121471
|
+
neetoCist.isPresent(email) &&
|
|
121472
|
+
(await this.page
|
|
121473
|
+
.getByTestId(MEMBER_FORM_SELECTORS.emailInput)
|
|
121474
|
+
.fill(email));
|
|
121475
|
+
neetoCist.isPresent(firstName) &&
|
|
121476
|
+
(await this.page
|
|
121477
|
+
.getByTestId(MEMBER_FORM_SELECTORS.firstNameTextField)
|
|
121478
|
+
.fill(firstName));
|
|
121479
|
+
neetoCist.isPresent(lastName) &&
|
|
121480
|
+
(await this.page
|
|
121481
|
+
.getByTestId(MEMBER_FORM_SELECTORS.lastNameTextField)
|
|
121482
|
+
.fill(lastName));
|
|
121483
|
+
await this.neetoPlaywrightUtilities.toggleElement({
|
|
121484
|
+
locator: this.page.getByTestId(MEMBER_SELECTORS.roleLabel(role)),
|
|
121485
|
+
});
|
|
121486
|
+
await this.submit();
|
|
121487
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121488
|
+
};
|
|
121489
|
+
removeMemberViaUI = async (parentLocator = this.page) => {
|
|
121490
|
+
await parentLocator.getByTestId(MEMBER_SELECTORS.dropDownIcon).click();
|
|
121491
|
+
await this.page.getByTestId(MEMBER_SELECTORS.removeMember).click();
|
|
121492
|
+
await this.page
|
|
121493
|
+
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
121494
|
+
.click();
|
|
121495
|
+
await this.neetoPlaywrightUtilities.verifyToast();
|
|
121496
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121497
|
+
};
|
|
121498
|
+
filterMembersByMultiSelect = async ({ selectedOptions = [], selectContainerLocator = NEETO_FILTERS_SELECTORS.roleSelectContainer, }) => {
|
|
121499
|
+
await this.page
|
|
121500
|
+
.getByTestId(selectContainerLocator)
|
|
121501
|
+
.getByTestId(COMMON_SELECTORS.actionSelectIndicator)
|
|
121502
|
+
.click();
|
|
121503
|
+
for (const option of selectedOptions) {
|
|
121504
|
+
await this.page
|
|
121505
|
+
.getByTestId(COMMON_SELECTORS.selectOption(option))
|
|
121506
|
+
.click();
|
|
121507
|
+
}
|
|
121508
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121509
|
+
await test.expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
121510
|
+
};
|
|
121511
|
+
filterMembers = async ({ email = { id: "", condition: "Is" }, roles = [], name = "", }) => {
|
|
121512
|
+
await filterUtils.clearFiltersFromActionBlock(this.page);
|
|
121513
|
+
await filterUtils.openFilterPane(this.page);
|
|
121514
|
+
if (neetoCist.isPresent(email.id)) {
|
|
121515
|
+
await this.page
|
|
121516
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.emailSelectContainer)
|
|
121517
|
+
.getByTestId(COMMON_SELECTORS.actionSelectIndicator)
|
|
121518
|
+
.click();
|
|
121519
|
+
await this.page
|
|
121520
|
+
.getByTestId(COMMON_SELECTORS.selectOption(email.condition))
|
|
121521
|
+
.click();
|
|
121522
|
+
await this.page
|
|
121523
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.filtersEmailFilter)
|
|
121524
|
+
.fill(email.id);
|
|
121525
|
+
}
|
|
121526
|
+
neetoCist.isPresent(name) &&
|
|
121527
|
+
(await this.page
|
|
121528
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersNameFilterField)
|
|
121529
|
+
.fill(name));
|
|
121530
|
+
neetoCist.isPresent(roles) &&
|
|
121531
|
+
(await this.filterMembersByMultiSelect({ selectedOptions: roles }));
|
|
121532
|
+
await this.applyFilter();
|
|
121533
|
+
};
|
|
121534
|
+
getMemberRowByName = (name) => this.page.getByRole("row").filter({
|
|
121535
|
+
has: this.page.getByTestId(MEMBER_SELECTORS.memberNameCell(name)),
|
|
121536
|
+
});
|
|
121537
|
+
takeActionOnMembers = async ({ names = [], state, action, }) => {
|
|
121538
|
+
if (neetoCist.isPresent(names)) {
|
|
121539
|
+
for (const name of names) {
|
|
121540
|
+
await this.getMemberRowByName(name).getByRole("checkbox").click();
|
|
121541
|
+
}
|
|
121542
|
+
}
|
|
121543
|
+
else {
|
|
121544
|
+
await this.page
|
|
121545
|
+
.getByRole("columnheader", { name: MEMBER_TEXTS.selectAll })
|
|
121546
|
+
.click();
|
|
121547
|
+
}
|
|
121548
|
+
await this.page.getByTestId(COMMON_SELECTORS.takeActionDropdown).click();
|
|
121549
|
+
if (neetoCist.isPresent(state)) {
|
|
121550
|
+
await this.page
|
|
121551
|
+
.getByTestId(MEMBER_SELECTORS.takeActionStateOption(state))
|
|
121552
|
+
.click();
|
|
121553
|
+
}
|
|
121554
|
+
else {
|
|
121555
|
+
await this.page
|
|
121556
|
+
.getByRole("button", { name: action?.actionButtonText })
|
|
121557
|
+
.click();
|
|
121558
|
+
await this.page
|
|
121559
|
+
.getByRole("button", { name: action?.valueButtonText })
|
|
121560
|
+
.click();
|
|
121561
|
+
}
|
|
121562
|
+
await this.page
|
|
121563
|
+
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
121564
|
+
.click();
|
|
121565
|
+
await this.neetoPlaywrightUtilities.verifyToast();
|
|
121566
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121567
|
+
};
|
|
121568
|
+
performColumnAction = async ({ columnName = "Name", actionButtonText = "Ascending", } = {}) => {
|
|
121569
|
+
await this.page
|
|
121570
|
+
.getByTestId(MEMBER_SELECTORS.teamMembersTable)
|
|
121571
|
+
.getByLabel(columnName)
|
|
121572
|
+
.getByTestId(TABLE_SELECTORS.columnMenuButton)
|
|
121573
|
+
.click();
|
|
121574
|
+
await this.page.getByRole("button", { name: actionButtonText }).click();
|
|
121575
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121576
|
+
await test.expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
121577
|
+
};
|
|
121578
|
+
toggleMemberColumns = async ({ columns = [], bulkAction, }) => {
|
|
121579
|
+
await test.expect(async () => {
|
|
121580
|
+
await this.page
|
|
121581
|
+
.getByTestId(COMMON_SELECTORS.columnsDropdownButton)
|
|
121582
|
+
.click();
|
|
121583
|
+
await test.expect(this.page.getByTestId(COMMON_SELECTORS.columnsSearchInput)).toBeVisible();
|
|
121584
|
+
}).toPass({ timeout: 15_000 });
|
|
121585
|
+
if (neetoCist.isPresent(bulkAction)) {
|
|
121586
|
+
await this.page
|
|
121587
|
+
.getByTestId(COMMON_SELECTORS.columnVisibilityBtn(bulkAction === "hide" ? "hide-all" : "reset"))
|
|
121588
|
+
.click();
|
|
121589
|
+
}
|
|
121590
|
+
else {
|
|
121591
|
+
for (const column of columns) {
|
|
121592
|
+
await this.page
|
|
121593
|
+
.getByTestId(COMMON_SELECTORS.columnsSearchInput)
|
|
121594
|
+
.fill(column);
|
|
121595
|
+
const columnCheckbox = this.page
|
|
121596
|
+
.getByTestId(COMMON_SELECTORS.nuiCheckboxContainer)
|
|
121597
|
+
.filter({ hasText: column })
|
|
121598
|
+
.getByTestId(MEMBER_SELECTORS.columnCheckBox);
|
|
121599
|
+
const isChecked = await columnCheckbox.isChecked();
|
|
121600
|
+
await columnCheckbox.click();
|
|
121601
|
+
await test.expect(columnCheckbox).toBeChecked({ checked: !isChecked });
|
|
121602
|
+
}
|
|
121603
|
+
}
|
|
121604
|
+
await this.page.getByTestId(COMMON_SELECTORS.columnsDropdownButton).click();
|
|
121605
|
+
};
|
|
121606
|
+
verifyMemberInTable = ({ name, email }) => test.expect(this.getMemberRowByName(name).getByRole("cell", {
|
|
121607
|
+
name: email,
|
|
121608
|
+
exact: true,
|
|
121609
|
+
})).toBeVisible();
|
|
121610
|
+
applyFilter = async () => {
|
|
121611
|
+
await test.expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeVisible();
|
|
121612
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121613
|
+
await test.expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden({
|
|
121614
|
+
timeout: 30_000,
|
|
121615
|
+
});
|
|
121616
|
+
await this.page
|
|
121617
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.filterDoneButton)
|
|
121618
|
+
.click();
|
|
121619
|
+
};
|
|
121620
|
+
exportDetails = async (fileType, adminEmail) => {
|
|
121621
|
+
await this.page.getByTestId(MEMBER_SELECTORS.downloadButton).click();
|
|
121622
|
+
await test.expect(this.page.getByTestId(MEMBER_SELECTORS.exportMemberHeading)).toHaveText(this.t("neetoTeamMembers.exportPane.title"));
|
|
121623
|
+
await this.page
|
|
121624
|
+
.getByTestId(MEMBER_SELECTORS.downloadAsRadioItem(fileType))
|
|
121625
|
+
.check();
|
|
121626
|
+
const exportStartTime = new Date();
|
|
121627
|
+
await this.page.getByTestId(MEMBER_SELECTORS.exportSubmitBtn).click();
|
|
121628
|
+
await this.neetoPlaywrightUtilities.verifyToast({
|
|
121629
|
+
message: this.t("toastr.success.exportMembers", { email: adminEmail }),
|
|
121630
|
+
});
|
|
121631
|
+
return exportStartTime;
|
|
121632
|
+
};
|
|
121633
|
+
verifyNoDataTitle = async (email) => {
|
|
121634
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121635
|
+
await this.page.getByTestId(MEMBER_SELECTORS.searchTextField).fill(email);
|
|
121636
|
+
await test.expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeVisible();
|
|
121637
|
+
await test.expect(this.page.getByTestId(COMMON_SELECTORS.noDataTitle)).toBeVisible({ timeout: 10_000 });
|
|
121638
|
+
await filterUtils.clearFiltersFromActionBlock(this.page);
|
|
121639
|
+
};
|
|
121640
|
+
}
|
|
121641
|
+
|
|
121624
121642
|
dayjs.extend(customParseFormat);
|
|
121625
121643
|
class ApiKeysPage {
|
|
121626
121644
|
page;
|
|
@@ -127217,6 +127235,7 @@ exports.OrganizationPage = OrganizationPage;
|
|
|
127217
127235
|
exports.PAST_TIME_RANGES = PAST_TIME_RANGES;
|
|
127218
127236
|
exports.PHONE_NUMBER_FORMATS = PHONE_NUMBER_FORMATS;
|
|
127219
127237
|
exports.PLURAL = PLURAL;
|
|
127238
|
+
exports.PRODUCT_ROLES_ROUTE_MAP = PRODUCT_ROLES_ROUTE_MAP;
|
|
127220
127239
|
exports.PROFILE_LINKS = PROFILE_LINKS;
|
|
127221
127240
|
exports.PROFILE_SECTION_SELECTORS = PROFILE_SECTION_SELECTORS;
|
|
127222
127241
|
exports.PROJECT_NAMES = PROJECT_NAMES;
|