javascript - Mocha - 如何在 it 函数中使用乘法函数
问题描述
所以我一直在试图弄清楚是否有可能做这样的事情。
it('Check for remove button', function () {
element.all(by.className('btn btn-remove btn-outlined')).getText().then(function (text) {
for (var i = 0; i < text.length; i++) {
console.log(i) //Prints 0 1 2
it('Click remove button - ' + i + '/3', function (done) {
console.log("Hello") //Never prints
browser.driver
.then(() => utils.click(detailsSpecs.getRemoveButton()))
.then(() => done());
});
it('Wait for fading button to be gone', function (done) {
console.log("World") //Never prints
setTimeout(function () {
done();
}, 1000);
});
};
});
});
如您所见,我有一个代表问题的 it 函数(检查有多少元素),然后我在它本身内部有两个it函数。哪个单击,第二个已超时,但我的问题是它不想在 for 循环中输入任何一个,但是 for 循环本身可以工作,而且似乎我无法在其中包含多个它的功能。
我想知道我如何能够解决它 - 如果可以做这样的事情吗?
解决方案
推荐阅读
- tensorflow - 分类交叉熵在 keras 模型训练中作为损失和准确度度量的不同结果
- javascript - Swiper 产品滑块 Laravel jquery
- excel - 计算以“DOT”或“PRO”开头的列中的唯一过滤值
- python - 训练和验证集的图(过拟合?)
- spartacus-storefront - 带有 + 符号的 PLP 构面过滤器对导致错误结果的 URL 进行编码
- javascript - 无法在反应中解析 HOC 中的值
- entity-framework-core - 来自两个不同实体但相同视图模型类的联合
- php - 为什么 CodeIgniter 3 在 localhost 上变慢并且在服务器上正常工作
- python - 甚至在使用 selenium python 抓取数据之前,网页就已关闭
- python - 有没有办法使用 isin() 作为 pandas 数据框中另一列的计算器函数?