@bigbinary/neeto-playwright-commons 3.3.6 → 3.3.8
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 +310 -275
- package/index.cjs.js.map +1 -1
- package/index.d.ts +10 -4
- package/index.js +310 -275
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -41,6 +41,7 @@ const ROUTES = {
|
|
|
41
41
|
loginLink: "/login",
|
|
42
42
|
profile: "/profile",
|
|
43
43
|
admin: "/admin",
|
|
44
|
+
members: "/admin/members",
|
|
44
45
|
myProfile: "/my/profile",
|
|
45
46
|
updateEmail: "/my/profile/email",
|
|
46
47
|
authSettings: "/settings",
|
|
@@ -2456,6 +2457,278 @@ const THEMES_TEXTS = {
|
|
|
2456
2457
|
darkThemeClass: /neeto-ui-theme--dark/,
|
|
2457
2458
|
};
|
|
2458
2459
|
|
|
2460
|
+
const openFilterPane = async (page) => {
|
|
2461
|
+
await page
|
|
2462
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.filterButton)
|
|
2463
|
+
.or(page.getByTestId(COMMON_SELECTORS.filterButon))
|
|
2464
|
+
.click();
|
|
2465
|
+
await expect(page.getByTestId(COMMON_SELECTORS.paneHeader)).toHaveText(getI18nInstance().t("neetoFilters.common.filters"));
|
|
2466
|
+
};
|
|
2467
|
+
const clearFiltersFromActionBlock = async (page) => {
|
|
2468
|
+
const isClearButtonVisible = await page
|
|
2469
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
|
|
2470
|
+
.isVisible();
|
|
2471
|
+
if (isClearButtonVisible) {
|
|
2472
|
+
await page
|
|
2473
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
|
|
2474
|
+
.click();
|
|
2475
|
+
await Promise.all([
|
|
2476
|
+
expect(page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeHidden(),
|
|
2477
|
+
expect(page.locator(COMMON_SELECTORS.tableSpinner)).toHaveCount(0, {
|
|
2478
|
+
timeout: 15_000,
|
|
2479
|
+
}),
|
|
2480
|
+
]);
|
|
2481
|
+
}
|
|
2482
|
+
};
|
|
2483
|
+
const filterUtils = {
|
|
2484
|
+
openFilterPane,
|
|
2485
|
+
clearFiltersFromActionBlock,
|
|
2486
|
+
};
|
|
2487
|
+
|
|
2488
|
+
class TeamMembers {
|
|
2489
|
+
page;
|
|
2490
|
+
neetoPlaywrightUtilities;
|
|
2491
|
+
t;
|
|
2492
|
+
constructor({ page, neetoPlaywrightUtilities, }) {
|
|
2493
|
+
this.page = page;
|
|
2494
|
+
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
2495
|
+
this.t = getI18nInstance().t;
|
|
2496
|
+
}
|
|
2497
|
+
navigateToTeamMembers = async () => {
|
|
2498
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2499
|
+
await this.page.getByTestId(MEMBER_SELECTORS.membersTab).click();
|
|
2500
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2501
|
+
};
|
|
2502
|
+
openMemberPane = async () => {
|
|
2503
|
+
await this.page.getByTestId(MEMBER_SELECTORS.newButton).click();
|
|
2504
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2505
|
+
const continueButton = this.page.getByTestId(MEMBER_SELECTORS.continueButton);
|
|
2506
|
+
await expect(continueButton).toBeVisible();
|
|
2507
|
+
await expect(continueButton.getByTestId(COMMON_SELECTORS.uiSpinner)).toBeHidden({ timeout: 35_000 });
|
|
2508
|
+
};
|
|
2509
|
+
fillMemberForm = async (emails, role) => {
|
|
2510
|
+
await this.page
|
|
2511
|
+
.getByTestId(MEMBER_FORM_SELECTORS.emailTextField)
|
|
2512
|
+
.fill(emails.join(", "));
|
|
2513
|
+
await this.page.keyboard.press("Enter");
|
|
2514
|
+
role &&
|
|
2515
|
+
(await this.neetoPlaywrightUtilities.toggleElement({
|
|
2516
|
+
locator: this.page.getByTestId(MEMBER_SELECTORS.roleLabel(role)),
|
|
2517
|
+
}));
|
|
2518
|
+
const continueBtn = this.page.getByTestId(MEMBER_SELECTORS.continueButton);
|
|
2519
|
+
await continueBtn.click();
|
|
2520
|
+
if (IS_STAGING_ENV) {
|
|
2521
|
+
await this.page
|
|
2522
|
+
.getByTestId(COMMON_SELECTORS.paneBody)
|
|
2523
|
+
.getByTestId(COMMON_SELECTORS.checkboxLabel)
|
|
2524
|
+
.click();
|
|
2525
|
+
await continueBtn.click();
|
|
2526
|
+
}
|
|
2527
|
+
};
|
|
2528
|
+
addMemberViaUI = async ({ emails = [faker.internet.exampleEmail()], role = "standard", } = {}) => {
|
|
2529
|
+
await this.openMemberPane();
|
|
2530
|
+
await this.fillMemberForm(emails, role);
|
|
2531
|
+
await this.submit();
|
|
2532
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2533
|
+
};
|
|
2534
|
+
submit = async () => {
|
|
2535
|
+
const pane = this.page.getByTestId(COMMON_SELECTORS.paneBody);
|
|
2536
|
+
const submitBtn = this.page.getByTestId(MEMBER_SELECTORS.submitButton);
|
|
2537
|
+
const buttonSpinner = submitBtn.getByTestId(COMMON_SELECTORS.uiSpinner);
|
|
2538
|
+
await expect(submitBtn).toBeVisible({ timeout: 10_000 });
|
|
2539
|
+
await expect(async () => {
|
|
2540
|
+
if (await pane.isHidden())
|
|
2541
|
+
return;
|
|
2542
|
+
(await buttonSpinner.isHidden()) && (await submitBtn.click());
|
|
2543
|
+
await expect(buttonSpinner).toBeHidden({ timeout: 10_000 });
|
|
2544
|
+
await expect(pane).toBeHidden();
|
|
2545
|
+
}).toPass({ timeout: 60_000 });
|
|
2546
|
+
await this.neetoPlaywrightUtilities.verifyToast();
|
|
2547
|
+
};
|
|
2548
|
+
searchAndVerifyMemberByEmail = async ({ email }) => {
|
|
2549
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2550
|
+
await this.page.getByTestId(MEMBER_SELECTORS.searchTextField).fill(email);
|
|
2551
|
+
const emailSubstr = email.length > 20 ? email.substring(0, 20) : email;
|
|
2552
|
+
await expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.searchTermBlock)).toContainText(emailSubstr);
|
|
2553
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2554
|
+
await expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
2555
|
+
await expect(this.page.getByRole("cell", { name: email, exact: true })).toBeVisible();
|
|
2556
|
+
};
|
|
2557
|
+
editMemberViaUI = async ({ email = "", firstName = "", lastName = "", role = "standard", } = {}) => {
|
|
2558
|
+
await this.page.getByTestId(MEMBER_SELECTORS.dropDownIcon).click();
|
|
2559
|
+
await this.page.getByTestId(MEMBER_SELECTORS.editButton).click();
|
|
2560
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2561
|
+
isPresent(email) &&
|
|
2562
|
+
(await this.page
|
|
2563
|
+
.getByTestId(MEMBER_FORM_SELECTORS.emailInput)
|
|
2564
|
+
.fill(email));
|
|
2565
|
+
isPresent(firstName) &&
|
|
2566
|
+
(await this.page
|
|
2567
|
+
.getByTestId(MEMBER_FORM_SELECTORS.firstNameTextField)
|
|
2568
|
+
.fill(firstName));
|
|
2569
|
+
isPresent(lastName) &&
|
|
2570
|
+
(await this.page
|
|
2571
|
+
.getByTestId(MEMBER_FORM_SELECTORS.lastNameTextField)
|
|
2572
|
+
.fill(lastName));
|
|
2573
|
+
await this.neetoPlaywrightUtilities.toggleElement({
|
|
2574
|
+
locator: this.page.getByTestId(MEMBER_SELECTORS.roleLabel(role)),
|
|
2575
|
+
});
|
|
2576
|
+
await this.submit();
|
|
2577
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2578
|
+
};
|
|
2579
|
+
removeMemberViaUI = async (parentLocator = this.page) => {
|
|
2580
|
+
await parentLocator.getByTestId(MEMBER_SELECTORS.dropDownIcon).click();
|
|
2581
|
+
await this.page.getByTestId(MEMBER_SELECTORS.removeMember).click();
|
|
2582
|
+
await this.page
|
|
2583
|
+
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
2584
|
+
.click();
|
|
2585
|
+
await this.neetoPlaywrightUtilities.verifyToast();
|
|
2586
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2587
|
+
};
|
|
2588
|
+
filterMembersByMultiSelect = async ({ selectedOptions = [], selectContainerLocator = NEETO_FILTERS_SELECTORS.roleSelectContainer, }) => {
|
|
2589
|
+
await this.page
|
|
2590
|
+
.getByTestId(selectContainerLocator)
|
|
2591
|
+
.getByTestId(COMMON_SELECTORS.actionSelectIndicator)
|
|
2592
|
+
.click();
|
|
2593
|
+
for (const option of selectedOptions) {
|
|
2594
|
+
await this.page
|
|
2595
|
+
.getByTestId(COMMON_SELECTORS.selectOption(option))
|
|
2596
|
+
.click();
|
|
2597
|
+
}
|
|
2598
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2599
|
+
await expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
2600
|
+
};
|
|
2601
|
+
filterMembers = async ({ email = { id: "", condition: "Is" }, roles = [], name = "", }) => {
|
|
2602
|
+
await filterUtils.clearFiltersFromActionBlock(this.page);
|
|
2603
|
+
await filterUtils.openFilterPane(this.page);
|
|
2604
|
+
if (isPresent(email.id)) {
|
|
2605
|
+
await this.page
|
|
2606
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.emailSelectContainer)
|
|
2607
|
+
.getByTestId(COMMON_SELECTORS.actionSelectIndicator)
|
|
2608
|
+
.click();
|
|
2609
|
+
await this.page
|
|
2610
|
+
.getByTestId(COMMON_SELECTORS.selectOption(email.condition))
|
|
2611
|
+
.click();
|
|
2612
|
+
await this.page
|
|
2613
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.filtersEmailFilter)
|
|
2614
|
+
.fill(email.id);
|
|
2615
|
+
}
|
|
2616
|
+
isPresent(name) &&
|
|
2617
|
+
(await this.page
|
|
2618
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersNameFilterField)
|
|
2619
|
+
.fill(name));
|
|
2620
|
+
isPresent(roles) &&
|
|
2621
|
+
(await this.filterMembersByMultiSelect({ selectedOptions: roles }));
|
|
2622
|
+
await this.applyFilter();
|
|
2623
|
+
};
|
|
2624
|
+
getMemberRowByName = (name) => this.page.getByRole("row").filter({
|
|
2625
|
+
has: this.page.getByTestId(MEMBER_SELECTORS.memberNameCell(name)),
|
|
2626
|
+
});
|
|
2627
|
+
takeActionOnMembers = async ({ names = [], state, action, }) => {
|
|
2628
|
+
if (isPresent(names)) {
|
|
2629
|
+
for (const name of names) {
|
|
2630
|
+
await this.getMemberRowByName(name).getByRole("checkbox").click();
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2633
|
+
else {
|
|
2634
|
+
await this.page
|
|
2635
|
+
.getByRole("columnheader", { name: MEMBER_TEXTS.selectAll })
|
|
2636
|
+
.click();
|
|
2637
|
+
}
|
|
2638
|
+
await this.page.getByTestId(COMMON_SELECTORS.takeActionDropdown).click();
|
|
2639
|
+
if (isPresent(state)) {
|
|
2640
|
+
await this.page
|
|
2641
|
+
.getByTestId(MEMBER_SELECTORS.takeActionStateOption(state))
|
|
2642
|
+
.click();
|
|
2643
|
+
}
|
|
2644
|
+
else {
|
|
2645
|
+
await this.page
|
|
2646
|
+
.getByRole("button", { name: action?.actionButtonText })
|
|
2647
|
+
.click();
|
|
2648
|
+
await this.page
|
|
2649
|
+
.getByRole("button", { name: action?.valueButtonText })
|
|
2650
|
+
.click();
|
|
2651
|
+
}
|
|
2652
|
+
await this.page
|
|
2653
|
+
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
2654
|
+
.click();
|
|
2655
|
+
await this.neetoPlaywrightUtilities.verifyToast();
|
|
2656
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2657
|
+
};
|
|
2658
|
+
performColumnAction = async ({ columnName = "Name", actionButtonText = "Ascending", } = {}) => {
|
|
2659
|
+
await this.page
|
|
2660
|
+
.getByTestId(MEMBER_SELECTORS.teamMembersTable)
|
|
2661
|
+
.getByLabel(columnName)
|
|
2662
|
+
.getByTestId(TABLE_SELECTORS.columnMenuButton)
|
|
2663
|
+
.click();
|
|
2664
|
+
await this.page.getByRole("button", { name: actionButtonText }).click();
|
|
2665
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2666
|
+
await expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
2667
|
+
};
|
|
2668
|
+
toggleMemberColumns = async ({ columns = [], bulkAction, }) => {
|
|
2669
|
+
await expect(async () => {
|
|
2670
|
+
await this.page
|
|
2671
|
+
.getByTestId(COMMON_SELECTORS.columnsDropdownButton)
|
|
2672
|
+
.click();
|
|
2673
|
+
await expect(this.page.getByTestId(COMMON_SELECTORS.columnsSearchInput)).toBeVisible();
|
|
2674
|
+
}).toPass({ timeout: 15_000 });
|
|
2675
|
+
if (isPresent(bulkAction)) {
|
|
2676
|
+
await this.page
|
|
2677
|
+
.getByTestId(COMMON_SELECTORS.columnVisibilityBtn(bulkAction === "hide" ? "hide-all" : "reset"))
|
|
2678
|
+
.click();
|
|
2679
|
+
}
|
|
2680
|
+
else {
|
|
2681
|
+
for (const column of columns) {
|
|
2682
|
+
await this.page
|
|
2683
|
+
.getByTestId(COMMON_SELECTORS.columnsSearchInput)
|
|
2684
|
+
.fill(column);
|
|
2685
|
+
const columnCheckbox = this.page
|
|
2686
|
+
.getByTestId(COMMON_SELECTORS.nuiCheckboxContainer)
|
|
2687
|
+
.filter({ hasText: column })
|
|
2688
|
+
.getByTestId(MEMBER_SELECTORS.columnCheckBox);
|
|
2689
|
+
const isChecked = await columnCheckbox.isChecked();
|
|
2690
|
+
await columnCheckbox.click();
|
|
2691
|
+
await expect(columnCheckbox).toBeChecked({ checked: !isChecked });
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
await this.page.getByTestId(COMMON_SELECTORS.columnsDropdownButton).click();
|
|
2695
|
+
};
|
|
2696
|
+
verifyMemberInTable = ({ name, email }) => expect(this.getMemberRowByName(name).getByRole("cell", {
|
|
2697
|
+
name: email,
|
|
2698
|
+
exact: true,
|
|
2699
|
+
})).toBeVisible();
|
|
2700
|
+
applyFilter = async () => {
|
|
2701
|
+
await expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeVisible();
|
|
2702
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2703
|
+
await expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden({
|
|
2704
|
+
timeout: 30_000,
|
|
2705
|
+
});
|
|
2706
|
+
await this.page
|
|
2707
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.filterDoneButton)
|
|
2708
|
+
.click();
|
|
2709
|
+
};
|
|
2710
|
+
exportDetails = async (fileType, adminEmail) => {
|
|
2711
|
+
await this.page.getByTestId(MEMBER_SELECTORS.downloadButton).click();
|
|
2712
|
+
await expect(this.page.getByTestId(MEMBER_SELECTORS.exportMemberHeading)).toHaveText(this.t("neetoTeamMembers.exportPane.title"));
|
|
2713
|
+
await this.page
|
|
2714
|
+
.getByTestId(MEMBER_SELECTORS.downloadAsRadioItem(fileType))
|
|
2715
|
+
.check();
|
|
2716
|
+
const exportStartTime = new Date();
|
|
2717
|
+
await this.page.getByTestId(MEMBER_SELECTORS.exportSubmitBtn).click();
|
|
2718
|
+
await this.neetoPlaywrightUtilities.verifyToast({
|
|
2719
|
+
message: this.t("toastr.success.exportMembers", { email: adminEmail }),
|
|
2720
|
+
});
|
|
2721
|
+
return exportStartTime;
|
|
2722
|
+
};
|
|
2723
|
+
verifyNoDataTitle = async (email) => {
|
|
2724
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
2725
|
+
await this.page.getByTestId(MEMBER_SELECTORS.searchTextField).fill(email);
|
|
2726
|
+
await expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeVisible();
|
|
2727
|
+
await expect(this.page.getByTestId(COMMON_SELECTORS.noDataTitle)).toBeVisible({ timeout: 10_000 });
|
|
2728
|
+
await filterUtils.clearFiltersFromActionBlock(this.page);
|
|
2729
|
+
};
|
|
2730
|
+
}
|
|
2731
|
+
|
|
2459
2732
|
const fillCredentialsAndSubmit = async ({ page, loginPath, email = CREDENTIALS.email, }) => {
|
|
2460
2733
|
loginPath && (await page.goto(loginPath, { timeout: 30_000 }));
|
|
2461
2734
|
await page.waitForLoadState("load", { timeout: 35_000 });
|
|
@@ -18042,14 +18315,17 @@ class Health {
|
|
|
18042
18315
|
neetoPlaywrightUtilities;
|
|
18043
18316
|
email = process.env.PLAYWRIGHT_PRODUCTION_EMAIL;
|
|
18044
18317
|
loginPage;
|
|
18318
|
+
teamMembers;
|
|
18045
18319
|
constructor(page, neetoPlaywrightUtilities) {
|
|
18046
18320
|
this.page = page;
|
|
18047
18321
|
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
18048
18322
|
if (!process.env.PLAYWRIGHT_PRODUCTION_EMAIL ||
|
|
18049
|
-
!process.env.PLAYWRIGHT_PRODUCTION_2FA_SECRET_KEY
|
|
18050
|
-
|
|
18323
|
+
!process.env.PLAYWRIGHT_PRODUCTION_2FA_SECRET_KEY ||
|
|
18324
|
+
!process.env.FASTMAIL_DOMAIN_NAME) {
|
|
18325
|
+
throw new Error("One or more required env variables are missing: PLAYWRIGHT_PRODUCTION_EMAIL, PLAYWRIGHT_PRODUCTION_2FA_SECRET_KEY, FASTMAIL_DOMAIN_NAME");
|
|
18051
18326
|
}
|
|
18052
18327
|
this.loginPage = new OrganizationPage(page, neetoPlaywrightUtilities);
|
|
18328
|
+
this.teamMembers = new TeamMembers({ page, neetoPlaywrightUtilities });
|
|
18053
18329
|
}
|
|
18054
18330
|
loginToApp = async (route = ROUTES.adminPanel.index) => {
|
|
18055
18331
|
await this.page.goto(route);
|
|
@@ -18064,6 +18340,26 @@ class Health {
|
|
|
18064
18340
|
verifyAppIsLive = async (customSteps) => {
|
|
18065
18341
|
await test.step("1: Login to the application", () => this.loginToApp());
|
|
18066
18342
|
await test.step("2: Verify application UI", this.verifyAppUI);
|
|
18343
|
+
await test.step("3: Navigate to team members page", async () => {
|
|
18344
|
+
await this.page.goto(ROUTES.members);
|
|
18345
|
+
await this.neetoPlaywrightUtilities.waitForFloatingMenu();
|
|
18346
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
18347
|
+
});
|
|
18348
|
+
await test.step("4: Verify adding & removing members", async () => {
|
|
18349
|
+
const email = faker.internet
|
|
18350
|
+
.email({ provider: process.env.FASTMAIL_DOMAIN_NAME })
|
|
18351
|
+
.toLowerCase();
|
|
18352
|
+
const memberRow = this.page.getByRole("row").filter({
|
|
18353
|
+
has: this.page.getByRole("cell", { name: email, exact: true }),
|
|
18354
|
+
});
|
|
18355
|
+
await this.teamMembers.openMemberPane();
|
|
18356
|
+
await this.teamMembers.fillMemberForm([email]);
|
|
18357
|
+
await this.teamMembers.submit();
|
|
18358
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
18359
|
+
await expect(memberRow).toBeVisible();
|
|
18360
|
+
await this.teamMembers.removeMemberViaUI(memberRow);
|
|
18361
|
+
await expect(memberRow).toBeHidden();
|
|
18362
|
+
});
|
|
18067
18363
|
await customSteps?.();
|
|
18068
18364
|
};
|
|
18069
18365
|
}
|
|
@@ -119697,20 +119993,23 @@ class MicrosoftPage extends IntegrationBase {
|
|
|
119697
119993
|
isNil(process.env.MICROSOFT_2FA_SECRET_KEY)) {
|
|
119698
119994
|
throw new Error("ENV variable MICROSOFT_LOGIN_EMAIL or MICROSOFT_LOGIN_PASSWORD or MICROSOFT_2FA_SECRET_KEY is not properly configured");
|
|
119699
119995
|
}
|
|
119996
|
+
const useVerificationCodeButton = this.page.getByRole("button", {
|
|
119997
|
+
name: MICROSOFT_LOGIN_TEXTS.useVerificationCode,
|
|
119998
|
+
});
|
|
119700
119999
|
await this.page.goto(THIRD_PARTY_ROUTES.microsoft.login);
|
|
119701
120000
|
await this.enterEmail();
|
|
119702
120001
|
await this.page
|
|
119703
120002
|
.getByRole("button", { name: MICROSOFT_LOGIN_TEXTS.next })
|
|
119704
120003
|
.click();
|
|
119705
120004
|
await this.enterPassword();
|
|
119706
|
-
|
|
119707
|
-
|
|
119708
|
-
|
|
119709
|
-
await
|
|
119710
|
-
|
|
119711
|
-
|
|
119712
|
-
})
|
|
119713
|
-
.click();
|
|
120005
|
+
const signInButton = this.page.getByRole("button", {
|
|
120006
|
+
name: MICROSOFT_LOGIN_TEXTS.signIn,
|
|
120007
|
+
});
|
|
120008
|
+
await signInButton.click();
|
|
120009
|
+
await expect(signInButton).toBeHidden({ timeout: 10_000 });
|
|
120010
|
+
await this.page.waitForLoadState("load", { timeout: 25_000 });
|
|
120011
|
+
(await useVerificationCodeButton.isVisible({ timeout: 20_000 })) &&
|
|
120012
|
+
(await useVerificationCodeButton.click());
|
|
119714
120013
|
await this.enterTotpCode();
|
|
119715
120014
|
await this.staySignedIn();
|
|
119716
120015
|
}, ["microsoft.com", "live.com", "microsoftonline.com"]);
|
|
@@ -121301,270 +121600,6 @@ class ImageUploader {
|
|
|
121301
121600
|
};
|
|
121302
121601
|
}
|
|
121303
121602
|
|
|
121304
|
-
const openFilterPane = async (page) => {
|
|
121305
|
-
await page
|
|
121306
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.filterButton)
|
|
121307
|
-
.or(page.getByTestId(COMMON_SELECTORS.filterButon))
|
|
121308
|
-
.click();
|
|
121309
|
-
await expect(page.getByTestId(COMMON_SELECTORS.paneHeader)).toHaveText(getI18nInstance().t("neetoFilters.common.filters"));
|
|
121310
|
-
};
|
|
121311
|
-
const clearFiltersFromActionBlock = async (page) => {
|
|
121312
|
-
const isClearButtonVisible = await page
|
|
121313
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
|
|
121314
|
-
.isVisible();
|
|
121315
|
-
if (isClearButtonVisible) {
|
|
121316
|
-
await page
|
|
121317
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
|
|
121318
|
-
.click();
|
|
121319
|
-
await Promise.all([
|
|
121320
|
-
expect(page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeHidden(),
|
|
121321
|
-
expect(page.locator(COMMON_SELECTORS.tableSpinner)).toHaveCount(0, {
|
|
121322
|
-
timeout: 15_000,
|
|
121323
|
-
}),
|
|
121324
|
-
]);
|
|
121325
|
-
}
|
|
121326
|
-
};
|
|
121327
|
-
const filterUtils = {
|
|
121328
|
-
openFilterPane,
|
|
121329
|
-
clearFiltersFromActionBlock,
|
|
121330
|
-
};
|
|
121331
|
-
|
|
121332
|
-
class TeamMembers {
|
|
121333
|
-
page;
|
|
121334
|
-
neetoPlaywrightUtilities;
|
|
121335
|
-
t;
|
|
121336
|
-
constructor({ page, neetoPlaywrightUtilities, }) {
|
|
121337
|
-
this.page = page;
|
|
121338
|
-
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
121339
|
-
this.t = getI18nInstance().t;
|
|
121340
|
-
}
|
|
121341
|
-
navigateToTeamMembers = async () => {
|
|
121342
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121343
|
-
await this.page.getByTestId(MEMBER_SELECTORS.membersTab).click();
|
|
121344
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121345
|
-
};
|
|
121346
|
-
addMemberViaUI = async ({ emails = [faker.internet.exampleEmail()], role = "standard", } = {}) => {
|
|
121347
|
-
await this.page.getByTestId(MEMBER_SELECTORS.newButton).click();
|
|
121348
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121349
|
-
const continueButton = this.page.getByTestId(MEMBER_SELECTORS.continueButton);
|
|
121350
|
-
await expect(continueButton).toBeVisible();
|
|
121351
|
-
await expect(continueButton.getByTestId(COMMON_SELECTORS.uiSpinner)).toBeHidden({ timeout: 35_000 });
|
|
121352
|
-
await this.page
|
|
121353
|
-
.getByTestId(MEMBER_FORM_SELECTORS.emailTextField)
|
|
121354
|
-
.fill(emails.join(", "));
|
|
121355
|
-
await this.page.keyboard.press("Enter");
|
|
121356
|
-
await this.neetoPlaywrightUtilities.toggleElement({
|
|
121357
|
-
locator: this.page.getByTestId(MEMBER_SELECTORS.roleLabel(role)),
|
|
121358
|
-
});
|
|
121359
|
-
await continueButton.click();
|
|
121360
|
-
if (IS_STAGING_ENV) {
|
|
121361
|
-
await this.page
|
|
121362
|
-
.getByTestId(COMMON_SELECTORS.paneBody)
|
|
121363
|
-
.getByTestId(COMMON_SELECTORS.checkboxLabel)
|
|
121364
|
-
.click();
|
|
121365
|
-
await this.page.getByTestId(MEMBER_SELECTORS.continueButton).click();
|
|
121366
|
-
}
|
|
121367
|
-
await this.submit();
|
|
121368
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121369
|
-
};
|
|
121370
|
-
submit = async () => {
|
|
121371
|
-
const pane = this.page.getByTestId(COMMON_SELECTORS.paneBody);
|
|
121372
|
-
const submitBtn = this.page.getByTestId(MEMBER_SELECTORS.submitButton);
|
|
121373
|
-
const buttonSpinner = submitBtn.getByTestId(COMMON_SELECTORS.uiSpinner);
|
|
121374
|
-
await expect(submitBtn).toBeVisible({ timeout: 10_000 });
|
|
121375
|
-
await expect(async () => {
|
|
121376
|
-
if (await pane.isHidden())
|
|
121377
|
-
return;
|
|
121378
|
-
(await buttonSpinner.isHidden()) && (await submitBtn.click());
|
|
121379
|
-
await expect(buttonSpinner).toBeHidden({ timeout: 10_000 });
|
|
121380
|
-
await expect(pane).toBeHidden();
|
|
121381
|
-
}).toPass({ timeout: 60_000 });
|
|
121382
|
-
await this.neetoPlaywrightUtilities.verifyToast();
|
|
121383
|
-
};
|
|
121384
|
-
searchAndVerifyMemberByEmail = async ({ email }) => {
|
|
121385
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121386
|
-
await this.page.getByTestId(MEMBER_SELECTORS.searchTextField).fill(email);
|
|
121387
|
-
const emailSubstr = email.length > 20 ? email.substring(0, 20) : email;
|
|
121388
|
-
await expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.searchTermBlock)).toContainText(emailSubstr);
|
|
121389
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121390
|
-
await expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
121391
|
-
await expect(this.page.getByRole("cell", { name: email, exact: true })).toBeVisible();
|
|
121392
|
-
};
|
|
121393
|
-
editMemberViaUI = async ({ email = "", firstName = "", lastName = "", role = "standard", } = {}) => {
|
|
121394
|
-
await this.page.getByTestId(MEMBER_SELECTORS.dropDownIcon).click();
|
|
121395
|
-
await this.page.getByTestId(MEMBER_SELECTORS.editButton).click();
|
|
121396
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121397
|
-
isPresent(email) &&
|
|
121398
|
-
(await this.page
|
|
121399
|
-
.getByTestId(MEMBER_FORM_SELECTORS.emailInput)
|
|
121400
|
-
.fill(email));
|
|
121401
|
-
isPresent(firstName) &&
|
|
121402
|
-
(await this.page
|
|
121403
|
-
.getByTestId(MEMBER_FORM_SELECTORS.firstNameTextField)
|
|
121404
|
-
.fill(firstName));
|
|
121405
|
-
isPresent(lastName) &&
|
|
121406
|
-
(await this.page
|
|
121407
|
-
.getByTestId(MEMBER_FORM_SELECTORS.lastNameTextField)
|
|
121408
|
-
.fill(lastName));
|
|
121409
|
-
await this.neetoPlaywrightUtilities.toggleElement({
|
|
121410
|
-
locator: this.page.getByTestId(MEMBER_SELECTORS.roleLabel(role)),
|
|
121411
|
-
});
|
|
121412
|
-
await this.submit();
|
|
121413
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121414
|
-
};
|
|
121415
|
-
removeMemberViaUI = async () => {
|
|
121416
|
-
await this.page.getByTestId(MEMBER_SELECTORS.dropDownIcon).click();
|
|
121417
|
-
await this.page.getByTestId(MEMBER_SELECTORS.removeMember).click();
|
|
121418
|
-
await this.page
|
|
121419
|
-
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
121420
|
-
.click();
|
|
121421
|
-
await this.neetoPlaywrightUtilities.verifyToast();
|
|
121422
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121423
|
-
};
|
|
121424
|
-
filterMembersByMultiSelect = async ({ selectedOptions = [], selectContainerLocator = NEETO_FILTERS_SELECTORS.roleSelectContainer, }) => {
|
|
121425
|
-
await this.page
|
|
121426
|
-
.getByTestId(selectContainerLocator)
|
|
121427
|
-
.getByTestId(COMMON_SELECTORS.actionSelectIndicator)
|
|
121428
|
-
.click();
|
|
121429
|
-
for (const option of selectedOptions) {
|
|
121430
|
-
await this.page
|
|
121431
|
-
.getByTestId(COMMON_SELECTORS.selectOption(option))
|
|
121432
|
-
.click();
|
|
121433
|
-
}
|
|
121434
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121435
|
-
await expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
121436
|
-
};
|
|
121437
|
-
filterMembers = async ({ email = { id: "", condition: "Is" }, roles = [], name = "", }) => {
|
|
121438
|
-
await filterUtils.clearFiltersFromActionBlock(this.page);
|
|
121439
|
-
await filterUtils.openFilterPane(this.page);
|
|
121440
|
-
if (isPresent(email.id)) {
|
|
121441
|
-
await this.page
|
|
121442
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.emailSelectContainer)
|
|
121443
|
-
.getByTestId(COMMON_SELECTORS.actionSelectIndicator)
|
|
121444
|
-
.click();
|
|
121445
|
-
await this.page
|
|
121446
|
-
.getByTestId(COMMON_SELECTORS.selectOption(email.condition))
|
|
121447
|
-
.click();
|
|
121448
|
-
await this.page
|
|
121449
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.filtersEmailFilter)
|
|
121450
|
-
.fill(email.id);
|
|
121451
|
-
}
|
|
121452
|
-
isPresent(name) &&
|
|
121453
|
-
(await this.page
|
|
121454
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersNameFilterField)
|
|
121455
|
-
.fill(name));
|
|
121456
|
-
isPresent(roles) &&
|
|
121457
|
-
(await this.filterMembersByMultiSelect({ selectedOptions: roles }));
|
|
121458
|
-
await this.applyFilter();
|
|
121459
|
-
};
|
|
121460
|
-
getMemberRowByName = (name) => this.page.getByRole("row").filter({
|
|
121461
|
-
has: this.page.getByTestId(MEMBER_SELECTORS.memberNameCell(name)),
|
|
121462
|
-
});
|
|
121463
|
-
takeActionOnMembers = async ({ names = [], state, action, }) => {
|
|
121464
|
-
if (isPresent(names)) {
|
|
121465
|
-
for (const name of names) {
|
|
121466
|
-
await this.getMemberRowByName(name).getByRole("checkbox").click();
|
|
121467
|
-
}
|
|
121468
|
-
}
|
|
121469
|
-
else {
|
|
121470
|
-
await this.page
|
|
121471
|
-
.getByRole("columnheader", { name: MEMBER_TEXTS.selectAll })
|
|
121472
|
-
.click();
|
|
121473
|
-
}
|
|
121474
|
-
await this.page.getByTestId(COMMON_SELECTORS.takeActionDropdown).click();
|
|
121475
|
-
if (isPresent(state)) {
|
|
121476
|
-
await this.page
|
|
121477
|
-
.getByTestId(MEMBER_SELECTORS.takeActionStateOption(state))
|
|
121478
|
-
.click();
|
|
121479
|
-
}
|
|
121480
|
-
else {
|
|
121481
|
-
await this.page
|
|
121482
|
-
.getByRole("button", { name: action?.actionButtonText })
|
|
121483
|
-
.click();
|
|
121484
|
-
await this.page
|
|
121485
|
-
.getByRole("button", { name: action?.valueButtonText })
|
|
121486
|
-
.click();
|
|
121487
|
-
}
|
|
121488
|
-
await this.page
|
|
121489
|
-
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
121490
|
-
.click();
|
|
121491
|
-
await this.neetoPlaywrightUtilities.verifyToast();
|
|
121492
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121493
|
-
};
|
|
121494
|
-
performColumnAction = async ({ columnName = "Name", actionButtonText = "Ascending", } = {}) => {
|
|
121495
|
-
await this.page
|
|
121496
|
-
.getByTestId(MEMBER_SELECTORS.teamMembersTable)
|
|
121497
|
-
.getByLabel(columnName)
|
|
121498
|
-
.getByTestId(TABLE_SELECTORS.columnMenuButton)
|
|
121499
|
-
.click();
|
|
121500
|
-
await this.page.getByRole("button", { name: actionButtonText }).click();
|
|
121501
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121502
|
-
await expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
121503
|
-
};
|
|
121504
|
-
toggleMemberColumns = async ({ columns = [], bulkAction, }) => {
|
|
121505
|
-
await expect(async () => {
|
|
121506
|
-
await this.page
|
|
121507
|
-
.getByTestId(COMMON_SELECTORS.columnsDropdownButton)
|
|
121508
|
-
.click();
|
|
121509
|
-
await expect(this.page.getByTestId(COMMON_SELECTORS.columnsSearchInput)).toBeVisible();
|
|
121510
|
-
}).toPass({ timeout: 15_000 });
|
|
121511
|
-
if (isPresent(bulkAction)) {
|
|
121512
|
-
await this.page
|
|
121513
|
-
.getByTestId(COMMON_SELECTORS.columnVisibilityBtn(bulkAction === "hide" ? "hide-all" : "reset"))
|
|
121514
|
-
.click();
|
|
121515
|
-
}
|
|
121516
|
-
else {
|
|
121517
|
-
for (const column of columns) {
|
|
121518
|
-
await this.page
|
|
121519
|
-
.getByTestId(COMMON_SELECTORS.columnsSearchInput)
|
|
121520
|
-
.fill(column);
|
|
121521
|
-
const columnCheckbox = this.page
|
|
121522
|
-
.getByTestId(COMMON_SELECTORS.nuiCheckboxContainer)
|
|
121523
|
-
.filter({ hasText: column })
|
|
121524
|
-
.getByTestId(MEMBER_SELECTORS.columnCheckBox);
|
|
121525
|
-
const isChecked = await columnCheckbox.isChecked();
|
|
121526
|
-
await columnCheckbox.click();
|
|
121527
|
-
await expect(columnCheckbox).toBeChecked({ checked: !isChecked });
|
|
121528
|
-
}
|
|
121529
|
-
}
|
|
121530
|
-
await this.page.getByTestId(COMMON_SELECTORS.columnsDropdownButton).click();
|
|
121531
|
-
};
|
|
121532
|
-
verifyMemberInTable = ({ name, email }) => expect(this.getMemberRowByName(name).getByRole("cell", {
|
|
121533
|
-
name: email,
|
|
121534
|
-
exact: true,
|
|
121535
|
-
})).toBeVisible();
|
|
121536
|
-
applyFilter = async () => {
|
|
121537
|
-
await expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeVisible();
|
|
121538
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121539
|
-
await expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden({
|
|
121540
|
-
timeout: 30_000,
|
|
121541
|
-
});
|
|
121542
|
-
await this.page
|
|
121543
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.filterDoneButton)
|
|
121544
|
-
.click();
|
|
121545
|
-
};
|
|
121546
|
-
exportDetails = async (fileType, adminEmail) => {
|
|
121547
|
-
await this.page.getByTestId(MEMBER_SELECTORS.downloadButton).click();
|
|
121548
|
-
await expect(this.page.getByTestId(MEMBER_SELECTORS.exportMemberHeading)).toHaveText(this.t("neetoTeamMembers.exportPane.title"));
|
|
121549
|
-
await this.page
|
|
121550
|
-
.getByTestId(MEMBER_SELECTORS.downloadAsRadioItem(fileType))
|
|
121551
|
-
.check();
|
|
121552
|
-
const exportStartTime = new Date();
|
|
121553
|
-
await this.page.getByTestId(MEMBER_SELECTORS.exportSubmitBtn).click();
|
|
121554
|
-
await this.neetoPlaywrightUtilities.verifyToast({
|
|
121555
|
-
message: this.t("toastr.success.exportMembers", { email: adminEmail }),
|
|
121556
|
-
});
|
|
121557
|
-
return exportStartTime;
|
|
121558
|
-
};
|
|
121559
|
-
verifyNoDataTitle = async (email) => {
|
|
121560
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121561
|
-
await this.page.getByTestId(MEMBER_SELECTORS.searchTextField).fill(email);
|
|
121562
|
-
await expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeVisible();
|
|
121563
|
-
await expect(this.page.getByTestId(COMMON_SELECTORS.noDataTitle)).toBeVisible({ timeout: 10_000 });
|
|
121564
|
-
await filterUtils.clearFiltersFromActionBlock(this.page);
|
|
121565
|
-
};
|
|
121566
|
-
}
|
|
121567
|
-
|
|
121568
121603
|
dayjs.extend(customParseFormat);
|
|
121569
121604
|
class ApiKeysPage {
|
|
121570
121605
|
page;
|
|
@@ -121667,7 +121702,7 @@ class AuditLogsPage {
|
|
|
121667
121702
|
this.currentDate = dayjs().tz("Asia/Kolkata").format("MMM D, YYYY");
|
|
121668
121703
|
this.messageBuilders = {
|
|
121669
121704
|
[ACTIONS.inviteUsers]: (data) => `${this.admin} added ${data.emails.join(", ").toLowerCase()} to Neeto${this.product}.`,
|
|
121670
|
-
[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}.`,
|
|
121705
|
+
[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}.`,
|
|
121671
121706
|
[ACTIONS.removedUser]: (data) => `${this.admin} removed ${data.emails[0].toLowerCase()} from Neeto${this.product}.`,
|
|
121672
121707
|
[ACTIONS.createdRole]: (data) => `${this.admin} created ${data.roleName} role on Neeto${this.product}.`,
|
|
121673
121708
|
[ACTIONS.addedPermission]: (data) => `${this.admin} added ${data.permissions.join(", ").toLowerCase()} permission to ${data.roleName} role on Neeto${this.product}.`,
|