Логотип Flow Test

Flow Test

СпільнотаПопулярне
Trystan-SA
flow-test

Turn a user flow into an end-to-end test with a UX budget — the test fails when the happy path needs more clicks, fields or page loads than allowed, so UX regressions break CI the way performance regressions do. Playwright by default, adapted to Cypress or the project's existing E2E setup. Use when asked to test a flow, add a click budget, keep onboarding, signup or checkout from getting longer, or after a happy-path audit sets a budget.

Огляд

ВидавецьTrystan-SA
Репозиторійproduct-engineer-skills
Назва навичкиflow-test
Зірки
2.1K
Форки
247
Файли в пакеті
Лише інструкції
ЛіцензіяMIT
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Усе необхідне — в інструкціях

    Усе потрібне моделі міститься в інструкціях — жодних додаткових файлів для синхронізації.

  • Відкритий вихідний код

    Видавець на GitHub: Trystan-SA. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Flow Test у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки на GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до розділу «Плагіни» → «Навички».
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/Trystan-SA/product-engineer-skills/tree/main/skills/flow-test
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Trystan-SA/product-engineer-skills.git /tmp/product-engineer-skills
mkdir -p .claude/skills
cp -r /tmp/product-engineer-skills/skills/flow-test .claude/skills/flow-test
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Flow Test в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Flow Test, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Flow Test не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

Flow Test

A flow that took 6 clicks at launch takes 11 a year later, one reasonable PR at a time, and nothing fails along the way. This skill makes the flow's cost an assertion: an end-to-end test walks the happy path the way a user would, counts the interactions, and fails when the count exceeds the budget.

Phase 1: Find the E2E setup

Look for an existing end-to-end stack: playwright.config.*, cypress.config.*, wdio.conf.*, Maestro or Detox for mobile. Reuse its config, fixtures, authentication helpers, test-data seeding and CI job.

If there's none, propose Playwright and ask before adding it: a new tool in the project's toolchain is the team's decision.

Phase 2: Get the flow and the budget

Read flow-audit.md in the feature folder (docs/product/<feature-slug>/) for the steps and the budget. Without one, trace the happy path quickly (entry point → steps → goal state) and set the budget to today's count: the test's first job is to stop the flow from getting worse.

What to assert, depending on the flow:

  • clicks — activations of controls: buttons, links, options, checkboxes, tabs, including opening dropdowns and closing modals.
  • fields — distinct inputs the user fills.
  • navigations — page loads and client-side route changes after the start state.
  • time (optional) — only with a generous margin, because CI machines are noisy.

These match the definitions in happy-path-audit, so the audit's budget can be asserted as is.

Phase 3: Add the UX meter

Count interactions in the page, not in the test code. A listener on real DOM events counts every click, whichever helper or page object produced it. Add this once next to the project's other fixtures, adapted to its language and conventions (Playwright with TypeScript shown):

ts
// e2e/fixtures/ux-meter.ts
import { test as base, expect, type Page } from '@playwright/test';

export type UxBudget = { clicks?: number; fields?: number; navigations?: number };

export class UxMeter {
  clicks = 0;
  fields = 0;
  navigations = 0;

  constructor(private readonly page: Page) {}

  async install() {
    await this.page.exposeBinding('__uxMeter', (_source, kind: 'click' | 'field') => {
      if (kind === 'click') this.clicks++;
      else this.fields++;
    });
    await this.page.addInitScript(() => {
      const report = (kind: string) => (window as any).__uxMeter?.(kind);
      const touched = new WeakSet<EventTarget>();
      const onField = (event: Event) => {
        if (event.target && !touched.has(event.target)) {
          touched.add(event.target);
          report('field');
        }
      };
      addEventListener('click', (event) => { if (event.isTrusted) report('click'); }, true);
      addEventListener('input', onField, true);
      addEventListener('change', onField, true);
    });
    this.page.on('framenavigated', (frame) => {
      if (frame === this.page.mainFrame()) this.navigations++;
    });
  }

  /** Call once the start state is visible (after login, seeding and the first goto). */
  start() {
    this.clicks = 0;
    this.fields = 0;
    this.navigations = 0;
  }

