TGViewer
Dev News от Максима Соснова Dev News от Максима Соснова @msosnovfeed · 2.79K subscribers
Post #1436 934
Playwright v1.62.0

Вышел релиз Playwright 1.62. Обычно я не пишу про релизы Playwright, но тут важное событие — допилили component testing. Текущее решение чем-то похоже на описание компонентов для Storybook.

Забавно, что инструкция по установке начинается с «запустите LLM». Буквально.

> Step 1: Point your coding agent at the skill

npx playwright init-skills

Set up component testing using the playwright-component-testing skill.


Затем надо немного сконфигурировать конфиг Playwright.

Затем создать давно знакомые нам stories-файлы
src/components/Button.story.tsx

import { Button } from './Button';

export const Primary = () => <Button title='Submit' />;

export const Disabled = () => <Button title='Submit' disabled />;


Т.е. по сути один в один истории Storybook. Интересно, не будет ли конфликтов? Пока выглядит, что Playwright-сборка должна будет уметь обрабатывать и исполнять все плагины и декораторы Storybook, либо придётся как-то делить истории Storybook и истории Playwright.

Затем пишем тесты
import { test, expect } from '@playwright/test';

test('renders primary button', async ({ mount }) => {
const component = await mount('components/Button/Primary');
await expect(component.getByRole('button')).toHaveText('Submit');
});

test('disabled button is disabled', async ({ mount }) => {
const component = await mount('components/Button/Disabled');
await expect(component.getByRole('button')).toBeDisabled();
});


Затем запускаем
npx playwright test --project=components


В доке также описаны ещё основные паттерны для тестирования. На них останавливаться не буду.

Надо будет попробовать в своём пет-проекте.

https://github.com/microsoft/playwright/releases/tag/v1.62.0

#development #playwright #testing #component-testing #releaseNotes
GitHub Release v1.62.0 · microsoft/playwright 🧱 New component testing model Component testing moves to a stories and galleries model. A story wraps your component in one specific scenario — hard-coded props, mock data, providers — and a galler...
  • 👍 5
More from @msosnovfeed
  1. Sep 14, 2026Дайджест за 2026-09-07 - 2026-09-09 Playwright v1.62.0 Вышел релиз Playwright 1.62. Обычно…
  2. Sep 9, 2026Mobile View — see your site on desktop & mobile at once Расширение для Chrome от подписчик…
  3. Sep 7, 2026Дайджест за 2026-08-31 - 2026-09-04 How to find a Next.js memory leak in production Очень…
  4. Sep 4, 2026Measuring soft navigations Web Vitals стали основным мерилом скорости работы сайтов. Но пр…
  5. Sep 2, 2026Canvas UI Canvas UI — open-source библиотека готовых компонентов для создания красивых эфф…
  6. Aug 31, 2026How to find a Next.js memory leak in production Очень хорошая и практичная статья про утеч…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →