# Test info

- Name: Feature case for request-listing >> REQ_052 - Resend mail
- Location: /root/code/portal-automation-test/tests/request/function.spec.ts:1748:9

# Error details

```
Error: Timed out 10000ms waiting for expect(locator).toBeVisible()

Locator: locator('//p[text()=\'Updated Successfully!\']')
Expected: visible
Received: <element(s) not found>
Call log:
  - expect.toBeVisible with timeout 10000ms
  - waiting for locator('//p[text()=\'Updated Successfully!\']')

    at /root/code/portal-automation-test/tests/request/function.spec.ts:1769:63
    at /root/code/portal-automation-test/tests/request/function.spec.ts:1767:9
```

# Page snapshot

```yaml
- complementary:
  - img
  - link "WellCare Pharmacy12321@@@@ Portal QA":
    - /url: /
    - paragraph: WellCare Pharmacy12321@@@@
    - paragraph: Portal QA
  - list:
    - listitem:
      - link "Home":
        - /url: https://qa.loprx.com
        - img
        - text: Home
    - listitem:
      - link "Case":
        - /url: https://qa.loprx.com/cases
        - img
        - text: Case
    - listitem:
      - link "Request":
        - /url: https://qa.loprx.com/requests
        - img
        - text: Request
    - listitem:
      - link "Patient":
        - /url: https://qa.loprx.com/clients
        - img
        - text: Patient
    - listitem:
      - button "Business/Contact":
        - img
        - text: Business/Contact
    - listitem:
      - button "Inbox/Sent":
        - img
        - text: Inbox/Sent
    - listitem:
      - button "Settings":
        - img
        - text: Settings
  - list:
    - listitem:
      - link "Shared with me":
        - /url: https://qa.loprx.com/shared/requests
        - img
        - text: Shared with me
- banner:
  - button:
    - img
  - button:
    - img
  - img
  - text: Minh Phong shared details regarding New Case 123 Letter of Protection. See the information now. 4 days ago
  - img
  - text: What did Tri01 Duc say? Their response to John Doe Letter of Protection is waiting. 5 hours ago
  - img
  - text: Son HaiBon Phan assigned a request to you 6 hours ago
  - img
  - text: Son HaiBon Phan assigned a case to you 8 hours ago
  - img
  - text: Minh Phong shared some information about New Case 123 Letter of Protection. Find out what it says. 4 days ago
  - img
  - text: Tri01 Duc response to Test Request Letter of Protection is in! See the information now. 5 hours ago
  - img
  - text: Son HaiBon Phan assigned a request to you 6 hours ago
  - img
  - text: Son HaiBon Phan assigned a case to you 8 hours ago
  - img
  - img
  - textbox "Search..."
  - img
  - img
  - paragraph: No notifications yet
  - paragraph: When you get notifications, they'll show up here
  - button "Refresh"
  - list:
    - listitem:
      - img
      - paragraph: Pause notifications...
      - list:
        - listitem: For 30 minutes
        - listitem: For 1 hour
        - listitem: For 2 hours
        - listitem: Until tomorrow
    - listitem:
      - img
    - listitem:
      - img
    - listitem:
      - img
    - listitem:
      - img
    - listitem:
      - img
    - listitem:
      - img
  - img
  - button "0 Cart":
    - img
    - text: 0 Cart
  - text: Feedback
  - img
  - link "Open user menu":
    - /url: "#"
    - text: Minh
- img
- text: "#281983 Letter of Protection"
- img
- img
- img
- link "Test Request":
  - /url: /clients/801a8b15-a5c5-4282-aacd-6a9b2e6ae3b3
- text: "-"
- 'link "DOB: 03/01/1999"':
  - /url: /clients/801a8b15-a5c5-4282-aacd-6a9b2e6ae3b3
- 'link "Case: #538240"':
  - /url: /cases/538240
- text: "-"
- 'link "DOI: 01/05/2026"':
  - /url: /cases/538240
- 'link "Category: Unspecified Accident"':
  - /url: /cases/538240
- text: Tag
- img
- 'button "Status: Open"'
- button "Status Details:":
  - text: "Status Details:"
  - listbox:
    - listitem:
      - text: Awaiting
      - img
  - img
- 'button "Assignee: --"':
  - text: "Assignee: --"
  - img
- button:
  - img
- button:
  - img
- button "Activity":
  - img
  - text: Activity
- button "Share":
  - img
  - text: Share
- paragraph: Minh Phong
- text: Posted
- paragraph: 09/25/2025
- img
- list:
  - listitem
- textbox "Message"
- button [disabled]:
  - img
- heading "Snapshot" [level=2]
- list:
  - listitem: Minh Phong 09/25/2025 Submitted a request Respond
- heading "Discussion" [level=2]
- text: Start a discussion
- img
- heading "Minh Phong (You)" [level=4]
- img
- heading "Team Discussion" [level=4]
- img
- heading "Discussion" [level=2]
- text: Start a discussion
- img
- heading "Minh Phong (You)" [level=4]
- img
- heading "Team Discussion" [level=4]
- img
- img "image-share-this-request"
- paragraph: Share this request using the Share button.
- text: Share
- heading "Share with others" [level=3]
- button "Close"
- heading "Notes & Preferences" [level=4]
- heading "Case Contacts" [level=4]
- text: "To: Auto Test.Pharmacy portal_auto_pharmacy@testmail.loprx.com"
- img
- textbox "To Add People People" [disabled]
- text: Cc Bcc
- checkbox "Send email notification" [checked] [disabled]
- text: Send email notification Message
- textbox "Message" [disabled]
- paragraph: People with access
- link "Sent Summary":
  - /url: /requests/sent?request_id=281983
- paragraph: Auto Test.Pharmacy
- paragraph: portal_auto_pharmacy@testmail.loprx.com
- img
- paragraph: Minh Phong
- paragraph: minhphong.simple@gmail.com (You)
- paragraph: Creator
- button "Copy link":
  - img
  - text: Copy link
- button "Done"
```

