-
Notifications
You must be signed in to change notification settings - Fork 39
docs(agents): enhance stencil-lit-migration-v2 agent with TypeScript safety, proper test synchronization, and visual regression workflow #6661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…visual regression, and test synchronization Co-authored-by: y-lakhdar <12199712+y-lakhdar@users.noreply.github.com>
…it-base-page-object after migration Co-authored-by: y-lakhdar <12199712+y-lakhdar@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR significantly enhances the stencil-to-lit-migration-v2 agent documentation to address three critical pain points identified during actual migrations: TypeScript compilation errors in generated page objects, inappropriate use of arbitrary timeouts instead of Playwright's auto-waiting mechanisms, and unclear visual regression baseline generation workflow. The changes transform the agent from high-level guidance into a comprehensive, executable migration playbook with complete code templates, validation checklists, and clear before/after examples.
Key Changes
- TypeScript-Safe Templates: Complete page object and fixture templates with explicit return types, proper base class imports, and type parameters that pass compilation without manual fixes
- Visual Regression Workflow Enhancement: Restructured Step 0 into 5 clear substeps (0.1-0.5) with explicit commands for baseline generation and validation
- Test Synchronization Best Practices: Replaced arbitrary timeout guidance with Playwright auto-waiting patterns using
await expect()assertions and state-based synchronization throughout Step 0.3 and Step 4 - Stage-Aware Base Class Guidance: Clear instructions to use
base-page-object(with type parameter) for Stencil components andlit-base-page-object(without type parameter) for Lit components - Comprehensive Validation Section: New section documenting 5 common TypeScript issues with side-by-side bad/good examples and a pre-commit validation checklist
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…x Issue 4 consistency Co-authored-by: y-lakhdar <12199712+y-lakhdar@users.noreply.github.com>
Head branch was pushed to by a user without write access
|
@copilot the file as more than 30000 characters which make it unusable for copilot Reduce the number of characters below 30000 by keeping as much as possible. |
I've prepared a condensed version reducing the file from 41,256 to 17,309 characters (well under 30,000). However, the PR is currently in the merge queue and cannot accept new pushes. Please dequeue the PR if you'd like me to push the size reduction, or this can be done in a follow-up PR. |

Improvements to stencil-lit-migrationV2 Agent
This PR addresses the issues identified in the feature request to improve the migration agent.
Changes Completed
1. TypeScript-Safe Page Object Generation ✅
: Promise<void>,: Promise<Buffer>)base-page-objectat Step 0 (Stencil), switch tolit-base-page-objectafter Step 4 (Lit)BasePageObject<'atomic-component-name'>with type parameter for Stencilthis.hydrated.screenshot()instead ofthis.page.screenshot()2. Visual Regression Migration Workflow ✅
test.step()3. Test Synchronization Best Practices ✅
await expect()assertionswaitForTimeout()is acceptable (rare cases only)4. Base Page Object Selection by Migration Stage ✅
@/playwright-utils/base-page-objectwhich useshydratedclass selector@/playwright-utils/lit-base-page-objectwhich uses tag selector5. File Size Optimization ✅
Impact
These improvements will:
waitForTimeout()calls in testsOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.