  expectWithin(budget: UxBudget) {
    const actual = { clicks: this.clicks, fields: this.fields, navigations: this.navigations };
    base.info().annotations.push({ type: 'ux-budget', description: JSON.stringify({ actual, budget }) });
    for (const key of Object.keys(budget) as (keyof UxBudget)[]) {
      expect(actual[key], `UX budget exceeded for ${key}: ${JSON.stringify(actual)}`)
        .toBeLessThanOrEqual(budget[key]!);
    }
  }
}

export const test = base.extend<{ ux: UxMeter }>({
  ux: async ({ page }, use) => {
    const meter = new UxMeter(page);
    await meter.install();
    await use(meter);
  },
});
export { expect };

What it counts:

  • Playwright's click, check and tap produce trusted events and are counted. Clicks dispatched by the app's own JavaScript are not.
  • fill and selectOption count one field per input, however many times it's edited. They don't count a click: focusing a text field is part of filling it. A native <select> costs a real user two clicks — add them to the budget by hand if the flow has one.
  • A checkbox or radio counts as one click and one field. Set budgets from a measured run, not only from the audit's arithmetic.
  • framenavigated fires for full page loads and for client-side route changes. If the app rewrites the URL several times per screen (query parameters, redirects), assert clicks and fields and leave navigations out.
  • For Cypress or another runner, keep the same design: a page-side listener on click, input and change in the capture phase, reset at the start state, asserted at the goal state.

Phase 4: Write the tests

Happy path first. Walk it like a user: role- and label-based locators (getByRole, getByLabel), which survive refactors and double as an accessibility check. Seed the start state through the API if that's faster, but never take API shortcuts for the steps being measured.

ts
import { test, expect } from './fixtures/ux-meter';

test('first invoice is sent within budget', async ({ page, ux }) => {
  await page.goto('/dashboard'); // signed in through storageState
  await expect(page.getByRole('heading', { name: 'Dashboard' })).toBeVisible();
  ux.start();

  await page.getByRole('button', { name: 'New invoice' }).click();
  await page.getByLabel('Client').fill('Acme');
  await page.getByRole('option', { name: 'Acme Corp' }).click();
  await page.getByLabel('Amount').fill('1200');
  await page.getByRole('button', { name: 'Send invoice' }).click();

  await expect(page.getByText('Invoice sent')).toBeVisible(); // goal state
  ux.expectWithin({ clicks: 3, fields: 2 });                  // budget from flow-audit.md
});

Then the critical unhappy paths listed in unhappy-paths.md. Simulate failures with network interception (page.route returning a 500 or a validation error) and assert the recovery: the error is visible, the input is kept, and the user gets back on the path within a small budget.

Phase 5: Make the budget a team rule

  • Keep budgets next to the test, or in one ux-budgets.json when there are several flows, so any budget change shows up in the diff.
  • The failure message must say what to do: if the extra step is intentional, raise the budget in the same PR and justify it in the description; otherwise remove the step.
  • Ratchet: when a PR makes the flow shorter, lower the budget in that PR.
  • Run the tests in the existing CI job. The ux-budget annotation records the measured counts, so ux-review can show before and after on a PR.

Output

The fixture, the flow tests and the budgets committed to the repo, with a run that passes — or that fails on an existing regression, which you report. Summarize: flows covered, budgets set (current and target), and any flow already over its target.

Поширені запитання

Що робить навичка ШІ Flow Test?

Turn a user flow into an end-to-end test with a UX budget — the test fails when the happy path needs more clicks, fields or page loads than allowed, so UX regressions break CI the way performance regressions do. Playwright by default, adapted to Cypress or the project's existing E2E setup. Use when asked to test a flow, add a click budget, keep onboarding, signup or checkout from getting longer, or after a happy-path audit sets a budget.

Навіщо використовувати Flow Test у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Flow Test — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Flow Test у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/Trystan-SA/product-engineer-skills/tree/main/skills/flow-test. TypingMind прочитає файл SKILL.md і встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Flow Test?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Flow Test?

Зі скількома забажаєте. У TypingMind ви можете використовувати Flow Test із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Flow Test?

Так. На GitHub цю навичку публікує Trystan-SA за ліцензією MIT. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