A Cypress command for fill inputs
npm install cypress-fill-command

  
A fill command that fills inputs faster than the cypress native type command.
This package adds a custom [Cypress][cypress] command that fills inputs, textareas and content editable elements. The type command from cypress has 10ms delay, so it slows the tests a bit. This command doesn't have any delay at all.
- Installation
- Usage
- API
- It isn't working
- Contributors
- License
The package is distributed via [npm][npm] and should be installed as one of your project's devDependencies:
``bash`
npm install --save-dev cypress-fill-command
or
`bash`
yarn add cypress-fill-command --dev
cypress-fill-command extends Cypress' cy command.cypress/support/commands.js
Add this line to your project's :
`javascript`
import 'cypress-fill-command'
Now you are ready to use the command. Here is a basic example:
`javascript`
cy.get('#the-element-id').fill('Some text')
Exposed command in a nutshell:
`javascript`
cySubject.fill(text, options)
- {String} text โ The text to be filled into an input
Options contains following properties:
- {boolean} overwrite - To overwrite the input value. Defaults to trueprepend
- {boolean} - To insert before (true) or after (false) the current input value when overwrite is false. Defaults to false`
It has been used on a React project with inputs controlled by React state.
I cannot guarantee it will work in any custom input, but we can try to improve it, just open an issue or a PR.
Thanks goes to these wonderful people (emoji key):
Steven Dorries ๐ค โ ๏ธ ๐ป | Nathan Jones ๐ป | Andrรฉ Muta ๐ค | Daniel Ferrari ๐ ๐ โ ๏ธ ๐ป ๐ | Dan Caseley ๐ค โ ๏ธ ๐ป |
This project follows the all-contributors specification. Contributions of any kind welcome!
[MIT][mit]
[cypress]: https://cypress.io
[mit]: https://opensource.org/licenses/MIT
[npm]: https://www.npmjs.com/