运行jasmine和selenium-webdriver测试时出错

Error when running jasmine and selenium-webdriver based tests

本文关键字:出错 测试 selenium-webdriver jasmine 运行      更新时间:2023-09-26

我正在使用selenium webdriver和jasmine为我的网站创建一些端到端测试。我试着寻找好的初学者教程。我最终得到了这个教程,它帮助我进步,直到运行端到端测试的步骤。我试着按照教程中描述的方式来做,包括相同的目录名。我使用Chrome浏览器并安装了chromedriver。当我使用

运行测试时
$ jasmine spec'integration-test.js
如前所述,我得到一堆超时错误,如下所示。它还打开了两个Chrome窗口,data:,作为URL。我花了些时间想弄明白,但似乎毫无进展。任何帮助都会很感激。如果需要更多的信息,请告诉我。
Started
FF
Failures:
1) Selenium Tutorial Should be on the home page
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)
2) Selenium Tutorial Has a working nav
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)

将此添加到您的jasmine配置中:(根据需要增加)

"default_timeout_interval": 5000