# 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: tests/ui/disabled-pages.spec.ts >> disabled entity pages >> homepage still shows enabled entity cards
- Location: tests/ui/disabled-pages.spec.ts:24:7

# Error details

```
Test timeout of 30000ms exceeded.
```

```
Error: page.goto: net::ERR_ABORTED; maybe frame was detached?
Call log:
  - navigating to "http://10.1.105.75/", waiting until "load"

```

# Test source

```ts
  1  | import { test, expect } from '@playwright/test';
  2  | 
  3  | // Entity collections switched off in the UI. Mirrors the switch in
  4  | // us.elect.info/src/disabled-pages.json (tests are copied into the runner
  5  | // image, so they cannot read that file). Keep the two lists in sync.
  6  | const DISABLED_COLLECTIONS = ['contributors', 'codesources'];
  7  | 
  8  | test.describe('disabled entity pages', () => {
  9  |   for (const collection of DISABLED_COLLECTIONS) {
  10 |     for (const path of [`/${collection}`, `/${collection}/`, `/${collection}/any-entity-id/`]) {
  11 |       test(`${path} returns 404`, async ({ page }) => {
  12 |         const response = await page.goto(path);
  13 |         expect(response?.status()).toBe(404);
  14 |       });
  15 |     }
  16 | 
  17 |     test(`homepage has no link or visible card for /${collection}/`, async ({ page }) => {
  18 |       await page.goto('/');
  19 |       await expect(page.locator(`a[href^="/${collection}"]`)).toHaveCount(0);
  20 |       await expect(page.locator(`[data-collection="${collection}"]`)).toBeHidden();
  21 |     });
  22 |   }
  23 | 
  24 |   test('homepage still shows enabled entity cards', async ({ page }) => {
> 25 |     await page.goto('/');
     |                ^ Error: page.goto: net::ERR_ABORTED; maybe frame was detached?
  26 |     for (const collection of ['committees', 'vendors', 'counties', 'places', 'datasources']) {
  27 |       await expect(page.locator(`a[data-collection="${collection}"]`)).toBeVisible();
  28 |     }
  29 |   });
  30 | 
  31 |   test('homepage loads without script errors', async ({ page }) => {
  32 |     const errors: string[] = [];
  33 |     page.on('pageerror', err => errors.push(err.message));
  34 |     await page.goto('/');
  35 |     await page.waitForLoadState('networkidle');
  36 |     expect(errors).toEqual([]);
  37 |   });
  38 | 
  39 |   test('disabled-pages runtime script is served', async ({ page }) => {
  40 |     const response = await page.goto('/js/disabled-pages.js');
  41 |     expect(response?.status()).toBe(200);
  42 |   });
  43 | });
  44 | 
```