# Instructions

- Following Playwright test failed.
- Explain why, be concise, respect Playwright best practices.
- Provide a snippet of code with the fix, if possible.

# Test info

- Name: contacts.spec.js >> Contacts — HTML Structure >> search and contact list elements present
- Location: tests/contacts.spec.js:49:3

# Error details

```
Error: expect(received).toContain(expected) // indexOf

Expected substring: "id=\"contact-list\""
Received string:    "404 page not found
"
```

# Test source

```ts
  1  | // contacts.spec.js — 360LM Contacts PWA (Top Management)
  2  | const { test, expect, devices, request } = require('@playwright/test');
  3  | 
  4  | const PWA_NAME = 'Contacts';
  5  | const BASE_URL = 'https://srv1111289.hstgr.cloud/contacts/';
  6  | 
  7  | test.use({ ...devices['Pixel 6'] });
  8  | 
  9  | test.describe(`${PWA_NAME} — Smoke`, () => {
  10 |   test('page or hub loads', async ({ page }) => {
  11 |     await page.goto(BASE_URL);
  12 |     await page.waitForTimeout(800);
  13 |     const url = page.url();
  14 |     expect(url.includes('/hub/') || url.includes('/contacts/')).toBeTruthy();
  15 |   });
  16 | 
  17 |   test('manifest.json returns 200', async ({ page }) => {
  18 |     const resp = await page.goto(BASE_URL + 'manifest.json');
  19 |     expect(resp?.status()).toBe(200);
  20 |   });
  21 | 
  22 |   test('sw.js is versioned', async ({ page }) => {
  23 |     const resp = await page.goto(BASE_URL + 'sw.js');
  24 |     const text = await resp?.text() || '';
  25 |     expect(text).toContain('contacts-v');
  26 |   });
  27 | });
  28 | 
  29 | test.describe(`${PWA_NAME} — HTML Structure`, () => {
  30 |   let html = '';
  31 | 
  32 |   test.beforeAll(async () => {
  33 |     const ctx = await request.newContext();
  34 |     const resp = await ctx.get(BASE_URL);
  35 |     html = await resp.text();
  36 |     await ctx.dispose();
  37 |   });
  38 | 
  39 |   test('auth screen and app container present', () => {
  40 |     expect(html).toContain('id="auth-screen"');
  41 |     expect(html).toContain('id="app"');
  42 |   });
  43 | 
  44 |   test('hub navigation button present', () => {
  45 |     expect(html).toContain("location.href='/hub/'");
  46 |     expect(html).toContain('🏡');
  47 |   });
  48 | 
  49 |   test('search and contact list elements present', () => {
> 50 |     expect(html).toContain('id="contact-list"');
     |                  ^ Error: expect(received).toContain(expected) // indexOf
  51 |     expect(html).toContain('id="q"');
  52 |     expect(html).toContain('id="stat-bar"');
  53 |   });
  54 | 
  55 |   test('Dexie offline DB used', () => {
  56 |     expect(html).toContain("new Dexie('contacts360')");
  57 |   });
  58 | 
  59 |   test('Top Management access control in place', () => {
  60 |     expect(html).toContain('TM_IDS');
  61 |     expect(html).toContain("'harish'");
  62 |     expect(html).toContain("'pramod'");
  63 |   });
  64 | });
  65 | 
```