Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@testing-library/cypress

Package Overview
Dependencies
Maintainers
15
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@testing-library/cypress

Simple and complete custom Cypress commands and utilities that encourage good testing practices.

  • 10.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2M
increased by19.03%
Maintainers
15
Weekly downloads
 
Created

What is @testing-library/cypress?

@testing-library/cypress is an extension of the Testing Library family for use with Cypress, a popular end-to-end testing framework. It provides a set of custom commands for interacting with DOM elements in a way that resembles how users interact with your application, making tests more readable and maintainable.

What are @testing-library/cypress's main functionalities?

Querying Elements

This feature allows you to query DOM elements using the same queries available in @testing-library/dom. For example, you can find a button with the text 'Submit' and click it.

cy.findByText('Submit').click();

Assertions

You can make assertions on elements found using Testing Library queries. This example checks if a button with the role 'button' and name 'submit' is visible.

cy.findByRole('button', { name: /submit/i }).should('be.visible');

Custom Commands

The package provides custom commands like `findByLabelText` to interact with form elements. This example types 'myUsername' into an input field labeled 'Username'.

cy.findByLabelText('Username').type('myUsername');

Other packages similar to @testing-library/cypress

Keywords

FAQs

Package last updated on 31 May 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc