# Test info

- Name: Feature case for request-listing >> REQ_014 - Verify when create with Fast Submission with multiple request
- Location: /root/code/portal-automation-test/tests/request/function.spec.ts:436:9

# Error details

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

Locator: locator('//a[@class=\'view-request-success\']').first()
Expected: visible
Received: <element(s) not found>
Call log:
  - expect.toBeVisible with timeout 35000ms
  - waiting for locator('//a[@class=\'view-request-success\']').first()

    at /root/code/portal-automation-test/tests/request/function.spec.ts:485:77
    at /root/code/portal-automation-test/tests/request/function.spec.ts:483: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 some information about New Case 123 Letter of Protection. Find out what it says. 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 11 hours ago
  - img
  - text: Son HaiBon Phan assigned a case to you 2 hours ago
  - 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 11 hours ago
  - img
  - text: Son HaiBon Phan assigned a case to you 2 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: New Request
- button "Switch to Step-by-Step"
- img
- paragraph: "1"
- text: Select an Action
- paragraph: "2"
- text: Identify Patient
- paragraph: "3"
- text: Identify a Business
- paragraph: "4"
- text: Create Message
- paragraph: "5"
- text: Share with Others
- checkbox "Apply all" [checked] [disabled]
- text: Apply all
- checkbox "Apply all" [checked] [disabled]
- text: Apply all
- checkbox "Apply all" [checked] [disabled]
- text: Apply all
- checkbox "Apply all" [checked] [disabled]
- text: Apply all
- img
- checkbox "Apply all" [checked] [disabled]
- text: Apply all Letter of Protection Test Request A Taylor Law Firm Templated Message triducgog0301+1@gmail.com
- img
- text: Delete Letter of Protection Test Request A Taylor Law Firm Templated Message triducgog0301+1@gmail.com
- img
- text: Delete
- button "Add more"
- button "Create"
```

# Test source

```ts
  385 |             await expect(requestPage.dashboardLoc.modal.headerModal("New Business")).toBeVisible();
  386 |             await expect(requestPage.dashboardLoc.modal.inputByID("autocomplete_name")).toHaveValue(uniqueBusiness);
  387 |
  388 |             await requestPage.dashboardLoc.buttonByText("Create").nth(1).click();
  389 |             await expect(requestPage.dashboardLoc.msgCreateSuccess).toBeVisible();
  390 |             await expect(requestPage.dashboardLoc.modal.inputByID("autocomplete_business_provider_id")).toHaveValue(uniqueBusiness);
  391 |             await requestPage.requestLoc.btnNextStep.click();
  392 |             await expect(requestPage.requestLoc.create.headerInCreateStep("Message")).toBeVisible();
  393 |         })
  394 |
  395 |         await test.step("Verify add message, share request", async () => {
  396 |             await requestPage.requestLoc.btnNextStep.click();
  397 |             await expect(requestPage.requestLoc.create.headerInCreateStep("Share")).toBeVisible();
  398 |             await requestPage.requestLoc.create.inputByPlaceholder("Type or select an email address").type(conf.data.user_recive, { delay: 100 });
  399 |             await expect(requestPage.requestLoc.create.inputByPlaceholder("Type or select an email address")).toHaveValue(conf.data.user_recive);
  400 |             await expect(requestPage.requestLoc.create.dropdownMemberShare(conf.data.user_recive)).toBeVisible();
  401 |             await requestPage.requestLoc.create.dropdownMemberShare(conf.data.user_recive).click({ force: true });
  402 |
  403 |             await requestPage.requestLoc.create.headerInCreateStep("Share").click();
  404 |             await requestPage.requestLoc.create.btnCreateAndShare.click();
  405 |             await expect(requestPage.requestLoc.create.caseIDRequest).toBeVisible({ timeout: 35_000 });
  406 |             url = requestPage.page.url();
  407 |         });
  408 |
  409 |         await test.step("Verify business had suggest in the firsts list", async () => {
  410 |             //Verify showing in case detail
  411 |             const casePage = new CasePage(requestPage.page);
  412 |             await casePage.open();
  413 |             await casePage.getDetailCase("495528");
  414 |             await casePage.dashboardLoc.listBusinesses.last().click();
  415 |             await expect(casePage.dashboardLoc.modal.headerModal("Business")).toBeVisible();
  416 |             const businessFirstRecommend = await casePage.caseLoc.detail.firstSuggestBusiness.innerText();
  417 |             expect(businessFirstRecommend).toBe(uniqueBusiness);
  418 |
  419 |             // Verify showing when create request
  420 |             await requestPage.gotoCreateRequest("multi");
  421 |             await requestPage.requestLoc.create.itemStep(3).first().click();
  422 |             await expect(requestPage.requestLoc.detail.businessFirstRecommend).toHaveText(uniqueBusiness);
  423 |         })
  424 |
  425 |         await test.step("Verify user had recive request", async () => {
  426 |             await requestPage.changeUser(conf.data.username_recive, conf.data.password_recive, requestPage.page);
  427 |
  428 |             await expect(loginPage.baseLoc.dashboardContainer).toBeVisible({ timeout: 15_000 });
  429 |             await requestPage.checkNotification("New Request", true);
  430 |             await expect(requestPage.requestLoc.create.caseIDRequest).toBeVisible();
  431 |             const urlRecive = requestPage.page.url();
  432 |             expect(urlRecive.replace('/shared', '')).toBe(url);
  433 |         })
  434 |     })
  435 |
  436 |     test("REQ_014 - Verify when create with Fast Submission with multiple request", {
  437 |         tag: ['@REQ_014', '@request', '@function']
  438 |     }, async ({ conf }) => {
  439 |         await test.step("Goto create new with Fast Submission", async () => {
  440 |             await requestPage.gotoCreateRequest("multi");
  441 |             await expect(requestPage.dashboardLoc.buttonByText("Switch to Step-by-Step")).toBeVisible();
  442 |         })
  443 |
  444 |         await test.step("Verify when click add more request", async () => {
  445 |             await requestPage.dashboardLoc.buttonByText("Add more").click();
  446 |             const listOfCreationRequests = (await requestPage.requestLoc.create.boxCreateMultiRequests.all()).length;
  447 |             expect(listOfCreationRequests).toBe(2);
  448 |         })
  449 |
  450 |         await test.step("Fill data to request", async () => {
  451 |             //Choose Action type
  452 |             await requestPage.requestLoc.create.itemStep(1).first().click();
  453 |             await requestPage.requestLoc.actionLetterOfProtection.first().click();
  454 |
  455 |             //Choose Client
  456 |             await requestPage.requestLoc.create.itemStep(2).first().click();
  457 |             const dataOfOptionsClient = await requestPage.fillDataCreateRequest("Type or select a name", "Name", conf.data.patient);
  458 |             expect(dataOfOptionsClient.infoPatient).toContain(dataOfOptionsClient.address);
  459 |
  460 |             //Choose Business
  461 |             await requestPage.requestLoc.create.itemStep(3).first().click();
  462 |             const dataOfOptionsBusiness = await requestPage.fillDataCreateRequest("Type or select a business", "Business Name", conf.data.business);
  463 |
  464 |             //Fix tạm thời sau cần chỉnh lại dynamic
  465 |             const address = "5718 Westheimer Rd., Ste 1000, Houston";
  466 |             expect(dataOfOptionsBusiness.infoPatient).toContain(address);
  467 |
  468 |             //Fill email member to share
  469 |             await requestPage.requestLoc.create.itemStep(5).first().click();
  470 |             await requestPage.requestLoc.create.inputByPlaceholder("Type or select an email address").first().fill(conf.data.user_recive);
  471 |             await expect(requestPage.requestLoc.create.inputByPlaceholder("Type or select an email address").first()).toHaveValue(conf.data.user_recive);
  472 |             await requestPage.requestLoc.create.dropdownMemberShare(conf.data.user_recive).click();
  473 |
  474 |             // Aplly for all requests
  475 |             const applyAllFields = ["patient", "action", "business", "message", "share"];
  476 |             await requestPage.dashboardLoc.common.spanText("New Request").click();
  477 |             for (let i = 0; i < applyAllFields.length; i++) {
  478 |                 await requestPage.waitForSecond(1);
  479 |                 await requestPage.requestLoc.create.inputCheckAll(applyAllFields[i]).click({ force: true });
  480 |             }
  481 |         })
  482 |
  483 |         await test.step("Verify create multi request", async () => {
  484 |             await requestPage.dashboardLoc.buttonByText("Create").first().click();
> 485 |             await expect(requestPage.requestLoc.create.viewRequest.first()).toBeVisible({ timeout: 35_000 });
      |                                                                             ^ Error: Timed out 35000ms waiting for expect(locator).toBeVisible()
  486 |             const requestsCreated = await requestPage.requestLoc.create.viewRequest.all();
  487 |             expect(requestsCreated.length).toBe(2);
  488 |             const listRequest: string[] = [];
  489 |             for (let i = 0; i < requestsCreated.length; i++) {
  490 |                 listRequest.push(await requestsCreated[i].innerText());
  491 |             }
  492 |             listRequest.reverse();
  493 |
  494 |             //Verify receive notification from shared user
  495 |             await requestPage.changeUser(conf.data.username_recive, conf.data.password_recive, requestPage.page);
  496 |             await expect(requestPage.dashboardLoc.notification.signalNoti).toBeVisible();
  497 |             await requestPage.checkNotification("New Request");
  498 |             await expect(requestPage.dashboardLoc.notification.requestID(listRequest[0])).toBeVisible();
  499 |             await requestPage.waitForSecond(3);
  500 |
  501 |             const listDesNotifications = await requestPage.dashboardLoc.notification.desNotifications.all();
  502 |             for (let i = 0; i < requestsCreated.length; i++) {
  503 |                 const descriptin = await listDesNotifications[i].textContent();
  504 |                 expect(descriptin).toContain(listRequest[i]);
  505 |                 expect(descriptin).toContain(conf.data.patient);
  506 |                 expect(descriptin).toContain(conf.data.action_type);
  507 |             }
  508 |
  509 |             //Verify in data exist in share with me
  510 |             let sharedRequestPage = new SharedRequestPage(requestPage.page);
  511 |             await sharedRequestPage.open()
  512 |             for (let i = 0; i < requestsCreated.length; i++) {
  513 |                 await sharedRequestPage.search(listRequest[i].replace("#", ""))
  514 |                 await expect(sharedRequestPage.dashboardLoc.table.itemInRow(listRequest[i].replace("#", ""))).toBeVisible();
  515 |             }
  516 |         })
  517 |     })
  518 |
  519 |     // Tạm thời vì sẽ đang có automation link r
  520 |     // test("REQ_017 - Verify business sharing edits in case the business has not accepted the request", {
  521 |     //     tag: ['@REQ_017', '@request', '@function']
  522 |     // }, async ({ conf, browser }) => {
  523 |     //     test.setTimeout(200_000);
  524 |
  525 |     //     await test.step("Get detail request", async () => {
  526 |     //         await requestPage.getDetailCase(conf.data.case);
  527 |     //     })
  528 |
  529 |     //     await test.step("Edit change share to another business", async () => {
  530 |     //         await requestPage.editBusinessAndShare(conf.data.business_change_to, conf.data.user.member_new, conf.data.member_change_to);
  531 |     //     })
  532 |
  533 |     //     await test.step("Check that the record no longer exists in the 'Shared with me' list of the deleted user, and that the record exists for the newly shared user", async () => {
  534 |     //         await requestPage.verifyShareRequest(browser, conf, 'member_old', true);
  535 |     //         await requestPage.verifyShareRequest(browser, conf, 'member_new', false);
  536 |     //     })
  537 |
  538 |     //     await test.step("Edit change share to old business", async () => {
  539 |     //         await requestPage.editBusinessAndShare(conf.data.business_chane, conf.data.user.member_old, conf.data.member_change);
  540 |     //     })
  541 |
  542 |     //     await test.step("Check that the record no longer exists in the 'Shared with me' list of the deleted user, and that the record exists for the newly shared user", async () => {
  543 |     //         await requestPage.verifyShareRequest(browser, conf, 'member_new', true);
  544 |     //         await requestPage.verifyShareRequest(browser, conf, 'member_old', false);
  545 |     //     })
  546 |     // })
  547 |
  548 |     test("REQ_018 - Verify business sharing edits in case the business has accepted the request", {
  549 |         tag: ['@REQ_018', '@request', '@function']
  550 |     }, async ({ conf }) => {
  551 |         await requestPage.getDetailCase(conf.data.case);
  552 |         await requestPage.requestLoc.detail.btnDropdownEditBusiness.click();
  553 |         await requestPage.requestLoc.detail.btnEdit.click();
  554 |         await expect(requestPage.dashboardLoc.modal.headerModal("Designated Business Cannot Be Modified")).toBeVisible();
  555 |     });
  556 |
  557 |     test("REQ_019 - Verify add tag in request", {
  558 |         tag: ['@REQ_019', '@request', '@function']
  559 |     }, async ({ conf }) => {
  560 |         await test.step("Navigate to request detail", async () => {
  561 |             await requestPage.getDetailCase(conf.data.case);
  562 |         });
  563 |
  564 |         await test.step("Verify add tags with tag count greater than 9 (invalid)", async () => {
  565 |             await requestPage.addMultipleTags(10);
  566 |             await requestPage.saveTags();
  567 |             await expect(requestPage.dashboardLoc.tag.errorMaxTag).toBeVisible();
  568 |         });
  569 |
  570 |         await test.step("Verify when add < 9 tag (valid)", async () => {
  571 |             await requestPage.removeOneTag();
  572 |             await requestPage.saveTags();
  573 |             await expect(requestPage.dashboardLoc.msgSuccess).toBeVisible();
  574 |             await requestPage.waitForSecond(1);
  575 |             await requestPage.dashboardLoc.btnClosePopupNotification.click();
  576 |             await expect(requestPage.dashboardLoc.tag.btnSaveTag).not.toBeVisible();
  577 |
  578 |             const tagCount = await requestPage.getTagCount();
  579 |             expect(tagCount).toBe(9);
  580 |         });
  581 |
  582 |         await test.step("Clear all tag", async () => {
  583 |             await requestPage.clearAllTags();
  584 |             await expect(requestPage.dashboardLoc.tag.btnSaveTag).not.toBeVisible();
  585 |
```