如何调试 uiveri5 测试?

How to debug a uiveri5 test?

我正在逐字跟踪 the docs,即我的 Basic.spec.jsuiveri5 --debug 开始(使用默认的本地浏览器)并在某些 it() 在测试代码中。然而,测试一直运行,通过了该测试,并且不会在任何调试器中以任何方式停止。

conf.js:

exports.config = {
  profile: "integration",
  specs: "./*spec.js",
  baseUrl: 'http://localhost:2027/...'
};

Basic.spec.js:

describe('Basic', function () {
  it('1 should load the app', function() {
    expect(browser.getTitle()).toBe('Hurz,');
  });
  it('2 should open detail screen', function() {
    debugger;
    element(by.control({viewName: ..., id: ...})).click();
    let name = element(by.control({viewName: ..., id: ...}));
    expect(name.getText()).toBe("");
  });
})

控制台:

$ uiveri5 --debug
Starting uiveri5 with node arguments --inspect
Debugger listening on ws://127.0.0.1:9229/2584e64b-5d72-41f1-99ea-a51c8f073245
For help, see: https://nodejs.org/en/docs/inspector
INFO: @ui5/uiveri5 v1.41.2
INFO: Resolving specs
INFO: Check for latest major version of: chromedriver
(node:55071) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
INFO: Found latest major version of chromedriver: 79
INFO: Check for latest version of: chromedriver
INFO: Found latest version of chromedriver: 79.0.3945.36
INFO: Found correct binary locally: /usr/local/lib/node_modules/@ui5/uiveri5/selenium/chromedriver-79.0.3945.36
INFO: Executing 1 specs
[15:34:04] I/launcher - Running 1 instances of WebDriver
INFO: Suite started: Basic
INFO: Spec started: 1 should load the app
INFO: Opening: http://localhost:2027/...
INFO: UI5 Timestamp: 201910301504
INFO: Spec finished: 1 should load the app with status: PASSED
INFO: Spec started: 2 should open detail screen
INFO: Spec finished: 2 should open detail screen with status: PASSED
...

我错过了什么?

  • 转到 chrome://inspect/#devices
  • 单击打开专用的 Node DevTools
  • 和运行 uiveri5 --debug 或 --inspect

文档中有更多参考资料here (UIveri5) and here (Node)