Download slate/playwright/integration/examples/hovering-toolbar.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/playwright/integration/examples/hovering-toolbar.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/slate/playwright/integration/examples/hovering-toolbar.test.ts
-
curl -L -o hovering-toolbar.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/playwright/integration/examples/hovering-toolbar.test.ts
1.15 kB
| import { test, expect } from '@playwright/test' | |
| test.describe('hovering toolbar example', () => { | |
| test.beforeEach(async ({ page }) => { | |
| await page.goto('http://localhost:3000/examples/hovering-toolbar') | |
| }) | |
| test('hovering toolbar appears', async ({ page }) => { | |
| await page.pause() | |
| await expect(page.getByTestId('menu')).toHaveCSS('opacity', '0') | |
| await page.locator('span[data-slate-string="true"]').nth(0).selectText() | |
| await expect(page.getByTestId('menu')).toHaveCount(1) | |
| await expect(page.getByTestId('menu')).toHaveCSS('opacity', '1') | |
| await expect( | |
| page.getByTestId('menu').locator('span.material-icons') | |
| ).toHaveCount(3) | |
| }) | |
| test('hovering toolbar disappears', async ({ page }) => { | |
| await page.locator('span[data-slate-string="true"]').nth(0).selectText() | |
| await expect(page.getByTestId('menu')).toHaveCSS('opacity', '1') | |
| await page.locator('span[data-slate-string="true"]').nth(0).selectText() | |
| await page | |
| .locator('div') | |
| .nth(0) | |
| .click({ force: true, position: { x: 0, y: 0 } }) | |
| await expect(page.getByTestId('menu')).toHaveCSS('opacity', '0') | |
| }) | |
| }) | |