帮助! Sikuli单元测试无法运行
我无法在 xp 窗口中运行任何单元测试?
IDE 可以正常运行。我在编辑器中编写了简单的示例单元测试脚本,如下所示:
def testHelloWorld(self):
print("Hello World!")
但单元测试窗口中没有显示任何测试。单击“单元测试”窗格的“运行”按钮时,没有任何反应,并且 IDE 窗口消失,除了重新启动 IDE 之外没有其他方法可以返回到该窗口。
这个问题困扰了我好几天了,如果有人能帮我解决这个问题,那就太好了!
非常感谢。
珍妮特
I couldn't run any unit tests either in the window xp?
The IDE is functional. I write the simple example unit test script in the editor, as follow:
def testHelloWorld(self):
print("Hello World!")
but no test shows up in the unit test window. When clicking the Run button of the Unit test pane, nothing happens, and the IDE window dissappears, there is no way to get back to it other than restarting the IDE.
It had stucked me for several days, that would be preciate if anyone can help me solve this problem!
Thank you very much.
Janet
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要运行单元测试,您必须有一个setUp 方法、一个tearDown 方法以及一个或多个名称以“test”开头的测试方法。他们每个人都以自我为第一论点。
这是您可以使用的模型。这是 Windows 计算器的示例测试(未测试):
这是一个更完整的单元测试示例,但它是为 Sikuli 0.9 编写的,因此许多 Sikuli 方法(单击、查找等)与当前版本不同西库利。但单元测试方法都在那里(setUp、tearDown、test*):
http://sikuli.org/documentation.shtml#examples/TestJEdit.sikuli /TestJEdit.html
To run a unit test, you must have a setUp method, a tearDown method, and one or more test methods whose names begin with "test". Each of them takes self as their first argument.
Here is a mock-up you can use. It's an example test for the Windows Calculator (not tested):
Here's a fuller example of a unit test, but it was written for Sikuli 0.9, so many of the Sikuli methods (click, find, etc.) are different from the current version of Sikuli. But the unit testing methods are all there (setUp, tearDown, test*):
http://sikuli.org/documentation.shtml#examples/TestJEdit.sikuli/TestJEdit.html