【发布时间】:2021-01-02 17:41:06
【问题描述】:
开始掌握 mocha 但我不明白的一件事,在下面的代码中
describe('03 Test recent recipe test', () => {
it('Test search async', async () => {
await driver.wait(until.elementLocated(By.name('selectit')));
var recipeName = driver.findElement(By.name('selectit')).getText();
driver.findElement(By.name('selectit')).click();
await driver.wait(until.elementLocated(By.id('name')));
var recipeLabel = driver.findElement(By.id('name')).getText();
await console.log(recipeName + " - " + recipeLabel);
expect(recipeName).to.contain(recipeLabel);
});
});
此测试作为通过返回,但 console.log 输出 - [object Promise] - [object Promise] 为什么会这样,expect 测试很高兴他们匹配
【问题讨论】: