alexanderop

Refactor Page Object — Testing skill for Claude Code

Testing community

Refactor a Vue component test to use the Page Object Pattern.

How to install Refactor Page Object

Installs to ~/.claude/commands/alexanderop-markvim-refactor-page-object.md

Terminal
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/alexanderop/MarkVim/HEAD/.claude/commands/refactor-page-object.md -o ~/.claude/commands/alexanderop-markvim-refactor-page-object.md

Restart Claude Code, or start a new session, for it to be picked up.

What Refactor Page Object does


description: Refactor a Vue component test to use the Page Object Pattern argument-hint: [test-file-path]

Page Object Pattern Refactoring

Refactor the test file located at @$1 to use the **Page Object Pattern**.

Context

Analyze the component import in @$1 to understand the component being tested. You need to abstract all UI interactions into a helper function.

Refactoring Rules

  1. Create the Page Object Factory:
    • Define an async function `createPage(

Alternatives in Testing

  • Webapp Testing — Test local web applications using Playwright for UI verification and debugging 94.1k ★
  • #29 — #52, #103) 92.5k ★
  • /test Routing — Vérifie le routing de commandes RTK sans exécution (dry-run) 25.5k ★

Full documentation available on GitHub

View Source Repository