-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Open
Labels
pkg/driverThis is due to an issue in the packages/driver directoryThis is due to an issue in the packages/driver directorystage: proposal 💡No work has been done of this issueNo work has been done of this issuetype: enhancementRequested enhancement of existing featureRequested enhancement of existing feature
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
FopherC, jayarjo, hadalin, florianorpeliere, jbarrus and 18 more
Metadata
Metadata
Assignees
Labels
pkg/driverThis is due to an issue in the packages/driver directoryThis is due to an issue in the packages/driver directorystage: proposal 💡No work has been done of this issueNo work has been done of this issuetype: enhancementRequested enhancement of existing featureRequested enhancement of existing feature