-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
chore: normalize CT adapter readme documents #24590
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,10 @@ | ||
# @cypress/angular | ||
|
||
Mount Angular components in the open source [Cypress.io](https://www.cypress.io/) test runner **v7.0.0+** | ||
|
||
> **Note:** This package is bundled with the `cypress` package and should not need to be installed separately. See the [Angular Component Testing Docs](https://docs.cypress.io/guides/component-testing/quickstart-angular#Configuring-Component-Testing) for mounting Angular components. Installing and importing `mount` from `@cypress/angular` should only be used for advanced use-cases. | ||
|
||
## Install | ||
|
||
- Requires Cypress v7.0.0 or later | ||
- Requires [Node](https://nodejs.org/en/) version 12 or above | ||
|
||
```sh | ||
npm install --save-dev @cypress/angular | ||
``` | ||
|
||
## Run | ||
|
||
Open cypress test runner | ||
``` | ||
npx cypress open --component | ||
``` | ||
|
||
If you need to run test in CI | ||
``` | ||
npx cypress run --component | ||
``` | ||
|
||
For more information, please check the official docs for [running Cypress](https://on.cypress.io/guides/getting-started/opening-the-app#Quick-Configuration) and for [component testing](https://on.cypress.io/guides/component-testing/writing-your-first-component-test). | ||
|
||
## API | ||
|
||
- `mount` is the most important function, allows to mount a given Angular component as a mini web application and interact with it using Cypress commands | ||
- `MountConfig` Configuration used to configure your test | ||
- `createOutputSpy` factory function that creates new EventEmitter for your component and spies on it's `emit` method. | ||
|
||
## Examples | ||
|
||
```ts | ||
import { mount } from '@cypress/angular' | ||
import { HelloWorldComponent } from './hello-world.component' | ||
|
||
describe('HelloWorldComponent', () => { | ||
it('works', () => { | ||
mount(HelloWorldComponent) | ||
// now use standard Cypress commands | ||
cy.contains('Hello World!').should('be.visible') | ||
}) | ||
}) | ||
``` | ||
|
||
```ts | ||
import { mount } from '@cypress/angular' | ||
import { HelloWorldComponent } from './hello-world.component' | ||
|
||
describe('HelloWorldComponent', () => { | ||
it('works', () => { | ||
mount('<app-hello-world></app-hello-world>', { | ||
declarations: [HelloWorldComponent] | ||
}) | ||
// now use standard Cypress commands | ||
cy.contains('Hello World!').should('be.visible') | ||
}) | ||
}) | ||
``` | ||
|
||
Look at the examples in [cypress-component-testing-apps](https://github.com/cypress-io/cypress-component-testing-apps) repo. Here in the `angular` and `angular-standalone` folders are the two example applications showing various testing scenarios. | ||
|
||
|
||
## Compatibility | ||
|
||
| @cypress/angular | cypress | | ||
| -------------- | ------- | | ||
| >= v1 | >= v10.5 | | ||
Mount Angular components in the open source [Cypress.io](https://www.cypress.io/) test runner | ||
|
||
> **Note:** This package is bundled with the `cypress` package and should not need to be installed separately. See the [Angular Component Testing Docs](https://docs.cypress.io/guides/component-testing/angular/overview) for mounting Angular components. Installing and importing `mount` from `@cypress/angular` should only be done for advanced use-cases. | ||
## Development | ||
|
||
Run `yarn build` to compile and sync packages to the `cypress` cli package. | ||
|
||
## License | ||
|
||
[![license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/cypress-io/cypress/blob/develop/LICENSE) | ||
|
||
This project is licensed under the terms of the [MIT license](/LICENSE). | ||
|
||
## [Changelog](./CHANGELOG.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# @cypress/react18 | ||
|
||
Mount React 18 components in the open source [Cypress.io](https://www.cypress.io/) test runner | ||
|
||
> **Note:** This package is bundled with the `cypress` package and should not need to be installed separately. See the [React Component Testing Docs](https://docs.cypress.io/guides/component-testing/react/overview) for mounting React components. Installing and importing `mount` from `@cypress/react18` should only be done for advanced use-cases. | ||
|
||
## [Changelog](./CHANGELOG.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I figured that we should leave this one since it contains info that isn't captured in the docs, and it's a little different from our other adapter packages