mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-18 22:28:38 -05:00
882 B
882 B
title, comments, description
| title | comments | description |
|---|---|---|
| spread | true |
The spread command allows an expression to be expanded in places where multiple arguments are expected. Similar to cy.then, but always expects an array as it's subject.
| Returns | the value of the spread |
| Timeout | cannot timeout |
cy.spread( fn )
Expand an array of arguments.
Usage
Expand the array of aliased routes
cy
.server()
.route('/users/').as('getUsers')
.route('/activities/').as('getActivities')
.route('/comments/').as('getComments')
.wait(['@getUsers', '@getActivities', '@getComments'])
.spread(function(getUsers, getActivities, getComments){
// each XHR is now an individual argument
})