@bigbinary/neeto-playwright-commons 3.3.7 → 3.3.9
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 +299 -267
- package/index.cjs.js.map +1 -1
- package/index.d.ts +10 -4
- package/index.js +299 -267
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -62,6 +62,7 @@ const ROUTES = {
|
|
|
62
62
|
loginLink: "/login",
|
|
63
63
|
profile: "/profile",
|
|
64
64
|
admin: "/admin",
|
|
65
|
+
members: "/admin/members",
|
|
65
66
|
myProfile: "/my/profile",
|
|
66
67
|
updateEmail: "/my/profile/email",
|
|
67
68
|
authSettings: "/settings",
|
|
@@ -2477,6 +2478,278 @@ const THEMES_TEXTS = {
|
|
|
2477
2478
|
darkThemeClass: /neeto-ui-theme--dark/,
|
|
2478
2479
|
};
|
|
2479
2480
|
|
|
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
|
+
|
|
2480
2753
|
const fillCredentialsAndSubmit = async ({ page, loginPath, email = CREDENTIALS.email, }) => {
|
|
2481
2754
|
loginPath && (await page.goto(loginPath, { timeout: 30_000 }));
|
|
2482
2755
|
await page.waitForLoadState("load", { timeout: 35_000 });
|
|
@@ -18063,14 +18336,17 @@ class Health {
|
|
|
18063
18336
|
neetoPlaywrightUtilities;
|
|
18064
18337
|
email = process.env.PLAYWRIGHT_PRODUCTION_EMAIL;
|
|
18065
18338
|
loginPage;
|
|
18339
|
+
teamMembers;
|
|
18066
18340
|
constructor(page, neetoPlaywrightUtilities) {
|
|
18067
18341
|
this.page = page;
|
|
18068
18342
|
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
18069
18343
|
if (!process.env.PLAYWRIGHT_PRODUCTION_EMAIL ||
|
|
18070
|
-
!process.env.PLAYWRIGHT_PRODUCTION_2FA_SECRET_KEY
|
|
18071
|
-
|
|
18344
|
+
!process.env.PLAYWRIGHT_PRODUCTION_2FA_SECRET_KEY ||
|
|
18345
|
+
!process.env.FASTMAIL_DOMAIN_NAME) {
|
|
18346
|
+
throw new Error("One or more required env variables are missing: PLAYWRIGHT_PRODUCTION_EMAIL, PLAYWRIGHT_PRODUCTION_2FA_SECRET_KEY, FASTMAIL_DOMAIN_NAME");
|
|
18072
18347
|
}
|
|
18073
18348
|
this.loginPage = new OrganizationPage(page, neetoPlaywrightUtilities);
|
|
18349
|
+
this.teamMembers = new TeamMembers({ page, neetoPlaywrightUtilities });
|
|
18074
18350
|
}
|
|
18075
18351
|
loginToApp = async (route = ROUTES.adminPanel.index) => {
|
|
18076
18352
|
await this.page.goto(route);
|
|
@@ -18085,6 +18361,26 @@ class Health {
|
|
|
18085
18361
|
verifyAppIsLive = async (customSteps) => {
|
|
18086
18362
|
await test.step("1: Login to the application", () => this.loginToApp());
|
|
18087
18363
|
await test.step("2: Verify application UI", this.verifyAppUI);
|
|
18364
|
+
await test.step("3: Navigate to team members page", async () => {
|
|
18365
|
+
await this.page.goto(ROUTES.members);
|
|
18366
|
+
await this.neetoPlaywrightUtilities.waitForFloatingMenu();
|
|
18367
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
18368
|
+
});
|
|
18369
|
+
await test.step("4: Verify adding & removing members", async () => {
|
|
18370
|
+
const email = faker.faker.internet
|
|
18371
|
+
.email({ provider: process.env.FASTMAIL_DOMAIN_NAME })
|
|
18372
|
+
.toLowerCase();
|
|
18373
|
+
const memberRow = this.page.getByRole("row").filter({
|
|
18374
|
+
has: this.page.getByRole("cell", { name: email, exact: true }),
|
|
18375
|
+
});
|
|
18376
|
+
await this.teamMembers.openMemberPane();
|
|
18377
|
+
await this.teamMembers.fillMemberForm([email]);
|
|
18378
|
+
await this.teamMembers.submit();
|
|
18379
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
18380
|
+
await test.expect(memberRow).toBeVisible();
|
|
18381
|
+
await this.teamMembers.removeMemberViaUI(memberRow);
|
|
18382
|
+
await test.expect(memberRow).toBeHidden();
|
|
18383
|
+
});
|
|
18088
18384
|
await customSteps?.();
|
|
18089
18385
|
};
|
|
18090
18386
|
}
|
|
@@ -121325,270 +121621,6 @@ class ImageUploader {
|
|
|
121325
121621
|
};
|
|
121326
121622
|
}
|
|
121327
121623
|
|
|
121328
|
-
const openFilterPane = async (page) => {
|
|
121329
|
-
await page
|
|
121330
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.filterButton)
|
|
121331
|
-
.or(page.getByTestId(COMMON_SELECTORS.filterButon))
|
|
121332
|
-
.click();
|
|
121333
|
-
await test.expect(page.getByTestId(COMMON_SELECTORS.paneHeader)).toHaveText(playwrightI18nextFixture.getI18nInstance().t("neetoFilters.common.filters"));
|
|
121334
|
-
};
|
|
121335
|
-
const clearFiltersFromActionBlock = async (page) => {
|
|
121336
|
-
const isClearButtonVisible = await page
|
|
121337
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
|
|
121338
|
-
.isVisible();
|
|
121339
|
-
if (isClearButtonVisible) {
|
|
121340
|
-
await page
|
|
121341
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
|
|
121342
|
-
.click();
|
|
121343
|
-
await Promise.all([
|
|
121344
|
-
test.expect(page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeHidden(),
|
|
121345
|
-
test.expect(page.locator(COMMON_SELECTORS.tableSpinner)).toHaveCount(0, {
|
|
121346
|
-
timeout: 15_000,
|
|
121347
|
-
}),
|
|
121348
|
-
]);
|
|
121349
|
-
}
|
|
121350
|
-
};
|
|
121351
|
-
const filterUtils = {
|
|
121352
|
-
openFilterPane,
|
|
121353
|
-
clearFiltersFromActionBlock,
|
|
121354
|
-
};
|
|
121355
|
-
|
|
121356
|
-
class TeamMembers {
|
|
121357
|
-
page;
|
|
121358
|
-
neetoPlaywrightUtilities;
|
|
121359
|
-
t;
|
|
121360
|
-
constructor({ page, neetoPlaywrightUtilities, }) {
|
|
121361
|
-
this.page = page;
|
|
121362
|
-
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
121363
|
-
this.t = playwrightI18nextFixture.getI18nInstance().t;
|
|
121364
|
-
}
|
|
121365
|
-
navigateToTeamMembers = async () => {
|
|
121366
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121367
|
-
await this.page.getByTestId(MEMBER_SELECTORS.membersTab).click();
|
|
121368
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121369
|
-
};
|
|
121370
|
-
addMemberViaUI = async ({ emails = [faker.faker.internet.exampleEmail()], role = "standard", } = {}) => {
|
|
121371
|
-
await this.page.getByTestId(MEMBER_SELECTORS.newButton).click();
|
|
121372
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121373
|
-
const continueButton = this.page.getByTestId(MEMBER_SELECTORS.continueButton);
|
|
121374
|
-
await test.expect(continueButton).toBeVisible();
|
|
121375
|
-
await test.expect(continueButton.getByTestId(COMMON_SELECTORS.uiSpinner)).toBeHidden({ timeout: 35_000 });
|
|
121376
|
-
await this.page
|
|
121377
|
-
.getByTestId(MEMBER_FORM_SELECTORS.emailTextField)
|
|
121378
|
-
.fill(emails.join(", "));
|
|
121379
|
-
await this.page.keyboard.press("Enter");
|
|
121380
|
-
await this.neetoPlaywrightUtilities.toggleElement({
|
|
121381
|
-
locator: this.page.getByTestId(MEMBER_SELECTORS.roleLabel(role)),
|
|
121382
|
-
});
|
|
121383
|
-
await continueButton.click();
|
|
121384
|
-
if (IS_STAGING_ENV) {
|
|
121385
|
-
await this.page
|
|
121386
|
-
.getByTestId(COMMON_SELECTORS.paneBody)
|
|
121387
|
-
.getByTestId(COMMON_SELECTORS.checkboxLabel)
|
|
121388
|
-
.click();
|
|
121389
|
-
await this.page.getByTestId(MEMBER_SELECTORS.continueButton).click();
|
|
121390
|
-
}
|
|
121391
|
-
await this.submit();
|
|
121392
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121393
|
-
};
|
|
121394
|
-
submit = async () => {
|
|
121395
|
-
const pane = this.page.getByTestId(COMMON_SELECTORS.paneBody);
|
|
121396
|
-
const submitBtn = this.page.getByTestId(MEMBER_SELECTORS.submitButton);
|
|
121397
|
-
const buttonSpinner = submitBtn.getByTestId(COMMON_SELECTORS.uiSpinner);
|
|
121398
|
-
await test.expect(submitBtn).toBeVisible({ timeout: 10_000 });
|
|
121399
|
-
await test.expect(async () => {
|
|
121400
|
-
if (await pane.isHidden())
|
|
121401
|
-
return;
|
|
121402
|
-
(await buttonSpinner.isHidden()) && (await submitBtn.click());
|
|
121403
|
-
await test.expect(buttonSpinner).toBeHidden({ timeout: 10_000 });
|
|
121404
|
-
await test.expect(pane).toBeHidden();
|
|
121405
|
-
}).toPass({ timeout: 60_000 });
|
|
121406
|
-
await this.neetoPlaywrightUtilities.verifyToast();
|
|
121407
|
-
};
|
|
121408
|
-
searchAndVerifyMemberByEmail = async ({ email }) => {
|
|
121409
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121410
|
-
await this.page.getByTestId(MEMBER_SELECTORS.searchTextField).fill(email);
|
|
121411
|
-
const emailSubstr = email.length > 20 ? email.substring(0, 20) : email;
|
|
121412
|
-
await test.expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.searchTermBlock)).toContainText(emailSubstr);
|
|
121413
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121414
|
-
await test.expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
121415
|
-
await test.expect(this.page.getByRole("cell", { name: email, exact: true })).toBeVisible();
|
|
121416
|
-
};
|
|
121417
|
-
editMemberViaUI = async ({ email = "", firstName = "", lastName = "", role = "standard", } = {}) => {
|
|
121418
|
-
await this.page.getByTestId(MEMBER_SELECTORS.dropDownIcon).click();
|
|
121419
|
-
await this.page.getByTestId(MEMBER_SELECTORS.editButton).click();
|
|
121420
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121421
|
-
neetoCist.isPresent(email) &&
|
|
121422
|
-
(await this.page
|
|
121423
|
-
.getByTestId(MEMBER_FORM_SELECTORS.emailInput)
|
|
121424
|
-
.fill(email));
|
|
121425
|
-
neetoCist.isPresent(firstName) &&
|
|
121426
|
-
(await this.page
|
|
121427
|
-
.getByTestId(MEMBER_FORM_SELECTORS.firstNameTextField)
|
|
121428
|
-
.fill(firstName));
|
|
121429
|
-
neetoCist.isPresent(lastName) &&
|
|
121430
|
-
(await this.page
|
|
121431
|
-
.getByTestId(MEMBER_FORM_SELECTORS.lastNameTextField)
|
|
121432
|
-
.fill(lastName));
|
|
121433
|
-
await this.neetoPlaywrightUtilities.toggleElement({
|
|
121434
|
-
locator: this.page.getByTestId(MEMBER_SELECTORS.roleLabel(role)),
|
|
121435
|
-
});
|
|
121436
|
-
await this.submit();
|
|
121437
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121438
|
-
};
|
|
121439
|
-
removeMemberViaUI = async () => {
|
|
121440
|
-
await this.page.getByTestId(MEMBER_SELECTORS.dropDownIcon).click();
|
|
121441
|
-
await this.page.getByTestId(MEMBER_SELECTORS.removeMember).click();
|
|
121442
|
-
await this.page
|
|
121443
|
-
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
121444
|
-
.click();
|
|
121445
|
-
await this.neetoPlaywrightUtilities.verifyToast();
|
|
121446
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121447
|
-
};
|
|
121448
|
-
filterMembersByMultiSelect = async ({ selectedOptions = [], selectContainerLocator = NEETO_FILTERS_SELECTORS.roleSelectContainer, }) => {
|
|
121449
|
-
await this.page
|
|
121450
|
-
.getByTestId(selectContainerLocator)
|
|
121451
|
-
.getByTestId(COMMON_SELECTORS.actionSelectIndicator)
|
|
121452
|
-
.click();
|
|
121453
|
-
for (const option of selectedOptions) {
|
|
121454
|
-
await this.page
|
|
121455
|
-
.getByTestId(COMMON_SELECTORS.selectOption(option))
|
|
121456
|
-
.click();
|
|
121457
|
-
}
|
|
121458
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121459
|
-
await test.expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
121460
|
-
};
|
|
121461
|
-
filterMembers = async ({ email = { id: "", condition: "Is" }, roles = [], name = "", }) => {
|
|
121462
|
-
await filterUtils.clearFiltersFromActionBlock(this.page);
|
|
121463
|
-
await filterUtils.openFilterPane(this.page);
|
|
121464
|
-
if (neetoCist.isPresent(email.id)) {
|
|
121465
|
-
await this.page
|
|
121466
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.emailSelectContainer)
|
|
121467
|
-
.getByTestId(COMMON_SELECTORS.actionSelectIndicator)
|
|
121468
|
-
.click();
|
|
121469
|
-
await this.page
|
|
121470
|
-
.getByTestId(COMMON_SELECTORS.selectOption(email.condition))
|
|
121471
|
-
.click();
|
|
121472
|
-
await this.page
|
|
121473
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.filtersEmailFilter)
|
|
121474
|
-
.fill(email.id);
|
|
121475
|
-
}
|
|
121476
|
-
neetoCist.isPresent(name) &&
|
|
121477
|
-
(await this.page
|
|
121478
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersNameFilterField)
|
|
121479
|
-
.fill(name));
|
|
121480
|
-
neetoCist.isPresent(roles) &&
|
|
121481
|
-
(await this.filterMembersByMultiSelect({ selectedOptions: roles }));
|
|
121482
|
-
await this.applyFilter();
|
|
121483
|
-
};
|
|
121484
|
-
getMemberRowByName = (name) => this.page.getByRole("row").filter({
|
|
121485
|
-
has: this.page.getByTestId(MEMBER_SELECTORS.memberNameCell(name)),
|
|
121486
|
-
});
|
|
121487
|
-
takeActionOnMembers = async ({ names = [], state, action, }) => {
|
|
121488
|
-
if (neetoCist.isPresent(names)) {
|
|
121489
|
-
for (const name of names) {
|
|
121490
|
-
await this.getMemberRowByName(name).getByRole("checkbox").click();
|
|
121491
|
-
}
|
|
121492
|
-
}
|
|
121493
|
-
else {
|
|
121494
|
-
await this.page
|
|
121495
|
-
.getByRole("columnheader", { name: MEMBER_TEXTS.selectAll })
|
|
121496
|
-
.click();
|
|
121497
|
-
}
|
|
121498
|
-
await this.page.getByTestId(COMMON_SELECTORS.takeActionDropdown).click();
|
|
121499
|
-
if (neetoCist.isPresent(state)) {
|
|
121500
|
-
await this.page
|
|
121501
|
-
.getByTestId(MEMBER_SELECTORS.takeActionStateOption(state))
|
|
121502
|
-
.click();
|
|
121503
|
-
}
|
|
121504
|
-
else {
|
|
121505
|
-
await this.page
|
|
121506
|
-
.getByRole("button", { name: action?.actionButtonText })
|
|
121507
|
-
.click();
|
|
121508
|
-
await this.page
|
|
121509
|
-
.getByRole("button", { name: action?.valueButtonText })
|
|
121510
|
-
.click();
|
|
121511
|
-
}
|
|
121512
|
-
await this.page
|
|
121513
|
-
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
121514
|
-
.click();
|
|
121515
|
-
await this.neetoPlaywrightUtilities.verifyToast();
|
|
121516
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121517
|
-
};
|
|
121518
|
-
performColumnAction = async ({ columnName = "Name", actionButtonText = "Ascending", } = {}) => {
|
|
121519
|
-
await this.page
|
|
121520
|
-
.getByTestId(MEMBER_SELECTORS.teamMembersTable)
|
|
121521
|
-
.getByLabel(columnName)
|
|
121522
|
-
.getByTestId(TABLE_SELECTORS.columnMenuButton)
|
|
121523
|
-
.click();
|
|
121524
|
-
await this.page.getByRole("button", { name: actionButtonText }).click();
|
|
121525
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121526
|
-
await test.expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
121527
|
-
};
|
|
121528
|
-
toggleMemberColumns = async ({ columns = [], bulkAction, }) => {
|
|
121529
|
-
await test.expect(async () => {
|
|
121530
|
-
await this.page
|
|
121531
|
-
.getByTestId(COMMON_SELECTORS.columnsDropdownButton)
|
|
121532
|
-
.click();
|
|
121533
|
-
await test.expect(this.page.getByTestId(COMMON_SELECTORS.columnsSearchInput)).toBeVisible();
|
|
121534
|
-
}).toPass({ timeout: 15_000 });
|
|
121535
|
-
if (neetoCist.isPresent(bulkAction)) {
|
|
121536
|
-
await this.page
|
|
121537
|
-
.getByTestId(COMMON_SELECTORS.columnVisibilityBtn(bulkAction === "hide" ? "hide-all" : "reset"))
|
|
121538
|
-
.click();
|
|
121539
|
-
}
|
|
121540
|
-
else {
|
|
121541
|
-
for (const column of columns) {
|
|
121542
|
-
await this.page
|
|
121543
|
-
.getByTestId(COMMON_SELECTORS.columnsSearchInput)
|
|
121544
|
-
.fill(column);
|
|
121545
|
-
const columnCheckbox = this.page
|
|
121546
|
-
.getByTestId(COMMON_SELECTORS.nuiCheckboxContainer)
|
|
121547
|
-
.filter({ hasText: column })
|
|
121548
|
-
.getByTestId(MEMBER_SELECTORS.columnCheckBox);
|
|
121549
|
-
const isChecked = await columnCheckbox.isChecked();
|
|
121550
|
-
await columnCheckbox.click();
|
|
121551
|
-
await test.expect(columnCheckbox).toBeChecked({ checked: !isChecked });
|
|
121552
|
-
}
|
|
121553
|
-
}
|
|
121554
|
-
await this.page.getByTestId(COMMON_SELECTORS.columnsDropdownButton).click();
|
|
121555
|
-
};
|
|
121556
|
-
verifyMemberInTable = ({ name, email }) => test.expect(this.getMemberRowByName(name).getByRole("cell", {
|
|
121557
|
-
name: email,
|
|
121558
|
-
exact: true,
|
|
121559
|
-
})).toBeVisible();
|
|
121560
|
-
applyFilter = async () => {
|
|
121561
|
-
await test.expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeVisible();
|
|
121562
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121563
|
-
await test.expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden({
|
|
121564
|
-
timeout: 30_000,
|
|
121565
|
-
});
|
|
121566
|
-
await this.page
|
|
121567
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.filterDoneButton)
|
|
121568
|
-
.click();
|
|
121569
|
-
};
|
|
121570
|
-
exportDetails = async (fileType, adminEmail) => {
|
|
121571
|
-
await this.page.getByTestId(MEMBER_SELECTORS.downloadButton).click();
|
|
121572
|
-
await test.expect(this.page.getByTestId(MEMBER_SELECTORS.exportMemberHeading)).toHaveText(this.t("neetoTeamMembers.exportPane.title"));
|
|
121573
|
-
await this.page
|
|
121574
|
-
.getByTestId(MEMBER_SELECTORS.downloadAsRadioItem(fileType))
|
|
121575
|
-
.check();
|
|
121576
|
-
const exportStartTime = new Date();
|
|
121577
|
-
await this.page.getByTestId(MEMBER_SELECTORS.exportSubmitBtn).click();
|
|
121578
|
-
await this.neetoPlaywrightUtilities.verifyToast({
|
|
121579
|
-
message: this.t("toastr.success.exportMembers", { email: adminEmail }),
|
|
121580
|
-
});
|
|
121581
|
-
return exportStartTime;
|
|
121582
|
-
};
|
|
121583
|
-
verifyNoDataTitle = async (email) => {
|
|
121584
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121585
|
-
await this.page.getByTestId(MEMBER_SELECTORS.searchTextField).fill(email);
|
|
121586
|
-
await test.expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeVisible();
|
|
121587
|
-
await test.expect(this.page.getByTestId(COMMON_SELECTORS.noDataTitle)).toBeVisible({ timeout: 10_000 });
|
|
121588
|
-
await filterUtils.clearFiltersFromActionBlock(this.page);
|
|
121589
|
-
};
|
|
121590
|
-
}
|
|
121591
|
-
|
|
121592
121624
|
dayjs.extend(customParseFormat);
|
|
121593
121625
|
class ApiKeysPage {
|
|
121594
121626
|
page;
|
|
@@ -121691,7 +121723,7 @@ class AuditLogsPage {
|
|
|
121691
121723
|
this.currentDate = dayjs().tz("Asia/Kolkata").format("MMM D, YYYY");
|
|
121692
121724
|
this.messageBuilders = {
|
|
121693
121725
|
[ACTIONS.inviteUsers]: (data) => `${this.admin} added ${data.emails.join(", ").toLowerCase()} to Neeto${this.product}.`,
|
|
121694
|
-
[ACTIONS.updatedUser]: (data) => `${this.admin} changed ${data.emails[0].toLowerCase()}'s email from ${data.emails[0].toLowerCase()} to ${data.emails[1]} on Neeto${this.product}.`,
|
|
121726
|
+
[ACTIONS.updatedUser]: (data) => `${this.admin} changed ${data.emails[0].toLowerCase()}'s email from ${data.emails[0].toLowerCase()} to ${data.emails[1].toLowerCase()} on Neeto${this.product}.`,
|
|
121695
121727
|
[ACTIONS.removedUser]: (data) => `${this.admin} removed ${data.emails[0].toLowerCase()} from Neeto${this.product}.`,
|
|
121696
121728
|
[ACTIONS.createdRole]: (data) => `${this.admin} created ${data.roleName} role on Neeto${this.product}.`,
|
|
121697
121729
|
[ACTIONS.addedPermission]: (data) => `${this.admin} added ${data.permissions.join(", ").toLowerCase()} permission to ${data.roleName} role on Neeto${this.product}.`,
|