opal-frontend-cypress-e2e
为opal-frontend提供Cypress端到端测试指南,包括Cucumber功能布局、标签、步骤定义、动作或流程、选择器和可访问性规格。在添加或更新端到端场景时使用。
📖 中文导读:为opal-frontend提供Cypress端到端测试指南,包括Cucumber功能布局、标签、步骤定义、动作或流程、选择器和可访问性规格。在添加或更新端到端场景时使用。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: opal-frontend-cypress-e2e description: Cypress end-to-end testing guidance for opal-frontend, including Cucumber feature layout, tags, step definitions, Actions or Flows, selectors, and accessibility specs. Use when adding or updating E2E scenarios.
Opal Frontend Cypress E2E Testing
Overview
Use these rules when writing or updating Cypress E2E tests and Cucumber feature files in opal-frontend.
Feature Layout and Tags
- Preferred home is
cypress/e2e/functional/opal. - Feature files live under capability folders (for example,
features/manualAccountCreation/**,features/fineAccountEnquiry/**). - Tag scenarios with
@functional,@smoke, and Jira IDs so suites can target subsets. - Keep legacy suites in
cypress/e2e/Old_functional_E2E_Tests; new scenarios should follow theopallayout.
Accessibility Coverage
- Accessibility specs live alongside features and should navigate to each page, inject
axe-core, run scans, and assert no violations. - When a new page or view is added to a feature, add or update its accessibility spec.
Step Definitions
- Step definitions in
cypress/support/step_definitions/newStyleSteps/**must be thin shims. - Each Given, When, Then should delegate to a single Action or Flow method.
- Shared DB or setup logic belongs in
databaseStepsorsupport/utils, not in steps.
Actions, Flows, and Selectors
- Actions in
cypress/e2e/functional/opal/actions/**wrap interactions, API stubs, and navigation using selectors fromcypress/shared/selectors/**. - Flows in
cypress/e2e/functional/opal/flows/**compose actions into business journeys and are the verbs exposed to steps and component specs. - Selectors are centralized. Add hooks in Angular templates and document them in
cypress/shared/selectors/**. Avoid positional CSS.
Running a Feature
- Run a single feature file with:
yarn cypress run --browser chrome --spec 'cypress/e2e/functional/opal/features/manualAccountCreation/populateAndSubmit/PopulateAndSubmit.feature'
Handling Real Product Bugs
- When a feature fails because of a real product bug, do not patch application behavior just to green the test.
- Skip or xfail the test if unavoidable and report the underlying issue in the task update.