e2e-cucumber-playwright

Write and review Cucumber and Playwright end-to-end tests for the Dify application.

154k|24.3k|Updated Apr 12, 2023
One-click install
npx skills add https://github.com/langgenius/dify --skill e2e-cucumber-playwright
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: e2e-cucumber-playwright
Source: https://github.com/langgenius/dify/tree/main/.agents/skills/e2e-cucumber-playwright
Command: npx skills add https://github.com/langgenius/dify --skill e2e-cucumber-playwright

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Writing and maintaining end-to-end tests with Cucumber and Playwright requires balancing executable specifications with reliable browser automation. This Skill provides the conventions and review criteria needed to keep Dify's E2E suite readable, isolated, and aligned with real user behavior.

Core Features & Use Cases

  • Scenario Design: Write Gherkin scenarios that describe user-visible behavior rather than UI implementation details.
  • Step Definition Reuse: Reuse existing steps when behavior matches, and add new steps only when the behavior is materially different.
  • Locator and Assertion Strategy: Apply Playwright best practices for user-facing locators, web-first assertions, and per-scenario isolation.
  • Use Case: Review a new feature file under e2e/ to verify that scenarios use behavior-oriented language, that locators rely on roles or labels, and that assertions use Playwright's auto-retrying semantics.

Quick Start

Use the e2e-cucumber-playwright skill to review the new login scenario under e2e/tests for behavior-oriented wording and proper Playwright locator usage.

Frequently Asked Questions about e2e-cucumber-playwright

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a Cucumber scenario for a Dify user journey?

Write Gherkin that describes the user-visible action and outcome, not UI selectors or DOM details. Use Cucumber Expressions like {string} and {int} for parameters, and keep each scenario focused on one workflow.

What Playwright locators should I prefer in E2E tests?

Prefer getByRole, getByLabel, getByPlaceholder, and getByText in that order. Use getByTestId only when an explicit test contract is the most stable option, and avoid raw CSS or XPath selectors.

Does Playwright support auto-waiting assertions for E2E tests?

Yes. Use web-first assertions such as toHaveURL, toBeVisible, and toHaveText, which auto-retry. Avoid manual polling loops and waitForTimeout, and use expect.poll for non-DOM state like API responses.

When should I reuse an existing Cucumber step versus writing a new one?

Reuse a step when the user action and expected outcome genuinely match and the wording stays natural. Write a new step when the behavior is materially different or reusing the old wording would mislead the scenario.

Why do my Playwright tests leak state between scenarios?

State leaks usually come from module globals or shared mutable contexts. Keep scenario state in the runner's scenario-owned browser context and model authentication through explicit per-scenario fixtures.