【问题标题】:How to report custom message in protractor report?如何在量角器报告中报告自定义消息?
【发布时间】:2019-02-04 13:38:18
【问题描述】:

我正在使用带有 Jasmine 框架的量角器工具来编写自动化脚本。

当元素未出现在页面中时,出现“等待 3000 毫秒后超时”错误。这条消息看起来很笼统。因此,我想报告一条自定义消息,例如:“页面加载后 5 秒内元素未显示。因此,终止脚本的执行。”。

谁能帮我在报告中添加自定义消息?

【问题讨论】:

    标签: jasmine protractor


    【解决方案1】:

    browser.wait 函数允许您为自定义日志消息传递附加参数,请参阅api documentation

    browser.wait(element, 5 * 1000, 'The element was not showed up for 5 seconds after the page loading. Hence, terminating the execution of the script.');
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-05-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-27
      • 2015-06-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多