# Test info

- Name: Case Module - Advanced Features >> CASE_032 - Verify data when add to request cart
- Location: /root/code/portal-automation-test/tests/case/features/features.spec.ts:517:7

# Error details

```
Error: expect(Buffer).toMatchSnapshot(expected)

  4454 pixels (ratio 0.02 of all image pixels) are different.

Expected: /root/code/portal-automation-test/tests/case/features/features.spec.ts-snapshots/list-request-by-case-overview-chromium-linux.png
Received: /root/code/portal-automation-test/test-results/tests-case-features-featur-14b8a-ta-when-add-to-request-cart-chromium/list-request-by-case-overview-20-actual.png
    Diff: /root/code/portal-automation-test/test-results/tests-case-features-featur-14b8a-ta-when-add-to-request-cart-chromium/list-request-by-case-overview-20-diff.png


Call Log:
- Test timeout of 80000ms exceeded
    at verifyScreenshot (/root/code/portal-automation-test/utils/screenshot.ts:22:8)
    at /root/code/portal-automation-test/tests/case/features/features.spec.ts:535:7
    at /root/code/portal-automation-test/tests/case/features/features.spec.ts:530: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:
      - link "Shared with me":
        - /url: https://qa.loprx.com/shared/requests
        - img
        - text: Shared with me
- banner:
  - button:
    - img
  - button [disabled]:
    - img
  - img
  - text: Tri01 Duc shared details regarding Example Search Tab Letter of Protection. See the information now. 1 week ago
  - img
  - text: Son HaiBon Phan assigned a request to you 9 hours ago
  - img
  - text: Son HaiBon Phan assigned a case to you 9 minutes ago
  - img
  - text: Tri01 Duc shared some information about Example Search Tab Letter of Protection. Find out what it says. 1 week ago
  - img
  - text: Son HaiBon Phan assigned a request to you 9 hours ago
  - img
  - text: Son HaiBon Phan assigned a case to you 9 minutes ago
  - textbox "Search..."
  - 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
  - img
  - button "2 Cart":
    - img
    - text: 2 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: Action Perform an Action
- paragraph: "2"
- text: Business Select receiving business
- paragraph: "3"
- text: Patient Identify the Patient
- paragraph: "4"
- text: Message Prepare a message
- paragraph: "5"
- text: Share Share with recipients
- checkbox "Apply all"
- text: Apply all
- checkbox "Apply all"
- text: Apply all
- checkbox "Apply all"
- text: Apply all
- checkbox "Apply all" [disabled]
- text: Apply all
- img
- checkbox "Apply all"
- text: Apply all Letter of Protection Business John Doe 65423 Templated Message Email
- button "Delete":
  - img
  - text: Delete
- text: Medical Bill Business John Doe 65423 Templated Message Email
- button "Delete":
  - img
  - text: Delete
- button "Add more"
- button "Create Multiple"
```

# Test source

```ts
   1 | import { expect, Locator, Page } from "@playwright/test";
   2 |
   3 | const DEFAULT_VIEWPORT = { width: 1920, height: 1080 };
   4 |
   5 | export const verifyScreenshot = async (
   6 |     snapshotName: string,
   7 |     target: Page | Locator,
   8 |     mask?: Locator[],
   9 |     tolerance: number = 0,
  10 |     viewport: { width: number; height: number } = DEFAULT_VIEWPORT
  11 | ) => {
  12 |     const page = 'page' in target ? target.page() : target;
  13 |     await page.setViewportSize(viewport);
  14 |
  15 |     await page.waitForLoadState('domcontentloaded');
  16 |     await page.waitForTimeout(1_000);
  17 |
  18 |     await expect(async () => {
  19 |         expect(await target.screenshot({ mask })).toMatchSnapshot(snapshotName, {
  20 |             maxDiffPixelRatio: tolerance
  21 |         });
> 22 |     }).toPass();
     |        ^ Error: expect(Buffer).toMatchSnapshot(expected)
  23 | };
  24 |
  25 | export const takeScreenshot = async (snapshotName: string, target: Page | Locator, mask?: Locator[]) => {
  26 |     expect(await target.screenshot({
  27 |         mask
  28 |     })).toMatchSnapshot(snapshotName)
  29 | }
```