
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
cypress-capybara
Advanced tools
An abbreviated port of Capybara's finder methods, reimplemented as custom Cypress commands.
npm install -D cypress-capybara
Then, in your cypress/support/commands.js
file, add:
import 'cypress-capybara/add-commands'
Here are the commands cypress-capybara implements. As with Capybara proper, they specify pretty liberal search functions, allowing locators to specify interactive elements by label, display text, name, id, value, title, and so on (depending on the element type).
cy.findLink(locator, options)
(see:
find_link
)cy.findField(locator, options)
(see:
find_field
)cy.findButton(locator, options)
(see:
find_button
)To see these in action, check out the library's test file.
x
method from Capybara::DSL?The library will only port functions which can be reasonably deemed as
worthwhile apart from the features provided by Cypress's built-in API–which is
pretty robust, out of the box! Not only do many commands roughly mirror those in
Capybara (e.g. cy.get()
is essentially the same as find()
or all()
,
whereas visit
is even named the same thing in both libraries), but the
chaining style used for Cypress enables a lot of the sort of operations that
required separate methods, options, and blocks in Capybara.
Want to fill in a field? Just do findField('Some Label').type('some text')
.
If this library were to implement fillIn('Some Label', {with: 'some text'})
,
it would simply be redundant and, more importantly, it would prevent users from
using the chaining API to do something like an intermediary filter()
operation
between finding matching fields and then invoking type()
.
FAQs
Capybara finders re-implemented as custom Cypress commands
The npm package cypress-capybara receives a total of 3 weekly downloads. As such, cypress-capybara popularity was classified as not popular.
We found that cypress-capybara demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.