Goal: Transform EmailEditor into a well-tested, easily maintainable library, enabling other teams to integrate it with minimal support overhead.
-
Current Pain Points:
- Inconsistent testing approaches
- Frequent support requests from other teams
- Lack of standardized E2E testing and documentation
-
Proposed Solution:
- Migrate to new mono-frontend repository (pnpm-based).
- Leverage existing tooling (linting, formatting, Cypress integration, release automation).
- Introduce Cypress Page Objects in EmailEditor.
- Maintain thorough documentation and automated releases.
Handled by the new mono-frontend repo.
This covers linting, formatting (Prettier), ESLint rules, and the overall repository structure (monorepo with pnpm).
Handled by the new mono-frontend repo.
This includes setting up Cypress, the test runner configurations, and base CI/CD integration for E2E tests.
While the new repo covers the baseline Cypress setup, EmailEditor specifically needs Page Objects that simplify testing our Lit components:
-
Purpose
- Encapsulate Shadow DOM selectors and repeated interactions into reusable classes.
- Provide a straightforward interface for other teams to integrate EmailEditor tests.
-
Example (e.g.,
EmailHeader.page.ts
):export class EmailHeaderPage { private selector: string; constructor(selector: string = 'email-header') { this.selector = selector; } getTitleElement() { return cy.get(this.selector).shadow().find('.title'); } setTitle(newTitle: string) { cy.get(this.selector).invoke('attr', 'title', newTitle); } assertTitle(expected: string) { this.getTitleElement().should('contain.text', expected); } }
-
Integration
- Other teams can import this Page Object (
import { EmailHeaderPage } from '@org/email-editor/cypress/page-objects';
) and immediately write end-to-end tests without manually dealing with Shadow DOM intricacies.
- Other teams can import this Page Object (
-
Maintenance
- Our team will keep Page Objects updated as components evolve, ensuring consistent test reliability across versions.
Handled by the new mono-frontend repo.
Storybook integration, custom elements documentation (e.g., using@custom-elements-manifest/analyzer
), and doc site deployment are part of the existing infrastructure.
Handled by the new mono-frontend repo.
Includes semantic-release (or a similar tool) for automated versioning, changelog generation, and publishing to the internal or public registry.
-
Migration to Mono-Frontend
- Configure pnpm workspace.
- Ensure shared ESLint, Prettier, and TS config is applied to all packages.
- Finalize Cypress test runner setup (already present in monorepo).
-
Create Cypress Page Objects for EmailEditor
- Timeline: ~1 week
- Action Items:
- Identify key Lit components (header, body, footer, etc.).
- Implement a Page Object class for each, covering attributes, Shadow DOM queries, and user actions.
- Provide minimal documentation (e.g., a
README.md
) explaining how to use these Page Objects.
-
Add Core E2E Tests (Optional This Sprint)
- Timeline: ~1 week (overlap possible)
- Action Items:
- Use the newly created Page Objects to write “smoke tests” verifying EmailEditor’s main user flows.
- Confirm the new monorepo pipeline (CI/CD) successfully runs these E2E tests on pull requests.
-
Documentation & Release Verification
- Action Items:
- Ensure EmailEditor stories/docs are present in Storybook.
- Validate that merges trigger an automated release (semantic-release) for EmailEditor, including a changelog update.
- Action Items:
- Page Objects drastically reduce the complexity of testing Lit components, benefiting all teams that consume EmailEditor.
- By migrating to the mono-frontend repo, we inherit:
- Established project tooling and consistent code standards (Step 1).
- A solid E2E infrastructure with Cypress (Step 2).
- Existing documentation processes (Step 4).
- Automated releases and changelogs (Step 5).
- After completing the Page Object creation and verifying E2E flows, EmailEditor will be a reliable, well-tested library that’s easy for other teams to adopt.
- Management: Approve resource allocation to finalize migration and implement Page Objects for EmailEditor.
- Development Team: Begin implementation of Page Objects and minimal E2E tests once the repo migration is complete.
- Stakeholders: Provide feedback on required test scenarios and confirm that new testing workflows meet their needs.
With these steps, EmailEditor will be fully integrated into the new mono-frontend repository, gaining consistent tooling, testing, documentation, and a smooth release pipeline for all future enhancements.