test.beforeAll(async ({ page }) => {
// Go to the starting url before each test.
await page.goto('https://my.start.url/');
});
Run Code Online (Sandbox Code Playgroud)
playwright-test runner 中有没有一种很好的方法来设置浏览器并导航到与页面对象相关的页面以运行该文件中的测试?
如果可能的话,我想避免为每个人做这个“test.beforeEach”。目前在剧作家测试中不可能做到这一点,但在开玩笑中是可能的。有任何想法吗?
Property 'page' does not exist on type 'PlaywrightWorkerArgs & PlaywrightWorkerOptions'.
Run Code Online (Sandbox Code Playgroud)