task - 赛普拉斯任务。然后不按预期工作
问题描述
我有一个问题,我需要帮助来了解会发生什么。这段代码正常工作:
tfc.logout()
.then(() => {
cy.log('Before account affectation');
cy.task('createTestAccount')
.then((acc) => {
cy.log(acc); <-- acc is not empty
account = acc;
expect(account.id).to.exist;
});
});
但是这个(在我的理解中应该是一样的不起作用):
tfc.logout()
.then(() => {
cy.log('Before account affectation');
return cy.task('createTestAccount');
})
.then((acc) => {
cy.log(acc); <---- acc is null
account = acc;
expect(account.id).to.exist;
});
任何帮助,将不胜感激
解决方案
推荐阅读
- objective-c - 如何使用任何东西在数组或字典中查找对象
- android-studio - 无法解析 transition-1.0.0.aar (androidx.transition:transition:1.0.0)
- kubernetes - Kubernetes - DNS/核心 DNS 问题 - 公共域无法解决
- oracle - 在不考虑时间的情况下,Oracle 以天为单位的日期之间的差异
- amazon-web-services - 使用 boto3 从 Amazon S3 存储桶前缀中获取 n 个最后修改的对象
- asp.net-mvc - NonFactors.Mvc.Grid 是否有持久选择方式
- python - 如果字典的键相同,如何添加字典列表的值(列表)?
- window - SQL 中是否有一个函数可以帮助计算每个注册日期、最后一个设备、3 天内的用户数量和用户销售数量
- python - etree.tostring 返回一个带有一些命名空间的字符串
- java - Spring-Security 5.0.0 无状态会话