Last active
March 28, 2018 06:03
-
-
Save NicholasBoll/ddf988f9296114ef93057a435666be17 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getFoo = cy.wrap('foo').createAlias() | |
const getBar = cy.wrap('bar').createAlias() | |
const getOne = cy.wrap(1).createAlias() | |
// get one alias | |
getFoo().then(subject => { | |
subject // string | |
console.log(subject) // logs 'foo' | |
}) | |
// get many aliases - API is similar to Promise.all | |
cy.getAliases([getFoo, getBar, getOne]).then(([foo, bar, one]) => { | |
foo // string | |
bar // string | |
one // number | |
console.log(foo, bar, one) // logs 'foo', 'bar', 1 | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment