menu

Testing Library

Simple and complete DOM testing utilities that encourage good testing practices.

Channels
Chat
view-forward
# All channels
view-forward
# General
view-forward
# General Help
view-forward
# Angular Help
view-forward
# Cypress Help
view-forward
# DOM Help
view-forward
# React Help
view-forward
# Svelte Help
view-forward
# TestCafe Help
view-forward
# Vue Help
view-forward
Team

How to use findAll?

November 11, 2019 at 3:21pm

How to use findAll?

November 11, 2019 at 3:21pm (Edited 5 months ago)
Hi all, I've recently started using Cypress Testing Library and am currently running into an issue with findAllByTestId. findAllByTestId('droppable') resolves to two DOM elements, of which i want to click on the second one. The following doesn't work, however: the item will simply not be clicked and the command will 'fail' silently.
cy.findAllByTestId("droppable").then(result => {
result[1].click();
});
The following command does work, but is undesirable because I only want to click the second element:
cy.findAllByTestId("droppable").click({multiple: true});
Hope I came to the right place and any help is greatly appreciated! flopie
No messages yet