-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add README to testing-dom examples (#259)
* WIP: add README to testing-dom examples * add README to testing-dom__drag-drop * add readme to testing-dom__form-interactions * add readme to testing-dom__hover-hidden-elements * add readme to testing-dom__tab-handling-links
- Loading branch information
Showing
11 changed files
with
70 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# drag-n-drop | ||
|
||
> Performing Drag & Drop by triggering mouse and drag events | ||
See test file [cypress/integration/drag_n_drop_spec.js](cypress/integration/drag_n_drop_spec.js) that shows how to simulate drag & drop behavior using | ||
|
||
- mouse events | ||
- drag events | ||
|
||
In both cases, the tests use [`cy.trigger`](https://on.cypress.io/trigger) command. |
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,17 @@ | ||
// *********************************************************** | ||
// This example plugins/index.js can be used to load plugins | ||
// | ||
// You can change the location of this file or turn off loading | ||
// the plugins file with the 'pluginsFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/plugins-guide | ||
// *********************************************************** | ||
|
||
// This function is called when a project is opened or re-opened (e.g. due to | ||
// the project's config changing) | ||
|
||
module.exports = (on, config) => { | ||
// `on` is used to hook into various events Cypress emits | ||
// `config` is the resolved Cypress config | ||
} |
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,10 +1,11 @@ | ||
{ | ||
"name": "drag-n-drop", | ||
"version": "1.0.0", | ||
"description": "", | ||
"description": "Performing Drag & Drop by triggering mouse and drag events", | ||
"scripts": { | ||
"cypress:run": "../../node_modules/.bin/cypress run", | ||
"cypress:open": "../../node_modules/.bin/cypress open", | ||
"start": "node server.js --port 7071" | ||
"start": "node server.js --port 7071", | ||
"dev": "../../node_modules/.bin/start-test http://localhost:7071/puzzle.html cypress:open" | ||
} | ||
} |
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,12 @@ | ||
# form-interactions | ||
|
||
> Shows how to change the value of a range input | ||
The test triggers `change` event on an `<input name="range-input" type="range" value="0" />` form element and asserts the value does get changed. | ||
|
||
 | ||
|
||
## See | ||
|
||
- [cypress/integration/form-interactions-spec.js](cypress/integration/form-interactions-spec.js) | ||
- [`cy.trigger`](https://on.cypress.io/trigger) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,10 +1,11 @@ | ||
{ | ||
"name": "form-interactions", | ||
"version": "1.0.0", | ||
"description": "", | ||
"description": "Shows how to change the value of a range input", | ||
"scripts": { | ||
"cypress:run": "../../node_modules/.bin/cypress run", | ||
"cypress:open": "../../node_modules/.bin/cypress open", | ||
"start": "node server.js --port 7072" | ||
"start": "node server.js --port 7072", | ||
"dev": "../../node_modules/.bin/start-test 7072 cypress:open" | ||
} | ||
} |
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,10 @@ | ||
# hover-hidden-elements | ||
> Interact with elements that are hidden by CSS | ||
|
||
See [cypress/integration/hover-hidden-elements-spec.js](cypress/integration/hover-hidden-elements-spec.js) to find how to get the lack if `.hover()` command. | ||
|
||
- Use [`.invoke()`](https://on.cypress.io/invoke) and [`.trigger()`](https://on.cypress.io/trigger) to simulate hovering. | ||
- Trigger `mouseover`, `mouseout`, `mouseenter`, `mouseleave` events. | ||
|
||
 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,13 +1,14 @@ | ||
{ | ||
"name": "hover-hidden-elements", | ||
"version": "1.0.0", | ||
"description": "", | ||
"description": "Interact with elements that are hidden by CSS", | ||
"scripts": { | ||
"cypress:run": "../../node_modules/.bin/cypress run", | ||
"cypress:run:chrome": "../../node_modules/.bin/cypress run --browser chrome", | ||
"cypress:open": "../../node_modules/.bin/cypress open", | ||
"start": "node server.js --port 7073", | ||
"test:ci": "../../node_modules/.bin/start-test 7073 cypress:run", | ||
"test:ci:chrome": "../../node_modules/.bin/start-test 7073 cypress:run:chrome" | ||
"test:ci:chrome": "../../node_modules/.bin/start-test 7073 cypress:run:chrome", | ||
"dev": "../../node_modules/.bin/start-test 7073 cypress:open" | ||
} | ||
} |
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,10 @@ | ||
# tab-handling-anchor-links | ||
> How to get around lack of multiple tabs in Cypress | ||
Read [Trade-offs - Multiple tabs](http://on.cypress.io/trade-offs#Multiple-tabs), and see [cypress/integration/tab_handling_anchor_links_spec.js](cypress/integration/tab_handling_anchor_links_spec.js) how to: | ||
|
||
- Test anchor links opening in new tabs: `<a target="_blank">`. | ||
- Test anchor links that link to external domains: `<a href="...">`. | ||
- Prevent content from opening in a new tab. | ||
- Request external content that would open in a new tab using [`cy.request()`](https://on.cypress.io/request). | ||
- Speed up tests by reducing loading times. |
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