Open
Description
Summary
Sometimes you want to work with multiple cypress commands but want to wait for all comands to finish before proceeding with another task
Current behavior
currently you have to chain these commands and pass the fetched data from promiselike to promiselike.
cy.fixture('filea.json').then((fileAContents) => {
cy.fixture('fileb.json').then((fileBContents => {
....
cy.request... with fileAContents, fileBContents, fileCContents ...
}
}
Desired behavior
like Bluebirds props method or my favorite
import { zipObject } from 'lodash'
export async function makePromiseFromObject(obj: { [key: string]: Promise<any> }) {
return zipObject(Object.keys(obj), await Promise.all(Object.values(obj)))
}
we could aggregate all comand responses into one object with cy.all
cy.all({
fileAContents: cy.fixture('filea.json'),
fileBContents: cy.fixture('fileb.json'),
...
).then(props => cy.request( with ...props))
Relates to: #915