【问题标题】:What is untrackOutstandingTimeouts setting for in Protractor?量角器中的 untrackOutstandingTimeouts 设置是什么?
【发布时间】:2017-01-21 06:22:48
【问题描述】:

在量角器参考配置中,提到了untrackOutstandingTimeouts setting

// Protractor will track outstanding $timeouts by default, and report them in 
// the error message if Protractor fails to synchronize with Angular in time. 
// In order to do this Protractor needs to decorate $timeout. 
// CAUTION: If your app decorates $timeout, you must turn on this flag. This 
// is false by default.
untrackOutstandingTimeouts: false,

我从未见过有人更改设置。该设置的实际用途是什么?什么时候应该设置为true

【问题讨论】:

    标签: javascript angularjs testing automation protractor


    【解决方案1】:

    跟踪未完成的超时,以便 Protractor 错误可以报告它们。如果您关闭它,您将不会在错误中获得超时信息。

    但是,如果您装饰 $timeout 对象(无论出于何种原因需要装饰它),您可能需要将其关闭,因为 Protractor 也会装饰相同的对象,您不会看到对它的更改每当您需要它们时。

    这是应用户请求添加的here

    【讨论】:

      【解决方案2】:

      untrackOutstandingTimeouts:true 适用于 $timeout,也可能适用于 $interval(我不确定)

      Simulate the passage of time in protractor?

      【讨论】:

        【解决方案3】:

        这是该问题的官方FAQ。它与@Vlad 的答案在同一行。

        【讨论】:

          猜你喜欢
          • 2015-05-02
          • 2017-05-20
          • 2016-09-15
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2015-02-01
          • 2015-06-16
          相关资源
          最近更新 更多