我正在尝试使用 for 循环多次执行测试。Playwright Testrunner 没有在 for 循环中识别测试。它给出消息“未找到测试”。
示例代码。
test.describe("功能:执行脚本", async() => {
test.beforeEach(({ page }) => {
landingpage = new Landingpage(page);
});
const dm = 2;
for (let i = 1; i <= dm; i++) {
test(`Execute script multiple times`, async () => {
//test steps
console.log(i)
});
}; });