Detox by.id is not a function.

huangapple go评论99阅读模式
英文:

Detox by.id is not a function

问题

我正在使用Detox进行我的第一个测试,但遇到了以下问题:

Detox by.id is not a function.

请帮助我。

英文:

I'm working on my first test using detox but got the following problem:

Detox by.id is not a function.

Please help me.

答案1

得分: 1

抱歉,以下是翻译好的部分:

很遗憾,作为常见的JS测试运行器(例如Mocha和Jest)的包装器,当Detox在初始化时失败(即在beforeAll()中),它被迫继续尝试运行套件中的所有测试。此外,在没有适当初始化的情况下,全局对象,如bydevice甚至detox都不会被注册。因此会出现错误。

在你的情况下,重要的是滚动并查找Detox日志中提供的第一个错误。这应该给你一个关于到底出了什么问题的提示。

无论如何,在没有适当初始化的情况下,你的测试不会运行,并且需要在测试运行器的路径中包含初始化代码。请务必彻底阅读设置指南及其参考资料。

英文:

Unfortunately, being a wrapper over common JS test-runners such as Mocha and Jest, when Detox fails to initialize in (i.e. in the beforeAll()) it is forced to move forward to nevertheless try to run all tests in the suite. Also, without proper initializaion, global objects such as by, device and even detox do net get registered. Hence the error.

What matters in your case is for you to scroll and find the first error provided by Detox' logs. That should give you a hint of what really went wrong.

In any case, your tests will not run without proper initialization, and the inclusion of init code in the path for the test runner. Be sure to thoroughly go over the setup guide and its references.

huangapple
  • 本文由 发表于 2020年1月6日 23:28:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/59614740.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定