How to debug a uiveri5 test?

守給你的承諾、 提交于 2021-01-28 14:30:45

问题


I am following the docs word by word, i.e. start my Basic.spec.js with uiveri5 --debug (using default local browser) and have a debugger; statement within some it() in the test code. Yet the tests runs thru, passing that test, and will not stop in any way in any debugger.

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("");
  });
})

Console:

$ 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
...

What am I missing?


回答1:


  • go to chrome://inspect/#devices
  • click open dedicated DevTools for Node
  • and run uiveri5 --debug or --inspect

more reference is in the documentation here (UIveri5) and here (Node)



来源:https://stackoverflow.com/questions/59898696/how-to-debug-a-uiveri5-test

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!