# Test info

- Name: Case Module - Advanced Features >> CASE_024 - Dive deeper: Verify when Start it in same type request
- Location: /root/code/portal-automation-test/tests/case/features/features.spec.ts:209:7

# Error details

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

Locator: locator('//a[@href="/requests/300687"]/*[name()=\'svg\']')
Expected: visible
Received: <element(s) not found>
Call log:
  - expect.toBeVisible with timeout 10000ms
  - waiting for locator('//a[@href="/requests/300687"]/*[name()=\'svg\']')

    at /root/code/portal-automation-test/tests/case/features/features.spec.ts:213:89
    at /root/code/portal-automation-test/tests/case/features/features.spec.ts:212:16
```

# 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. 3 days ago
  - img
  - text: "Get the details: Lawyer Phan's response to the Letter of Protection Test Request is now available. 3 days ago"
  - img
  - text: Son HaiBon Phan assigned a request to you 9 hours ago
  - img
  - text: Son HaiBon Phan assigned a case to you 1 minute ago
  - img
  - text: Tri01 Duc shared some information about New Guy 123 Letter of Protection. Find out what it says. 1 week ago
  - img
  - text: "Get the details: Lawyer Phan's response to the Letter of Protection Test Request is now available. 3 days ago"
  - img
  - text: Son HaiBon Phan assigned a request to you 9 hours ago
  - img
  - text: Son HaiBon Phan assigned a case to you 1 minute 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
- text: "#995146 John Doe 88045"
- img
- img
- text: "DOI: 01/01/2010 - Category: ATV Accidents"
- 'link "DOB: 01/01/2000"':
  - /url: /clients/fdb07151-f954-4562-8b34-853b958e5d55
- text: Tag
- img
- img
- 'button "Status: Open"'
- button:
  - listbox:
    - listitem:
      - text: "Status Details: Open"
      - img
- 'button "Service Date: --"'
- 'button "Assignee: --"':
  - text: "Assignee: --"
  - img
- button "New Request"
- button "Activity":
  - img
  - text: Activity
- button "Update Case"
- paragraph: Boost Your Case Organization!
- text: Add missing information to enhance the case's detail for easier navigation. Don't have it now? No worries—update it later! Who should be listed as the legal contacts?
- heading "Quick summary at your fingertips" [level=2]
- img
- img
- paragraph: Letter of Protection
- heading "Activity" [level=2]
- table:
  - rowgroup:
    - 'row "Starred # Status Details Latest Comment Creator Directed To"':
      - cell "Starred"
      - cell "#"
      - cell "Status Details"
      - cell "Latest Comment"
      - cell "Creator"
      - cell "Directed To"
  - rowgroup:
    - row "510578 Awaiting WellCare Pharmacy Business New 78255358":
      - cell:
        - img
      - cell "510578":
        - link "510578":
          - /url: /requests/510578
      - cell "Awaiting":
        - link "Awaiting":
          - /url: /requests/510578
      - cell:
        - link:
          - /url: /requests/510578
      - cell "WellCare Pharmacy":
        - link "WellCare Pharmacy":
          - /url: /requests/510578
      - cell "Business New 78255358":
        - link "Business New 78255358":
          - /url: /requests/510578
- heading "Dive deeper" [level=2]
- paragraph: beyond the summary
- img
- img
- paragraph: Business New 78255358
- img
- link "New Request":
  - /url: /requests/create?patient_id=fdb07151-f954-4562-8b34-853b958e5d55&doi=01/01/2010&business_id=8098463f-d9c6-418e-aec7-08a45a6daf8c
- heading "Key Focus" [level=2]
- link "Letter of Protection Status Open Status Details Awaiting":
  - /url: /requests/510578
  - paragraph: Letter of Protection
  - img
  - paragraph: Status
  - paragraph: Open
  - paragraph: Status Details
  - paragraph: Awaiting
- link "Medical Bill Balance $1,233,322.00 Status Open Status Details Awaiting":
  - /url: /requests/957757
  - paragraph: Medical Bill
  - paragraph: Balance
  - paragraph: $1,233,322.00
  - paragraph: Status
  - paragraph: Open
  - paragraph: Status Details
  - paragraph: Awaiting
- heading "Request Activity" [level=2]
- img
- text: Show
- textbox: "10"
- text: entries
- table:
  - rowgroup:
    - row "#  Request  Status  Status Details  Star It  Share From  Creator  Directed To  Actions":
      - cell "# "
      - cell "Request "
      - cell "Status "
      - cell "Status Details "
      - cell "Star It "
      - cell "Share From "
      - cell "Creator "
      - cell "Directed To "
      - cell "Actions"
  - rowgroup:
    - row "300687 Medical Bill Open Awaiting -- WellCare Pharmacy Business New 78255358":
      - cell "300687":
        - link "300687":
          - /url: /requests/300687
      - cell "Medical Bill":
        - link "Medical Bill":
          - /url: /requests/300687
          - img
          - text: Medical Bill
      - cell "Open":
        - link "Open":
          - /url: /requests/300687
      - cell "Awaiting":
        - link "Awaiting":
          - /url: /requests/300687
      - cell:
        - link:
          - /url: /requests/300687
      - cell "--":
        - link "--":
          - /url: /requests/300687
      - cell "WellCare Pharmacy":
        - link "WellCare Pharmacy":
          - /url: /requests/300687
      - cell "Business New 78255358":
        - link "Business New 78255358":
          - /url: /requests/300687
      - cell:
        - img
        - img
    - row "957757 Medical Bill Open Awaiting -- WellCare Pharmacy Business New 78255358":
      - cell "957757":
        - link "957757":
          - /url: /requests/957757
      - cell "Medical Bill":
        - link "Medical Bill":
          - /url: /requests/957757
          - img
          - text: Medical Bill
      - cell "Open":
        - link "Open":
          - /url: /requests/957757
      - cell "Awaiting":
        - link "Awaiting":
          - /url: /requests/957757
      - cell:
        - link:
          - /url: /requests/957757
          - img
      - cell "--":
        - link "--":
          - /url: /requests/957757
      - cell "WellCare Pharmacy":
        - link "WellCare Pharmacy":
          - /url: /requests/957757
      - cell "Business New 78255358":
        - link "Business New 78255358":
          - /url: /requests/957757
      - cell:
        - img
        - img
    - row "510578 Letter of Protection Open Awaiting -- WellCare Pharmacy Business New 78255358":
      - cell "510578":
        - link "510578":
          - /url: /requests/510578
      - cell "Letter of Protection":
        - link "Letter of Protection":
          - /url: /requests/510578
          - img
          - text: Letter of Protection
      - cell "Open":
        - link "Open":
          - /url: /requests/510578
      - cell "Awaiting":
        - link "Awaiting":
          - /url: /requests/510578
      - cell:
        - link:
          - /url: /requests/510578
          - img
      - cell "--":
        - link "--":
          - /url: /requests/510578
      - cell "WellCare Pharmacy":
        - link "WellCare Pharmacy":
          - /url: /requests/510578
      - cell "Business New 78255358":
        - link "Business New 78255358":
          - /url: /requests/510578
      - cell:
        - img
        - img
    - row "851412 Letter of Protection Open Awaiting -- WellCare Pharmacy Business New 78255358":
      - cell "851412":
        - link "851412":
          - /url: /requests/851412
      - cell "Letter of Protection":
        - link "Letter of Protection":
          - /url: /requests/851412
          - img
          - text: Letter of Protection
      - cell "Open":
        - link "Open":
          - /url: /requests/851412
      - cell "Awaiting":
        - link "Awaiting":
          - /url: /requests/851412
      - cell:
        - link:
          - /url: /requests/851412
      - cell "--":
        - link "--":
          - /url: /requests/851412
      - cell "WellCare Pharmacy":
        - link "WellCare Pharmacy":
          - /url: /requests/851412
      - cell "Business New 78255358":
        - link "Business New 78255358":
          - /url: /requests/851412
      - cell:
        - img
        - img
- paragraph: Showing 1 to 4 of 4 entries
- img
- img "Minh Phong (You)"
- img "Team Discussion"
- heading "Discussion" [level=2]
- heading "Minh Phong (You)" [level=4]
- img
- heading "Team Discussion" [level=4]
- img
```

