Javascript mocha的Puppeter中是否有类似于TestNG中的dataProvider的功能?
我在Puppeter中寻找类似的功能,mocha作为TestNG测试框架中的数据提供者。有谁能建议如何在《木偶戏》中做到这一点。Javascript mocha的Puppeter中是否有类似于TestNG中的dataProvider的功能?,javascript,node.js,automation,puppeteer,browser-automation,Javascript,Node.js,Automation,Puppeteer,Browser Automation,我在Puppeter中寻找类似的功能,mocha作为TestNG测试框架中的数据提供者。有谁能建议如何在《木偶戏》中做到这一点。 提前感谢。在摩卡咖啡中没有内置的方法。但您可以使用简单的forEach方法轻松实现它 或者使用图书馆 顺便说一句,你可以很容易地做到 const SITES = ['https://github.com', 'https://google.com']; SUITES.forEach(expected => { describe('Suites:',
提前感谢。在摩卡咖啡中没有内置的方法。但您可以使用简单的forEach方法轻松实现它 或者使用图书馆 顺便说一句,你可以很容易地做到
const SITES = ['https://github.com', 'https://google.com'];
SUITES.forEach(expected => {
describe('Suites:', () => {
it(`go to the ${expected} url`, => async () {
await page.goto(expected);
});
});
});