# Test info

- Name: Case Module - Advanced Features >> CASE_021 - Verify when Assignee case
- Location: /root/code/portal-automation-test/tests/case/features/features.spec.ts:91:7

# Error details

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

Locator: locator('//span[contains(@class,\'assignee-full-name\')]')
Expected string: "Son HaiBon Phan"
Received: <element(s) not found>
Call log:
  - expect.toContainText with timeout 10000ms
  - waiting for locator('//span[contains(@class,\'assignee-full-name\')]')
    - waiting for" https://qa.loprx.com/cases/718596" navigation to finish...
    - navigated to "https://qa.loprx.com/cases/718596"

    at /root/code/portal-automation-test/tests/case/features/features.spec.ts:131:62
    at /root/code/portal-automation-test/tests/case/features/features.spec.ts:127:5
```

# 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:
      - button "Shared with me":
        - img
        - text: Shared with me
- banner:
  - img
  - text: Tri01 Duc response to Auto_YXQ Test Letter of Protection is in! See the information now. 10 hours ago
  - img
  - 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: Son HaiBon
- text: "#718596 Auto_E53 Test"
- img
- img
- text: "DOI: 01/01/2004 - Category: Auto Accidents"
- 'link "DOB: 10/14/2001"':
  - /url: /clients/02a95b07-d0e8-49b0-a7ac-d4064171e484
- text: Tag
- img
- img
- 'button "Status: Unknown"'
- button:
  - listbox:
    - listitem:
      - text: "Status Details: Unknown"
      - img
- 'button "Service Date: --"'
- 'button "Assignee: Son HaiBon Phan"':
  - text: "Assignee: Son HaiBon Phan"
  - img
- button "New Request"
- button "Activity":
  - img
  - text: Activity
- button "Update Case"
- heading "Quick summary at your fingertips" [level=2]
- img
- paragraph: Letter of Protection
- heading "Activity" [level=2]
- table:
  - rowgroup:
    - 'row "Starred # Status Details Latest Comment From To"':
      - cell "Starred"
      - cell "#"
      - cell "Status Details"
      - cell "Latest Comment"
      - cell "From"
      - cell "To"
  - rowgroup:
    - row "726862 Awaiting WellCare Pharmacy12321@@@@ Son35 Pharmacy":
      - cell:
        - img
      - cell "726862":
        - link "726862":
          - /url: /requests/726862
      - cell "Awaiting":
        - link "Awaiting":
          - /url: /requests/726862
      - cell:
        - link:
          - /url: /requests/726862
      - cell "WellCare Pharmacy12321@@@@":
        - link "WellCare Pharmacy12321@@@@":
          - /url: /requests/726862
      - cell "Son35 Pharmacy":
        - link "Son35 Pharmacy":
          - /url: /requests/726862
    - row "126846 + 3 LoP Attempts read this pleas WellCare Pharmacy12321@@@@ The Vu Law Firm":
      - cell:
        - img
      - cell "126846":
        - link "126846":
          - /url: /requests/126846
      - cell "+ 3 LoP Attempts":
        - link "+ 3 LoP Attempts":
          - /url: /requests/126846
      - cell "read this pleas":
        - link "read this pleas":
          - /url: /requests/126846
      - cell "WellCare Pharmacy12321@@@@":
        - link "WellCare Pharmacy12321@@@@":
          - /url: /requests/126846
      - cell "The Vu Law Firm":
        - link "The Vu Law Firm":
          - /url: /requests/126846
- heading "Dive deeper" [level=2]
- paragraph: beyond the summary
- text: Meet the Case Crew! The businesses listed here all played a part in this case. Maybe they shared some info, received some info, or even helped out in some way. More... The Magic Red Dot! If a red dot (
- img
- text: ) appears next to a business. This is just a friendly reminder that something new has arrived here! More... The Missing
- img
- text: "icon. Let's Fix It. You might encounter this icon when a request is missing a crucial detail: the intended business. It happens so we grouped requests with the missing business for you to easily identify. It's an easy fix. Just update the request with the correct business. More..."
- img
- img
- paragraph: Son35 Pharmacy
- img
- link "New Request":
  - /url: /requests/create?patient_id=02a95b07-d0e8-49b0-a7ac-d4064171e484&doi=01/01/2004&business_id=a848025b-74c1-4646-98ca-f4bbeb02b86a
- heading "Key Focus" [level=2]
- link "Letter of Protection Status Open Status Details Awaiting":
  - /url: /requests/726862
  - paragraph: Letter of Protection
  - img
  - paragraph: Status
  - paragraph: Open
  - paragraph: Status Details
  - paragraph: Awaiting
- heading "Request" [level=2]
- img
- text: Show
- textbox: "10"
- text: entries
- table:
  - rowgroup:
    - row "#  Request  Status  Status Details  Star It  From  Directed To  Actions":
      - cell "# "
      - cell "Request "
      - cell "Status "
      - cell "Status Details "
      - cell "Star It "
      - cell "From "
      - cell "Directed To "
      - cell "Actions"
  - rowgroup:
    - row "451940 Letter of Protection Open Awaiting WellCare Pharmacy12321@@@@ Son35 Pharmacy":
      - cell "451940":
        - link "451940":
          - /url: /requests/451940
      - cell "Letter of Protection":
        - link "Letter of Protection":
          - /url: /requests/451940
          - img
          - text: Letter of Protection
      - cell "Open":
        - link "Open":
          - /url: /requests/451940
      - cell "Awaiting":
        - link "Awaiting":
          - /url: /requests/451940
      - cell:
        - link:
          - /url: /requests/451940
      - cell "WellCare Pharmacy12321@@@@":
        - link "WellCare Pharmacy12321@@@@":
          - /url: /requests/451940
      - cell "Son35 Pharmacy":
        - link "Son35 Pharmacy":
          - /url: /requests/451940
      - cell:
        - img
        - img
    - row "726862 Letter of Protection Open Awaiting WellCare Pharmacy12321@@@@ Son35 Pharmacy":
      - cell "726862":
        - link "726862":
          - /url: /requests/726862
      - cell "Letter of Protection":
        - link "Letter of Protection":
          - /url: /requests/726862
          - img
          - text: Letter of Protection
      - cell "Open":
        - link "Open":
          - /url: /requests/726862
      - cell "Awaiting":
        - link "Awaiting":
          - /url: /requests/726862
      - cell:
        - link:
          - /url: /requests/726862
          - img
      - cell "WellCare Pharmacy12321@@@@":
        - link "WellCare Pharmacy12321@@@@":
          - /url: /requests/726862
      - cell "Son35 Pharmacy":
        - link "Son35 Pharmacy":
          - /url: /requests/726862
      - cell:
        - img
        - img
- paragraph: Showing 1 to 2 of 2 entries
- img
- img "Team Discussion"
- img "Son HaiBon Phan (You)"
- heading "Discussion" [level=2]
- heading "Team Discussion" [level=4]
- text: 123 07/28/2025
- img
- heading "Son HaiBon Phan (You)" [level=4]
- img
```

