@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.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_STAGING_ENV) {
|
|
2542
|
+
await this.page
|
|
2543
|
+
.getByTestId(COMMON_SELECTORS.paneBody)
|
|
2544
|
+
.getByTestId(COMMON_SELECTORS.checkboxLabel)
|
|
2545
|
+
.click();
|
|
2546
|
+
await continueBtn.click();
|
|
2547
|
+
}
|
|
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
|
}
|
|
@@ -119718,20 +120014,23 @@ class MicrosoftPage extends IntegrationBase {
|
|
|
119718
120014
|
ramda.isNil(process.env.MICROSOFT_2FA_SECRET_KEY)) {
|
|
119719
120015
|
throw new Error("ENV variable MICROSOFT_LOGIN_EMAIL or MICROSOFT_LOGIN_PASSWORD or MICROSOFT_2FA_SECRET_KEY is not properly configured");
|
|
119720
120016
|
}
|
|
120017
|
+
const useVerificationCodeButton = this.page.getByRole("button", {
|
|
120018
|
+
name: MICROSOFT_LOGIN_TEXTS.useVerificationCode,
|
|
120019
|
+
});
|
|
119721
120020
|
await this.page.goto(THIRD_PARTY_ROUTES.microsoft.login);
|
|
119722
120021
|
await this.enterEmail();
|
|
119723
120022
|
await this.page
|
|
119724
120023
|
.getByRole("button", { name: MICROSOFT_LOGIN_TEXTS.next })
|
|
119725
120024
|
.click();
|
|
119726
120025
|
await this.enterPassword();
|
|
119727
|
-
|
|
119728
|
-
|
|
119729
|
-
|
|
119730
|
-
await
|
|
119731
|
-
|
|
119732
|
-
|
|
119733
|
-
})
|
|
119734
|
-
.click();
|
|
120026
|
+
const signInButton = this.page.getByRole("button", {
|
|
120027
|
+
name: MICROSOFT_LOGIN_TEXTS.signIn,
|
|
120028
|
+
});
|
|
120029
|
+
await signInButton.click();
|
|
120030
|
+
await test.expect(signInButton).toBeHidden({ timeout: 10_000 });
|
|
120031
|
+
await this.page.waitForLoadState("load", { timeout: 25_000 });
|
|
120032
|
+
(await useVerificationCodeButton.isVisible({ timeout: 20_000 })) &&
|
|
120033
|
+
(await useVerificationCodeButton.click());
|
|
119735
120034
|
await this.enterTotpCode();
|
|
119736
120035
|
await this.staySignedIn();
|
|
119737
120036
|
}, ["microsoft.com", "live.com", "microsoftonline.com"]);
|
|
@@ -121322,270 +121621,6 @@ class ImageUploader {
|
|
|
121322
121621
|
};
|
|
121323
121622
|
}
|
|
121324
121623
|
|
|
121325
|
-
const openFilterPane = async (page) => {
|
|
121326
|
-
await page
|
|
121327
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.filterButton)
|
|
121328
|
-
.or(page.getByTestId(COMMON_SELECTORS.filterButon))
|
|
121329
|
-
.click();
|
|
121330
|
-
await test.expect(page.getByTestId(COMMON_SELECTORS.paneHeader)).toHaveText(playwrightI18nextFixture.getI18nInstance().t("neetoFilters.common.filters"));
|
|
121331
|
-
};
|
|
121332
|
-
const clearFiltersFromActionBlock = async (page) => {
|
|
121333
|
-
const isClearButtonVisible = await page
|
|
121334
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
|
|
121335
|
-
.isVisible();
|
|
121336
|
-
if (isClearButtonVisible) {
|
|
121337
|
-
await page
|
|
121338
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
|
|
121339
|
-
.click();
|
|
121340
|
-
await Promise.all([
|
|
121341
|
-
test.expect(page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeHidden(),
|
|
121342
|
-
test.expect(page.locator(COMMON_SELECTORS.tableSpinner)).toHaveCount(0, {
|
|
121343
|
-
timeout: 15_000,
|
|
121344
|
-
}),
|
|
121345
|
-
]);
|
|
121346
|
-
}
|
|
121347
|
-
};
|
|
121348
|
-
const filterUtils = {
|
|
121349
|
-
openFilterPane,
|
|
121350
|
-
clearFiltersFromActionBlock,
|
|
121351
|
-
};
|
|
121352
|
-
|
|
121353
|
-
class TeamMembers {
|
|
121354
|
-
page;
|
|
121355
|
-
neetoPlaywrightUtilities;
|
|
121356
|
-
t;
|
|
121357
|
-
constructor({ page, neetoPlaywrightUtilities, }) {
|
|
121358
|
-
this.page = page;
|
|
121359
|
-
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
121360
|
-
this.t = playwrightI18nextFixture.getI18nInstance().t;
|
|
121361
|
-
}
|
|
121362
|
-
navigateToTeamMembers = async () => {
|
|
121363
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121364
|
-
await this.page.getByTestId(MEMBER_SELECTORS.membersTab).click();
|
|
121365
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121366
|
-
};
|
|
121367
|
-
addMemberViaUI = async ({ emails = [faker.faker.internet.exampleEmail()], role = "standard", } = {}) => {
|
|
121368
|
-
await this.page.getByTestId(MEMBER_SELECTORS.newButton).click();
|
|
121369
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121370
|
-
const continueButton = this.page.getByTestId(MEMBER_SELECTORS.continueButton);
|
|
121371
|
-
await test.expect(continueButton).toBeVisible();
|
|
121372
|
-
await test.expect(continueButton.getByTestId(COMMON_SELECTORS.uiSpinner)).toBeHidden({ timeout: 35_000 });
|
|
121373
|
-
await this.page
|
|
121374
|
-
.getByTestId(MEMBER_FORM_SELECTORS.emailTextField)
|
|
121375
|
-
.fill(emails.join(", "));
|
|
121376
|
-
await this.page.keyboard.press("Enter");
|
|
121377
|
-
await this.neetoPlaywrightUtilities.toggleElement({
|
|
121378
|
-
locator: this.page.getByTestId(MEMBER_SELECTORS.roleLabel(role)),
|
|
121379
|
-
});
|
|
121380
|
-
await continueButton.click();
|
|
121381
|
-
if (IS_STAGING_ENV) {
|
|
121382
|
-
await this.page
|
|
121383
|
-
.getByTestId(COMMON_SELECTORS.paneBody)
|
|
121384
|
-
.getByTestId(COMMON_SELECTORS.checkboxLabel)
|
|
121385
|
-
.click();
|
|
121386
|
-
await this.page.getByTestId(MEMBER_SELECTORS.continueButton).click();
|
|
121387
|
-
}
|
|
121388
|
-
await this.submit();
|
|
121389
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121390
|
-
};
|
|
121391
|
-
submit = async () => {
|
|
121392
|
-
const pane = this.page.getByTestId(COMMON_SELECTORS.paneBody);
|
|
121393
|
-
const submitBtn = this.page.getByTestId(MEMBER_SELECTORS.submitButton);
|
|
121394
|
-
const buttonSpinner = submitBtn.getByTestId(COMMON_SELECTORS.uiSpinner);
|
|
121395
|
-
await test.expect(submitBtn).toBeVisible({ timeout: 10_000 });
|
|
121396
|
-
await test.expect(async () => {
|
|
121397
|
-
if (await pane.isHidden())
|
|
121398
|
-
return;
|
|
121399
|
-
(await buttonSpinner.isHidden()) && (await submitBtn.click());
|
|
121400
|
-
await test.expect(buttonSpinner).toBeHidden({ timeout: 10_000 });
|
|
121401
|
-
await test.expect(pane).toBeHidden();
|
|
121402
|
-
}).toPass({ timeout: 60_000 });
|
|
121403
|
-
await this.neetoPlaywrightUtilities.verifyToast();
|
|
121404
|
-
};
|
|
121405
|
-
searchAndVerifyMemberByEmail = async ({ email }) => {
|
|
121406
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121407
|
-
await this.page.getByTestId(MEMBER_SELECTORS.searchTextField).fill(email);
|
|
121408
|
-
const emailSubstr = email.length > 20 ? email.substring(0, 20) : email;
|
|
121409
|
-
await test.expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.searchTermBlock)).toContainText(emailSubstr);
|
|
121410
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121411
|
-
await test.expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
121412
|
-
await test.expect(this.page.getByRole("cell", { name: email, exact: true })).toBeVisible();
|
|
121413
|
-
};
|
|
121414
|
-
editMemberViaUI = async ({ email = "", firstName = "", lastName = "", role = "standard", } = {}) => {
|
|
121415
|
-
await this.page.getByTestId(MEMBER_SELECTORS.dropDownIcon).click();
|
|
121416
|
-
await this.page.getByTestId(MEMBER_SELECTORS.editButton).click();
|
|
121417
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121418
|
-
neetoCist.isPresent(email) &&
|
|
121419
|
-
(await this.page
|
|
121420
|
-
.getByTestId(MEMBER_FORM_SELECTORS.emailInput)
|
|
121421
|
-
.fill(email));
|
|
121422
|
-
neetoCist.isPresent(firstName) &&
|
|
121423
|
-
(await this.page
|
|
121424
|
-
.getByTestId(MEMBER_FORM_SELECTORS.firstNameTextField)
|
|
121425
|
-
.fill(firstName));
|
|
121426
|
-
neetoCist.isPresent(lastName) &&
|
|
121427
|
-
(await this.page
|
|
121428
|
-
.getByTestId(MEMBER_FORM_SELECTORS.lastNameTextField)
|
|
121429
|
-
.fill(lastName));
|
|
121430
|
-
await this.neetoPlaywrightUtilities.toggleElement({
|
|
121431
|
-
locator: this.page.getByTestId(MEMBER_SELECTORS.roleLabel(role)),
|
|
121432
|
-
});
|
|
121433
|
-
await this.submit();
|
|
121434
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121435
|
-
};
|
|
121436
|
-
removeMemberViaUI = async () => {
|
|
121437
|
-
await this.page.getByTestId(MEMBER_SELECTORS.dropDownIcon).click();
|
|
121438
|
-
await this.page.getByTestId(MEMBER_SELECTORS.removeMember).click();
|
|
121439
|
-
await this.page
|
|
121440
|
-
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
121441
|
-
.click();
|
|
121442
|
-
await this.neetoPlaywrightUtilities.verifyToast();
|
|
121443
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121444
|
-
};
|
|
121445
|
-
filterMembersByMultiSelect = async ({ selectedOptions = [], selectContainerLocator = NEETO_FILTERS_SELECTORS.roleSelectContainer, }) => {
|
|
121446
|
-
await this.page
|
|
121447
|
-
.getByTestId(selectContainerLocator)
|
|
121448
|
-
.getByTestId(COMMON_SELECTORS.actionSelectIndicator)
|
|
121449
|
-
.click();
|
|
121450
|
-
for (const option of selectedOptions) {
|
|
121451
|
-
await this.page
|
|
121452
|
-
.getByTestId(COMMON_SELECTORS.selectOption(option))
|
|
121453
|
-
.click();
|
|
121454
|
-
}
|
|
121455
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121456
|
-
await test.expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
121457
|
-
};
|
|
121458
|
-
filterMembers = async ({ email = { id: "", condition: "Is" }, roles = [], name = "", }) => {
|
|
121459
|
-
await filterUtils.clearFiltersFromActionBlock(this.page);
|
|
121460
|
-
await filterUtils.openFilterPane(this.page);
|
|
121461
|
-
if (neetoCist.isPresent(email.id)) {
|
|
121462
|
-
await this.page
|
|
121463
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.emailSelectContainer)
|
|
121464
|
-
.getByTestId(COMMON_SELECTORS.actionSelectIndicator)
|
|
121465
|
-
.click();
|
|
121466
|
-
await this.page
|
|
121467
|
-
.getByTestId(COMMON_SELECTORS.selectOption(email.condition))
|
|
121468
|
-
.click();
|
|
121469
|
-
await this.page
|
|
121470
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.filtersEmailFilter)
|
|
121471
|
-
.fill(email.id);
|
|
121472
|
-
}
|
|
121473
|
-
neetoCist.isPresent(name) &&
|
|
121474
|
-
(await this.page
|
|
121475
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersNameFilterField)
|
|
121476
|
-
.fill(name));
|
|
121477
|
-
neetoCist.isPresent(roles) &&
|
|
121478
|
-
(await this.filterMembersByMultiSelect({ selectedOptions: roles }));
|
|
121479
|
-
await this.applyFilter();
|
|
121480
|
-
};
|
|
121481
|
-
getMemberRowByName = (name) => this.page.getByRole("row").filter({
|
|
121482
|
-
has: this.page.getByTestId(MEMBER_SELECTORS.memberNameCell(name)),
|
|
121483
|
-
});
|
|
121484
|
-
takeActionOnMembers = async ({ names = [], state, action, }) => {
|
|
121485
|
-
if (neetoCist.isPresent(names)) {
|
|
121486
|
-
for (const name of names) {
|
|
121487
|
-
await this.getMemberRowByName(name).getByRole("checkbox").click();
|
|
121488
|
-
}
|
|
121489
|
-
}
|
|
121490
|
-
else {
|
|
121491
|
-
await this.page
|
|
121492
|
-
.getByRole("columnheader", { name: MEMBER_TEXTS.selectAll })
|
|
121493
|
-
.click();
|
|
121494
|
-
}
|
|
121495
|
-
await this.page.getByTestId(COMMON_SELECTORS.takeActionDropdown).click();
|
|
121496
|
-
if (neetoCist.isPresent(state)) {
|
|
121497
|
-
await this.page
|
|
121498
|
-
.getByTestId(MEMBER_SELECTORS.takeActionStateOption(state))
|
|
121499
|
-
.click();
|
|
121500
|
-
}
|
|
121501
|
-
else {
|
|
121502
|
-
await this.page
|
|
121503
|
-
.getByRole("button", { name: action?.actionButtonText })
|
|
121504
|
-
.click();
|
|
121505
|
-
await this.page
|
|
121506
|
-
.getByRole("button", { name: action?.valueButtonText })
|
|
121507
|
-
.click();
|
|
121508
|
-
}
|
|
121509
|
-
await this.page
|
|
121510
|
-
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
121511
|
-
.click();
|
|
121512
|
-
await this.neetoPlaywrightUtilities.verifyToast();
|
|
121513
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121514
|
-
};
|
|
121515
|
-
performColumnAction = async ({ columnName = "Name", actionButtonText = "Ascending", } = {}) => {
|
|
121516
|
-
await this.page
|
|
121517
|
-
.getByTestId(MEMBER_SELECTORS.teamMembersTable)
|
|
121518
|
-
.getByLabel(columnName)
|
|
121519
|
-
.getByTestId(TABLE_SELECTORS.columnMenuButton)
|
|
121520
|
-
.click();
|
|
121521
|
-
await this.page.getByRole("button", { name: actionButtonText }).click();
|
|
121522
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121523
|
-
await test.expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
|
|
121524
|
-
};
|
|
121525
|
-
toggleMemberColumns = async ({ columns = [], bulkAction, }) => {
|
|
121526
|
-
await test.expect(async () => {
|
|
121527
|
-
await this.page
|
|
121528
|
-
.getByTestId(COMMON_SELECTORS.columnsDropdownButton)
|
|
121529
|
-
.click();
|
|
121530
|
-
await test.expect(this.page.getByTestId(COMMON_SELECTORS.columnsSearchInput)).toBeVisible();
|
|
121531
|
-
}).toPass({ timeout: 15_000 });
|
|
121532
|
-
if (neetoCist.isPresent(bulkAction)) {
|
|
121533
|
-
await this.page
|
|
121534
|
-
.getByTestId(COMMON_SELECTORS.columnVisibilityBtn(bulkAction === "hide" ? "hide-all" : "reset"))
|
|
121535
|
-
.click();
|
|
121536
|
-
}
|
|
121537
|
-
else {
|
|
121538
|
-
for (const column of columns) {
|
|
121539
|
-
await this.page
|
|
121540
|
-
.getByTestId(COMMON_SELECTORS.columnsSearchInput)
|
|
121541
|
-
.fill(column);
|
|
121542
|
-
const columnCheckbox = this.page
|
|
121543
|
-
.getByTestId(COMMON_SELECTORS.nuiCheckboxContainer)
|
|
121544
|
-
.filter({ hasText: column })
|
|
121545
|
-
.getByTestId(MEMBER_SELECTORS.columnCheckBox);
|
|
121546
|
-
const isChecked = await columnCheckbox.isChecked();
|
|
121547
|
-
await columnCheckbox.click();
|
|
121548
|
-
await test.expect(columnCheckbox).toBeChecked({ checked: !isChecked });
|
|
121549
|
-
}
|
|
121550
|
-
}
|
|
121551
|
-
await this.page.getByTestId(COMMON_SELECTORS.columnsDropdownButton).click();
|
|
121552
|
-
};
|
|
121553
|
-
verifyMemberInTable = ({ name, email }) => test.expect(this.getMemberRowByName(name).getByRole("cell", {
|
|
121554
|
-
name: email,
|
|
121555
|
-
exact: true,
|
|
121556
|
-
})).toBeVisible();
|
|
121557
|
-
applyFilter = async () => {
|
|
121558
|
-
await test.expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeVisible();
|
|
121559
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121560
|
-
await test.expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden({
|
|
121561
|
-
timeout: 30_000,
|
|
121562
|
-
});
|
|
121563
|
-
await this.page
|
|
121564
|
-
.getByTestId(NEETO_FILTERS_SELECTORS.filterDoneButton)
|
|
121565
|
-
.click();
|
|
121566
|
-
};
|
|
121567
|
-
exportDetails = async (fileType, adminEmail) => {
|
|
121568
|
-
await this.page.getByTestId(MEMBER_SELECTORS.downloadButton).click();
|
|
121569
|
-
await test.expect(this.page.getByTestId(MEMBER_SELECTORS.exportMemberHeading)).toHaveText(this.t("neetoTeamMembers.exportPane.title"));
|
|
121570
|
-
await this.page
|
|
121571
|
-
.getByTestId(MEMBER_SELECTORS.downloadAsRadioItem(fileType))
|
|
121572
|
-
.check();
|
|
121573
|
-
const exportStartTime = new Date();
|
|
121574
|
-
await this.page.getByTestId(MEMBER_SELECTORS.exportSubmitBtn).click();
|
|
121575
|
-
await this.neetoPlaywrightUtilities.verifyToast({
|
|
121576
|
-
message: this.t("toastr.success.exportMembers", { email: adminEmail }),
|
|
121577
|
-
});
|
|
121578
|
-
return exportStartTime;
|
|
121579
|
-
};
|
|
121580
|
-
verifyNoDataTitle = async (email) => {
|
|
121581
|
-
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121582
|
-
await this.page.getByTestId(MEMBER_SELECTORS.searchTextField).fill(email);
|
|
121583
|
-
await test.expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)).toBeVisible();
|
|
121584
|
-
await test.expect(this.page.getByTestId(COMMON_SELECTORS.noDataTitle)).toBeVisible({ timeout: 10_000 });
|
|
121585
|
-
await filterUtils.clearFiltersFromActionBlock(this.page);
|
|
121586
|
-
};
|
|
121587
|
-
}
|
|
121588
|
-
|
|
121589
121624
|
dayjs.extend(customParseFormat);
|
|
121590
121625
|
class ApiKeysPage {
|
|
121591
121626
|
page;
|
|
@@ -121688,7 +121723,7 @@ class AuditLogsPage {
|
|
|
121688
121723
|
this.currentDate = dayjs().tz("Asia/Kolkata").format("MMM D, YYYY");
|
|
121689
121724
|
this.messageBuilders = {
|
|
121690
121725
|
[ACTIONS.inviteUsers]: (data) => `${this.admin} added ${data.emails.join(", ").toLowerCase()} to Neeto${this.product}.`,
|
|
121691
|
-
[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}.`,
|
|
121692
121727
|
[ACTIONS.removedUser]: (data) => `${this.admin} removed ${data.emails[0].toLowerCase()} from Neeto${this.product}.`,
|
|
121693
121728
|
[ACTIONS.createdRole]: (data) => `${this.admin} created ${data.roleName} role on Neeto${this.product}.`,
|
|
121694
121729
|
[ACTIONS.addedPermission]: (data) => `${this.admin} added ${data.permissions.join(", ").toLowerCase()} permission to ${data.roleName} role on Neeto${this.product}.`,
|