【发布时间】:2023-01-13 03:43:15
【问题描述】:
当等待单个 Locator 可见时,这可以使用简单的 expect().toBeVisible() 但我将如何等待多个独立定位器同时可见?
在下面的示例中,el1 最初可能是可见的,但在等待 el2 可见时,el2 可能不再可见,我想确保这两个元素同时可见。
test('visible', async ({page}) => {
const el1 = page.locator('.el1');
const el2 = page.locator('.el2');
await expect(el1).toBeVisible();
await expect(el2).toBeVisible();
});
【问题讨论】:
标签: playwright