# Test source

```ts
  1669 |             await textEditor.click();
  1670 |             await textEditor.press('ControlOrMeta+a');
  1671 |             await textEditor.press('Delete');
  1672 |             await textEditor.fill(conf.data.message_edit_text);
  1673 |             await requestPage.requestLoc.create.closeModalMessage.click();
  1674 |
  1675 |             await requestPage.submitAndVerifyRequest("post-details-create-template-editor-snapshot.png");
  1676 |         });
  1677 |
  1678 |         await test.step("Verify create request with Form text message", async () => {
  1679 |             await requestPage.initiateRequestCreation(conf.data.patient);
  1680 |
  1681 |             // Select and configure form template
  1682 |             await requestPage.requestLoc.create.arrowIcon.click();
  1683 |             await requestPage.dashboardLoc.common.spanText("Template-3 DME Rx Pad (Form)").click();
  1684 |
  1685 |             const textEditorForm = requestPage.page.locator('iframe[title="iframe-editor"]');
  1686 |             const formContent = textEditorForm.contentFrame();
  1687 |
  1688 |             // Clear existing content and set form options
  1689 |             await formContent.getByText('Dr. Jason Phan').dblclick();
  1690 |             await formContent.locator('body').press('ControlOrMeta+a');
  1691 |             await formContent.locator('body').press('Delete');
  1692 |
  1693 |             // Check all language options
  1694 |             const languageOptions = ['Vietnamese', 'Chinese', 'Spanish'];
  1695 |             for (const lang of languageOptions) {
  1696 |                 await formContent.getByRole('checkbox', { name: `Label in ${lang}` }).check();
  1697 |             }
  1698 |
  1699 |             await requestPage.requestLoc.create.closeModalMessage.click();
  1700 |             await requestPage.submitAndVerifyRequest("post-details-create-template-form-snapshot.png");
  1701 |         });
  1702 |     });
  1703 |
  1704 |     test.skip("REQ_051 - Add more than 20 requests to the cart and create multiple requests", {
  1705 |         tag: ["@REQ_051", "@request", "@function"]
  1706 |     }, async ({ conf, checkCart }) => {
  1707 |         test.setTimeout(300_000);
  1708 |         const businesses = ["(Dat Lawyers)", "The Vu Law Firm", "A Taylor Law Firm"];
  1709 |         await test.step("Add 24 requests by hovering in case id to cart", async () => {
  1710 |             await checkCart.search(conf.data.request);
  1711 |             await expect(checkCart.dashboardLoc.table.itemInRow(conf.data.case)).toBeVisible();
  1712 |             await checkCart.waitForSecond(1);
  1713 |             await checkCart.dashboardLoc.table.itemInRow(conf.data.case).hover();
  1714 |             for (let i = 0; i < businesses.length; i++) {
  1715 |                 await checkCart.requestLoc.detail.cartRequest.optionBusinessInCart(businesses[i]).click();
  1716 |                 for (let j = 0; j < 8; j++) {
  1717 |                     await checkCart.requestLoc.detail.cartRequest.listRequestTypeByHovering.first().click();
  1718 |                 }
  1719 |             }
  1720 |             await checkCart.page.mouse.move(30, 30);
  1721 |             await expect(checkCart.requestLoc.detail.cartRequest.quickSubmitButton("24")).toBeVisible();
  1722 |         })
  1723 |
  1724 |         await test.step("Submit 24 requests, and verify that only 20 are successfully added to the cart, with 4 remaining", async () => {
  1725 |             await requestPage.handleMissingInfoPopup();
  1726 |
  1727 |             await checkCart.requestLoc.detail.cartRequest.quickSubmitButton("24").click();
  1728 |             await requestPage.requestLoc.create.inputCheckAll("action").click();
  1729 |
  1730 |             //Add message
  1731 |             await requestPage.requestLoc.create.itemStep(4).first().click();
  1732 |             await requestPage.requestLoc.textEditorCreateCaseArea.first().waitFor({ state: 'visible' });
  1733 |             await requestPage.requestLoc.textEditorCreateCaseArea.fill("Message");
  1734 |
  1735 |             await requestPage.requestLoc.create.inputCheckAll("message").click();
  1736 |             await checkCart.dashboardLoc.buttonByText("Create").first().click();
  1737 |             await expect(checkCart.dashboardLoc.buttonByText("Create Another")).toBeVisible({ timeout: 250_000 }); // Create 20 request in once can take longer time
  1738 |
  1739 |             //Verify cart have 4 requests left
  1740 |             await checkCart.dashboardLoc.cart.buttonCart.hover({ force: true });
  1741 |             await expect(checkCart.dashboardLoc.cart.requestButtonCart).toBeVisible();
  1742 |             await checkCart.dashboardLoc.cart.requestButtonCart.click();
  1743 |             await expect(checkCart.requestLoc.detail.cartRequest.tdInTable("A Taylor Law Firm").first()).toBeVisible();
  1744 |             await verifyScreenshot('list-request-left-4-requests.png', checkCart.requestLoc.create.overviewCreateFast);
  1745 |         });
  1746 |     });
  1747 |
  1748 |     test("REQ_052 - Resend mail", {
  1749 |         tag: ["@REQ_052", "@request", "@function"]
  1750 |     }, async ({ conf, request, browser }) => {
  1751 |         await test.step("Click resend mail", async () => {
  1752 |             await requestPage.getDetailCase(conf.data.case);
  1753 |             await expect(requestPage.dashboardLoc.buttonByText("Share")).toBeVisible();
  1754 |
  1755 |             await requestPage.dashboardLoc.buttonByText("Share").click();
  1756 |             await expect(requestPage.dashboardLoc.modal.headerModal("Share with others")).toBeVisible();
  1757 |             await expect(requestPage.requestLoc.detail.rowMemberShare(conf.data.member_share)).toBeVisible();
  1758 |
  1759 |             await requestPage.requestLoc.detail.rowMemberShare(conf.data.member_share).hover();
  1760 |             await requestPage.requestLoc.detail.btnResend.first().click();
  1761 |             await expect(requestPage.requestLoc.detail.tagMemberShared(conf.data.member_share)).toBeVisible();
  1762 |
  1763 |             await requestPage.requestLoc.detail.rowMemberShare(conf.data.member_share).hover();
  1764 |             await expect(requestPage.requestLoc.detail.btnResend.first()).not.toBeVisible();
  1765 |         });
  1766 |
  1767 |         await test.step("Verify submit and email received", async () => {
  1768 |             await requestPage.dashboardLoc.buttonByText("Done").first().click();
> 1769 |             await expect(requestPage.dashboardLoc.msgSuccess).toBeVisible();
       |                                                               ^ Error: Timed out 10000ms waiting for expect(locator).toBeVisible()
  1770 |             await requestPage.page.close();
  1771 |
  1772 |             const newContext = await browser.newContext();
  1773 |             const newPage = await newContext.newPage();
  1774 |
  1775 |             const mail = new Mail(newPage, request);
  1776 |             await mail.open();
  1777 |             await mail.waitForSecond(conf.data.wait_for_email_second);
  1778 |
  1779 |             // Find and verify the share email
  1780 |             await mail.mailLoc.titleMail(`Letter of Protection #${conf.data.case}`).first().click();
  1781 |             const mailFrame = mail.mailLoc.mailFrame;
  1782 |             await mail.waitForSecond(2);
  1783 |
  1784 |             const buttonOpenRequest = mailFrame.locator('//a[contains(text(),"Open")]');
  1785 |             const newTabPage = await requestPage.openLinkAndCompletePasscode(requestPage, request, buttonOpenRequest);
  1786 |             await newTabPage.waitForSecond(3);
  1787 |             expect(newTabPage.page.url()).toContain(`requests/${conf.data.case}`);
  1788 |         });
  1789 |     });
  1790 |
  1791 |     test("REQ_053 - Verify when click in the Sent Summary", {
  1792 |         tag: ["@REQ_053", "@request", "@function"]
  1793 |     }, async ({ conf }) => {
  1794 |         await test.step("Open Sent Summary modal", async () => {
  1795 |             await requestPage.getDetailCase(conf.data.case);
  1796 |             await requestPage.requestLoc.detail.btnShare.click();
  1797 |             await expect(requestPage.dashboardLoc.buttonLinkByText("Sent Summary")).toBeVisible();
  1798 |         });
  1799 |
  1800 |         await test.step("Verify when click Sent Summary", async () => {
  1801 |             await requestPage.dashboardLoc.buttonLinkByText("Sent Summary").click();
  1802 |             await expect(requestPage.page.url()).toContain(`/requests/sent?request_id=${conf.data.case}`);
  1803 |             await expect(requestPage.dashboardLoc.table.boxSelectedFilter(conf.data.case)).toBeVisible();
  1804 |         });
  1805 |     });
  1806 | });
  1807 |
```