# Test source

```ts
  113 |       await casePage.caseLoc.detail.inputSearchMember.clear();
  114 |     });
  115 |
  116 |     await test.step("Verify when assignee to member in business", async () => {
  117 |       await casePage.caseLoc.detail.inputSearchMember.type(conf.data.member_in_business, { delay: 100 });
  118 |       await expect(casePage.caseLoc.detail.optionSearchExist(conf.data.member_in_business)).toBeVisible({ timeout: 15_000 });
  119 |       await casePage.caseLoc.detail.optionSearchExist(conf.data.member_in_business).click();
  120 |       await casePage.caseLoc.detail.btnSubmitAssignee.click();
  121 |
  122 |       await expect(casePage.caseLoc.detail.fullnameAssignee).toContainText(conf.data.member_assignee);
  123 |
  124 |       // Verify activity change
  125 |       const newestActivity = await casePage.getNewestActivity();
  126 |       expect(newestActivity).toContain(`changed the Assignee ${currentAssignee} ${conf.data.member_assignee} ${await getTodayInTimeZone()}`);
  127 |     });
  128 |
  129 |     await test.step("Verify that the member who received the assignee gets a notification", async () => {
  130 |       await casePage.changeUser(conf.data.username_get_noti, conf.data.password_get_noti, casePage.page);
  131 |       await expect(loginPage.baseLoc.dashboardContainer).toBeVisible();
  132 |       await casePage.checkNotification("Assignee", true);
  133 |       await expect(casePage.caseLoc.detail.fullnameAssignee).toContainText(conf.data.member_assignee, { timeout: 15_000 });
  134 |     });
  135 |
  136 |     await test.step("Teardown: Assignee to old member", async () => {
  137 |       await casePage.caseLoc.detail.btnAssignee.click();
  138 |       await casePage.caseLoc.detail.inputSearchMember.fill(conf.data.member_first_assignee);
  139 |       await expect(casePage.caseLoc.detail.optionSearchExist(conf.data.member_first_assignee)).toBeVisible({ timeout: 15_000 });
  140 |       await casePage.caseLoc.detail.optionSearchExist(conf.data.member_first_assignee).click();
  141 |       await casePage.caseLoc.detail.btnSubmitAssignee.click();
  142 |     });
  143 |   });
  144 |
  145 |   test("CASE_022 - Dive deeper: Verify archive/unarchive a Business in case", {
  146 |     tag: ['@CASE_022', '@case', '@function']
  147 |   }, async ({ conf, casePage22 }) => {
  148 |     test.setTimeout(190_000);
  149 |     await test.step("Verify when archive business", async () => {
  150 |       await casePage22.clickButtonDropdownSelect("BTN_ARCHIVE_UNARCHIVE_BUSINESS_IN_CASE_DETAIL");
  151 |
  152 |       await expect(casePage22.caseLoc.detail.popupSwal).toBeVisible();
  153 |       await casePage22.caseLoc.detail.btnCofirmArchive.click();
  154 |
  155 |       await expect(casePage22.caseLoc.detail.addLegalModal.msgSuccess.first()).toBeVisible();
  156 |       await expect(casePage22.caseLoc.detail.btnViewArchivedBusiness).toBeVisible();
  157 |       await expect(casePage22.caseLoc.detail.singleBusinesses(conf.data.business_archive)).not.toBeVisible();
  158 |
  159 |       // Verify activity
  160 |       const newestActivity = await casePage22.getNewestActivity();
  161 |       expect(newestActivity).toContain(`archive the business ${conf.data.business_archive} ${await getTodayInTimeZone()}`);
  162 |     });
  163 |
  164 |     await test.step("Verify when unArchive business", async () => {
  165 |       await expect(casePage22.caseLoc.detail.btnViewArchivedBusiness).toBeVisible();
  166 |       await casePage22.gotoArchive(conf.data.case)
  167 |       await expect(casePage22.caseLoc.detail.singleBusinesses(conf.data.business_archive)).toBeVisible();
  168 |
  169 |       await casePage22.clickButtonDropdownSelect("BTN_ARCHIVE_UNARCHIVE_BUSINESS_IN_CASE_DETAIL");
  170 |       await expect(casePage22.caseLoc.detail.addLegalModal.msgSuccess.first()).toBeVisible();
  171 |       await casePage22.waitForSecond(3);
  172 |
  173 |       const listBusinesses = (await casePage22.caseLoc.detail.listBusinesses.all()).length;
  174 |       expect(listBusinesses).toBe(3);
  175 |       await expect(casePage22.caseLoc.detail.singleBusinesses(conf.data.business_archive)).toBeVisible();
  176 |       await expect(casePage22.caseLoc.detail.noDataRequest).toBeVisible();
  177 |
  178 |       // Verify activity
  179 |       const newestActivity = await casePage22.getNewestActivity();
  180 |       expect(newestActivity).toContain(`unarchive the business ${conf.data.business_archive} ${await getTodayInTimeZone()}`);
  181 |     });
  182 |
  183 |     await test.step("Unarchive all requests", async () => {
  184 |       let attempts = 0;
  185 |
  186 |       while (attempts < 20) {
  187 |         const archiveLinks = casePage22.caseLoc.detail.listLinkArchiveRequests;
  188 |         const count = await archiveLinks.count();
  189 |         if (count === 0) {
  190 |           break;
  191 |         }
  192 |         try {
  193 |           await expect(archiveLinks.first()).toBeVisible({ timeout: 10_000 });
  194 |           await archiveLinks.first().click();
  195 |           await casePage22.caseLoc.detail.update.btnUnArchive.click();
  196 |           await casePage.dashboardLoc.buttonByText("Unarchive").click();
  197 |           await casePage.caseLoc.detail.btnClosePopup.click();
  198 |           await casePage22.caseLoc.btnCloseModal.click();
  199 |           await casePage22.caseLoc.linkToCase(conf.data.case).click();
  200 |           attempts++;
  201 |         } catch (error) {
  202 |           break;
  203 |         }
  204 |       }
  205 |       await expect(casePage22.caseLoc.detail.noDataRequest).not.toBeVisible({ timeout: 5000 });
  206 |     });
  207 |   });
  208 |
  209 |   test("CASE_024 - Dive deeper: Verify when Start it in same type request", {
  210 |     tag: ['@CASE_024', '@case', '@function']
  211 |   }, async ({ conf, casePage24 }) => {
  212 |     await test.step("Verify request medical bill had star in table", async () => {
> 213 |       await expect(casePage24.caseLoc.detail.requestHadStarIt(conf.data.case_had_star)).toBeVisible();
      |                                                                                         ^ Error: Timed out 10000ms waiting for expect(locator).toBeVisible()
  214 |     });
  215 |
  216 |     await test.step("Verify when change star it", async () => {
  217 |       await casePage24.changeStarFocus(conf.data.case_star_to);
  218 |       await expect(casePage24.caseLoc.detail.addLegalModal.msgSuccess.first()).toBeVisible();
  219 |       await expect(casePage24.caseLoc.detail.requestHadStarIt(conf.data.case_had_star)).not.toBeVisible();
  220 |       await expect(casePage24.caseLoc.detail.requestHadStarIt(conf.data.case_star_to)).toBeVisible();
  221 |     });
  222 |   });
  223 |
  224 |   test("CASE_025 - Dive deeper: Customize column in request table", {
  225 |     tag: ['@CASE_025', '@case', '@function']
  226 |   }, async ({ conf }) => {
  227 |     // Verify default columns displayed
  228 |     await test.step("Verify default columns displayed", async () => {
  229 |       const customizedColumns = casePage.caseProps.requestsColumns;
  230 |       for (let i = 0; i < customizedColumns.length; i++) {
  231 |         if (customizedColumns[i].default) {
  232 |           await expect(casePage.caseLoc.detail.headingTableRequest(customizedColumns[i].tableDisplayName).first()).toBeVisible();
  233 |         }
  234 |       }
  235 |     });
  236 |
  237 |     // Verify customized column show disable items and active items
  238 |     await test.step("Verify customized columns popup state", async () => {
  239 |       await casePage.openThreedotMenu(casePage.caseProps.threeDotDropdownMenus.customizedColumn, casePage.caseLoc.detail.threeDotCustomizeColumnRequest.first(), false);
  240 |
  241 |       // Verify enabled column and disabled column
  242 |       const customizedColumns = casePage.caseProps.requestsColumns;
  243 |       for (let i = 0; i < customizedColumns.length; i++) {
  244 |         if (customizedColumns[i].default) {
  245 |           await expect(casePage.dashboardLoc.listing.popup.customizedColumn.columnCheckboxRequestCase(customizedColumns[i].tableDisplayName).first()).toBeDisabled();
  246 |         } else {
  247 |           await expect(casePage.dashboardLoc.listing.popup.customizedColumn.columnCheckboxRequestCase(customizedColumns[i].tableDisplayName).first()).toBeEnabled();
  248 |         }
  249 |       }
  250 |       await casePage.caseLoc.buttonByText("Apply").first().click();
  251 |     });
  252 |
  253 |     // Check each columns and verify it shown
  254 |     await test.step("Check each columns and verify it shown", async () => {
  255 |       const customizedColumns = casePage.caseProps.requestsColumns.filter(column => !column.default);
  256 |       for (const column of customizedColumns) {
  257 |         await casePage.openThreedotMenu(casePage.caseProps.threeDotDropdownMenus.customizedColumn, casePage.caseLoc.detail.threeDotCustomizeColumnRequest.first(), false);
  258 |         await casePage.dashboardLoc.listing.popup.customizedColumn.columnCheckboxRequestCase(column.tableDisplayName).first().setChecked(true);
  259 |         await casePage.caseLoc.buttonByText("Apply").first().click();
  260 |         await expect(casePage.caseLoc.detail.headingTableRequest(column.tableDisplayName).first()).toBeVisible();
  261 |       }
  262 |     });
  263 |
  264 |     // Uncheck each columns and verify it hidden
  265 |     await test.step("Uncheck each columns and verify it hidden", async () => {
  266 |       const customizedColumns = casePage.caseProps.requestsColumns.filter(column => !column.default);
  267 |       // TODO: change to all columns. We're facing with some issues with the last column
  268 |       for (const column of customizedColumns) {
  269 |         await casePage.openThreedotMenu(casePage.caseProps.threeDotDropdownMenus.customizedColumn, casePage.caseLoc.detail.threeDotCustomizeColumnRequest.first(), false);
  270 |         await casePage.dashboardLoc.listing.popup.customizedColumn.columnCheckboxRequestCase(column.tableDisplayName).first().setChecked(false);
  271 |         await casePage.caseLoc.buttonByText("Apply").first().click();
  272 |         await expect(casePage.caseLoc.detail.headingTableRequest(column.tableDisplayName).first()).not.toBeVisible();
  273 |       }
  274 |     });
  275 |   });
  276 |
  277 |   test("CASE_026 - Quick summary: Verify filter activity by action type", {
  278 |     tag: ['@CASE_026', '@case', '@function']
  279 |   }, async () => {
  280 |     for (const { name, expectedRequests } of casePage.actionType) {
  281 |       await casePage.caseLoc.detail.dataRequestType(name).click();
  282 |       await expect(casePage.caseLoc.detail.textSummaryDisplay).toContainText(name);
  283 |       await casePage.waitForSecond(1);
  284 |       // Sau khi có api cần bổ sung thêm check request dựa và action type
  285 |     }
  286 |   });
  287 |
  288 |   test("CASE_027 - Verify move request to another exist case", {
  289 |     tag: ['@CASE_027', '@case', '@function']
  290 |   }, async ({ conf, casePage27 }) => {
  291 |     test.setTimeout(100_000);
  292 |     await test.step("Verify business and request exist and open modal move request", async () => {
  293 |       await expect(casePage27.caseLoc.detail.singleBusinesses(conf.data.business)).toBeVisible();
  294 |       await casePage27.waitForSecond(1);
  295 |       expect((await casePage27.caseLoc.detail.listRequestOfBusiness.all()).length).toBeGreaterThan(0);
  296 |
  297 |       await casePage27.clickButtonDropdownSelect("BTN_SHOW_MOVE_REQUEST_OF_BUSINESS_MODAL");
  298 |       await expect(casePage27.dashboardLoc.modal.headerModal("Move Requests")).toBeVisible();
  299 |     });
  300 |
  301 |     await test.step("Verify when fill case and move request", async () => {
  302 |       await casePage27.caseLoc.detail.inputMoveRequest.click();
  303 |       await casePage27.caseLoc.detail.inputMoveRequest.type(conf.data.case_to_move, { delay: 100 });
  304 |       await casePage27.caseLoc.detail.transfer.boxOption(conf.data.case_to_move).click();
  305 |       await casePage27.caseLoc.buttonByText("Move").click();
  306 |
  307 |       await expect(casePage27.caseLoc.detail.addLegalModal.msgSuccess.first()).toBeVisible();
  308 |       await casePage27.caseLoc.detail.btnClosePopup.click();
  309 |       await expect(casePage27.caseLoc.detail.textNoRequest).toBeVisible();
  310 |
  311 |       // Verify activity
  312 |       const newestActivity = await casePage27.getNewestActivity();
  313 |       expect(newestActivity).toContain(`moved request from ${conf.data.business} Case: #${conf.data.case} #${conf.data.case_to_move} ${await getTodayInTimeZone()}`);
```