I am using Cypress with Meteor.
I need the Meteor
object on the window to call Meteor.loginWithPassword
.
I want to use this to skip using the UI for login each time. I have tried the following but Meteor is not on the window when it runs.
cy.window()
.then((window) => {
console.log(window.Meteor);
});
I am using Cypress with Meteor.
I need the Meteor
object on the window to call Meteor.loginWithPassword
.
I want to use this to skip using the UI for login each time. I have tried the following but Meteor is not on the window when it runs.
cy.window()
.then((window) => {
console.log(window.Meteor);
});
Share
Improve this question
asked Jul 24, 2018 at 10:31
Ozzy WalshOzzy Walsh
8879 silver badges17 bronze badges
1 Answer
Reset to default 5Try this:
cy.window().its('Meteor');
This will wait until the Meteor
property exists on the window
object.
Or, if you want to do something with the Meteor
property once it exists, use .then()
:
cy.window().its('Meteor').then(meteor => {
console.log(meteor);
// do things
});
.its()
will attempt to get a property from the object wrapped by Cypress, in this case the window
object, and will retry until the property exists or the mand times out.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745673998a4639574.html
评论列表(0条)