# Test source

```ts
   31 |       await casePage.waitForSecond(2);
   32 |       if (conf.data.not_update) {
   33 |         return;
   34 |       }
   35 |       await expect(casePage.caseLoc.detail.buttonUpdateCase).toBeVisible();
   36 |       await casePage.caseLoc.detail.buttonUpdateCase.click({ force: true });
   37 |       await expect(casePage.dashboardLoc.modal.headerModal("Case Detail")).toBeVisible();
   38 |     });
   39 |
   40 |     // Bổ sung thêm check info detail và info modal update (sau sẽ có thêm api -> bổ sung sau)
   41 |   });
   42 |
   43 |   test("CASE_019 - Verify when add tag to case", {
   44 |     tag: ['@CASE_019', '@case', '@function']
   45 |   }, async () => {
   46 |     test.setTimeout(100_000);
   47 |
   48 |     await test.step("Verify add tags with tag count greater than 9 (invalid)", async () => {
   49 |       await casePage.addMultipleTags(10);
   50 |       await casePage.saveTags();
   51 |       await expect(casePage.dashboardLoc.tag.errorMaxTag).toBeVisible();
   52 |     });
   53 |
   54 |     await test.step("Verify when add < 9 tag (valid)", async () => {
   55 |       await casePage.removeOneTag();
   56 |       await casePage.saveTags();
   57 |       await expect(casePage.dashboardLoc.msgSuccess.first()).toBeVisible();
   58 |       await casePage.dashboardLoc.btnClosePopupNotification.click();
   59 |       await expect(casePage.dashboardLoc.tag.btnSaveTag).not.toBeVisible();
   60 |
   61 |       const tagCount = await casePage.getTagCount();
   62 |       expect(tagCount).toBe(9);
   63 |     });
   64 |
   65 |     await test.step("Clear all tag", async () => {
   66 |       await casePage.clearAllTags();
   67 |       await casePage.saveTags();
   68 |       await expect(casePage.dashboardLoc.msgSuccess.first()).toBeVisible();
   69 |       await casePage.dashboardLoc.btnClosePopupNotification.click();
   70 |       await expect(casePage.dashboardLoc.tag.btnSaveTag).not.toBeVisible();
   71 |
   72 |       const tagCount = await casePage.getTagCount();
   73 |       expect(tagCount).toBe(0);
   74 |     });
   75 |   });
   76 |
   77 |   test("CASE_020 - Verify status when change status detail case", {
   78 |     tag: ['@CASE_020', '@case', '@function']
   79 |   }, async () => {
   80 |     test.setTimeout(180_000);
   81 |     for (const { detail, expectedStatus } of casePage.statusTests) {
   82 |       await test.step(`Change Status Details to ${detail} and verify Status is ${expectedStatus}`, async () => {
   83 |         await casePage.caseLoc.detail.statusDetailsInput.click();
   84 |         await casePage.waitForSecond(1);
   85 |         await casePage.caseLoc.detail.statusDetailsOption(detail).click();
   86 |         await expect(casePage.caseLoc.detail.statusDisplay).toContainText(expectedStatus);
   87 |       });
   88 |     }
   89 |   })
   90 |
   91 |   test("CASE_021 - Verify when Assignee case", {
   92 |     tag: ['@CASE_021', '@case', '@function']
   93 |   }, async ({ conf }) => {
   94 |     test.setTimeout(150_000)
   95 |     let currentAssignee: string = "";
   96 |
   97 |     await test.step("Verify list option assignee member", async () => {
   98 |       currentAssignee = await casePage.caseLoc.detail.fullnameAssignee.innerText();
   99 |       const totalMembers = await casePage.getTotalMemberInBusiness();
  100 |       await casePage.caseLoc.detail.btnAssignee.click();
  101 |       await casePage.caseLoc.detail.inputSearchMember.click();
  102 |       await casePage.waitForSecond(2);
  103 |       const totalMembersUI = (await casePage.caseLoc.detail.optionMember.all()).length;
  104 |       expect(totalMembers).toBe(totalMembersUI - 1);
  105 |     });
  106 |
  107 |     await test.step("Verify when add member not in Business", async () => {
  108 |       await casePage.caseLoc.detail.inputSearchMember.clear();
  109 |       await casePage.caseLoc.detail.inputSearchMember.fill(conf.data.member_not_in_business);
  110 |       await expect(casePage.caseLoc.detail.noOptionFound).toBeVisible();
  111 |       await casePage.caseLoc.detail.inputSearchMember.clear();
  112 |     });
  113 |
  114 |     await test.step("Verify when assignee to member in business", async () => {
  115 |       await casePage.caseLoc.detail.inputSearchMember.type(conf.data.member_in_business, { delay: 100 });
  116 |       await expect(casePage.caseLoc.detail.optionSearchExist(conf.data.member_in_business)).toBeVisible({ timeout: 15_000 });
  117 |       await casePage.caseLoc.detail.optionSearchExist(conf.data.member_in_business).click();
  118 |       await casePage.dashboardLoc.buttonByText("Submit").nth(3).click();
  119 |
  120 |       await expect(casePage.caseLoc.detail.fullnameAssignee).toContainText(conf.data.member_assignee);
  121 |
  122 |       // Verify activity change
  123 |       const newestActivity = await casePage.getNewestActivity();
  124 |       expect(newestActivity).toContain(`changed the Assignee ${currentAssignee} ${conf.data.member_assignee} ${await getTodayInTimeZone()}`);
  125 |     });
  126 |
  127 |     await test.step("Verify that the member who received the assignee gets a notification", async () => {
  128 |       await casePage.changeUser(conf.data.username_get_noti, conf.data.password_get_noti, casePage.page);
  129 |       await expect(loginPage.baseLoc.dashboardContainer).toBeVisible();
  130 |       await casePage.checkNotification("Assignee", true);
> 131 |       await expect(casePage.caseLoc.detail.fullnameAssignee).toContainText(conf.data.member_assignee);
      |                                                              ^ Error: Timed out 10000ms waiting for expect(locator).toContainText(expected)
  132 |     });
  133 |
  134 |     await test.step("Teardown: Assignee to old member", async () => {
  135 |       await casePage.caseLoc.detail.btnAssignee.click();
  136 |       await casePage.caseLoc.detail.inputSearchMember.fill(conf.data.member_first_assignee);
  137 |       await expect(casePage.caseLoc.detail.optionSearchExist(conf.data.member_first_assignee)).toBeVisible({ timeout: 15_000 });
  138 |       await casePage.caseLoc.detail.optionSearchExist(conf.data.member_first_assignee).click();
  139 |       await casePage.dashboardLoc.buttonByText("Submit").nth(3).click();
  140 |     });
  141 |   });
  142 |
  143 |   test("CASE_022 - Dive deeper: Verify archive/unarchive a Business in case", {
  144 |     tag: ['@CASE_022', '@case', '@function']
  145 |   }, async ({ conf, casePage22 }) => {
  146 |     test.setTimeout(190_000);
  147 |     await test.step("Verify when archive business", async () => {
  148 |       await casePage22.clickButtonDropdownSelect("BTN_ARCHIVE_UNARCHIVE_BUSINESS_IN_CASE_DETAIL");
  149 |
  150 |       await expect(casePage22.caseLoc.detail.popupSwal).toBeVisible();
  151 |       await casePage22.caseLoc.detail.btnCofirmArchive.click();
  152 |
  153 |       await expect(casePage22.caseLoc.detail.addLegalModal.msgSuccess.first()).toBeVisible();
  154 |       await expect(casePage22.caseLoc.detail.btnViewArchivedBusiness).toBeVisible();
  155 |       await expect(casePage22.caseLoc.detail.singleBusinesses(conf.data.business_archive)).not.toBeVisible();
  156 |
  157 |       // Verify activity
  158 |       const newestActivity = await casePage22.getNewestActivity();
  159 |       expect(newestActivity).toContain(`archive the business ${conf.data.business_archive} ${await getTodayInTimeZone()}`);
  160 |     });
  161 |
  162 |     await test.step("Verify when unArchive business", async () => {
  163 |       await expect(casePage22.caseLoc.detail.btnViewArchivedBusiness).toBeVisible();
  164 |       await casePage22.gotoArchive(conf.data.case)
  165 |       await expect(casePage22.caseLoc.detail.singleBusinesses(conf.data.business_archive)).toBeVisible();
  166 |
  167 |       await casePage22.clickButtonDropdownSelect("BTN_ARCHIVE_UNARCHIVE_BUSINESS_IN_CASE_DETAIL");
  168 |       await expect(casePage22.caseLoc.detail.addLegalModal.msgSuccess.first()).toBeVisible();
  169 |       await casePage22.waitForSecond(3);
  170 |
  171 |       const listBusinesses = (await casePage22.caseLoc.detail.listBusinesses.all()).length;
  172 |       expect(listBusinesses).toBe(3);
  173 |       await expect(casePage22.caseLoc.detail.singleBusinesses(conf.data.business_archive)).toBeVisible();
  174 |       await expect(casePage22.caseLoc.detail.noDataRequest).toBeVisible();
  175 |
  176 |       // Verify activity
  177 |       const newestActivity = await casePage22.getNewestActivity();
  178 |       expect(newestActivity).toContain(`unarchive the business ${conf.data.business_archive} ${await getTodayInTimeZone()}`);
  179 |     });
  180 |
  181 |     await test.step("Unarchive all requests", async () => {
  182 |       let attempts = 0;
  183 |
  184 |       while (attempts < 20) {
  185 |         const archiveLinks = casePage22.caseLoc.detail.listLinkArchiveRequests;
  186 |         const count = await archiveLinks.count();
  187 |         if (count === 0) {
  188 |           break;
  189 |         }
  190 |         try {
  191 |           await expect(archiveLinks.first()).toBeVisible({ timeout: 10_000 });
  192 |           await archiveLinks.first().click();
  193 |           await casePage22.caseLoc.detail.update.btnUnArchive.click();
  194 |           await casePage.dashboardLoc.buttonByText("Unarchive").click();
  195 |           await casePage.caseLoc.detail.btnClosePopup.click();
  196 |           await casePage22.caseLoc.btnCloseModal.click();
  197 |           await casePage22.caseLoc.linkToCase(conf.data.case).click();
  198 |           attempts++;
  199 |         } catch (error) {
  200 |           break;
  201 |         }
  202 |       }
  203 |       await expect(casePage22.caseLoc.detail.noDataRequest).not.toBeVisible({ timeout: 5000 });
  204 |     });
  205 |   });
  206 |
  207 |   test("CASE_024 - Dive deeper: Verify when Start it in same type request", {
  208 |     tag: ['@CASE_024', '@case', '@function']
  209 |   }, async ({ conf, casePage24 }) => {
  210 |     await test.step("Verify request medical bill had star in table", async () => {
  211 |       await expect(casePage24.caseLoc.detail.requestHadStarIt(conf.data.case_had_star)).toBeVisible();
  212 |     });
  213 |
  214 |     await test.step("Verify when change star it", async () => {
  215 |       await casePage24.changeStarFocus(conf.data.case_star_to);
  216 |       await expect(casePage24.caseLoc.detail.addLegalModal.msgSuccess.first()).toBeVisible();
  217 |       await expect(casePage24.caseLoc.detail.requestHadStarIt(conf.data.case_had_star)).not.toBeVisible();
  218 |       await expect(casePage24.caseLoc.detail.requestHadStarIt(conf.data.case_star_to)).toBeVisible();
  219 |     });
  220 |   });
  221 |
  222 |   test("CASE_025 - Dive deeper: Customize column in request table", {
  223 |     tag: ['@CASE_025', '@case', '@function']
  224 |   }, async ({ conf }) => {
  225 |     // Verify default columns displayed
  226 |     await test.step("Verify default columns displayed", async () => {
  227 |       const customizedColumns = casePage.caseProps.requestsColumns;
  228 |       for (let i = 0; i < customizedColumns.length; i++) {
  229 |         if (customizedColumns[i].default) {
  230 |           await expect(casePage.caseLoc.detail.headingTableRequest(customizedColumns[i].tableDisplayName).first()).toBeVisible();
  231 |         }
```