代码之家  ›  专栏  ›  技术社区  ›  Naresh Renukuntla

如何在剧作家端到端测试中禁用electron.lauch()上的devtools

  •  0
  • Naresh Renukuntla  · 技术社区  · 3 年前

    Playwright electronApp.firstWindow()有时返回DevTools窗口,有时返回实际的主窗口。

    如果返回DevTools窗口,测试将无限期地等待选择器。

    错误:expect(received).toContain(expected)//indexOf

    Expected substring: "ecommerce"
    Received string:    "DevTools"
    
      23 |   });
      24 |   test('App launches and quits', async () => {
    > 25 |     await expect(await page.title()).toContain('ecommerce');
         |                                      ^
      26 |   });
    
    0 回复  |  直到 3 年前