我正在尝试为 BDD 做夜班和黄瓜集成。我无法在 step 函数中访问 client.elements 函数。
const { client } = require('nightwatch-api');
const { Given, Then, When } = require('cucumber');
const homePage = client.page.homepage();
Then(/^click "([^"]*)" service from list$/, async(service) => {
let result = await client.url('http://localhost:8080/').elements('css selector', 'div.flex.mt-4.v-card.v-sheet.theme--light > div > div > table > tbody > tr');
console.log(" col length is " + "<->" + result.value.length);
return homePage;
});
任何帮助表示赞赏。谢谢!