Skip to content

Add Angular mount package #22813

@ZachJW34

Description

@ZachJW34

In order to support Angular for Component Testing, we need to add an Angular mounting package. We already have an npm/angular package, so replacing/updating this package would be best (it was never officially published).

The responsibilities of this package are:

  • Mount a compiled Angular component into the DOM
  • Provide options for customizing the mounted components behavior (ngModule, providers, directives etc...)

Angular users are already familiar with unit-testing Angular components. Angular provides testing support out of the box, so leveraging the existing APIs would be great as users who are familiar with unit testing would be able to quickly pick up Cypress Angular component testing. The caveat here is that Angular uses a custom compiler, so we should investigate if using this API would produce any differences in components mounted in dev vs Cypress.

This package should be copied to the cli package so that users are able to import this package via import { mount } from "cypress/angular".

Requirements:

  • Should mount Angular components via an exported mount function
  • Should allow Angular components to be customized in order to provide the component with the proper context (ngModule, providers, directives etc..)
  • Should be copied to the cli package to support import from cypress/angular
  • Should add system tests proving that Angular components can be mounted

There is an external package created by our very own @jordanpowell88.

There is active discussion on versioning CT mounting libs that will affect how we publish and version this package

Metadata

Metadata

Labels

CTIssue related to component testingtype: featureNew feature that does not currently exist

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions