-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: update component-tests example
- Loading branch information
1 parent
92954d1
commit aae9fe5
Showing
11 changed files
with
382 additions
and
2,734 deletions.
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,4 +1,34 @@ | ||
# example: component-tests | ||
|
||
This example is built based on the instructions from the [Cypress documentation](https://docs.cypress.io/) | ||
[React Quickstart](https://docs.cypress.io/guides/component-testing/react/quickstart). It uses [Vite](https://vitejs.dev/) to create the app. | ||
This example was built as follows: | ||
|
||
1. [Vite > Getting Started](https://vitejs.dev/guide/) instructions with the [react](https://vite.new/react) template were used to create the app | ||
```bash | ||
npm create vite@latest component-tests -- --template react | ||
``` | ||
The linting `npm` modules and linting script have been removed, since this is out-of-scope for the example. | ||
1. The Cypress documentation instructions from [Component Testing > Getting Started](https://on.cypress.io/guides/component-testing/getting-started) were followed to set up component testing, including copying | ||
|
||
- `<Stepper />` component: [react/my-awesome-app/src/components/Stepper.jsx](https://github.com/cypress-io/component-testing-quickstart-apps/blob/main/react/my-awesome-app/src/components/Stepper.jsx) | ||
|
||
from the [Cypress Component Testing Quickstart Apps](https://github.com/cypress-io/component-testing-quickstart-apps) repo to this repo's `examples/component-tests/src/components/` sub-directory. | ||
1. The script `"test": "cypress run --component"` was added to `package.json`. | ||
## Execution | ||
Execute the following to change to this directory: | ||
```bash | ||
cd examples/component-tests | ||
``` | ||
Install dependencies with: | ||
```bash | ||
npm ci | ||
``` | ||
Run Cypress component testing with: | ||
```bash | ||
npm test | ||
``` |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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