Download slate/playwright/integration/examples/search-highlighting.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 513 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/playwright/integration/examples/search-highlighting.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/slate/playwright/integration/examples/search-highlighting.test.ts
-
curl -L -o search-highlighting.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/playwright/integration/examples/search-highlighting.test.ts
513 Bytes
| import { test, expect } from '@playwright/test' | |
| test.describe('search highlighting', () => { | |
| test.beforeEach( | |
| async ({ page }) => | |
| await page.goto('http://localhost:3000/examples/search-highlighting') | |
| ) | |
| test('highlights the searched text', async ({ page }) => { | |
| const searchField = 'input[type="search"]' | |
| const highlightedText = 'search-highlighted' | |
| await page.locator(searchField).fill('text') | |
| await expect(page.locator(`[data-cy="${highlightedText}"]`)).toHaveCount(2) | |
| }) | |
| }) | |