小编eln*_*ggs的帖子

使用 test.BeforeAll 转到剧作家测试运行程序的页面 URL

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)

javascript playwright

8
推荐指数
3
解决办法
2万
查看次数

标签 统计

javascript ×1

playwright ×1