开发者

testing source application in qooxdoo

开发者 https://www.devze.com 2022-12-16 09:21 出处:网络
I began to use Qooxdoo the last month so i\'ve got very little experience in its usage. I need to create a test application like the testrunner on the Qooxdoo website, but i need to do tests inside my

I began to use Qooxdoo the last month so i've got very little experience in its usage. I need to create a test application like the testrunner on the Qooxdoo website, but i need to do tests inside my application environment. I followed these steps:

  • Created the application
  • Compiled the source version with generate.py source
  • Create the test with generate.py test

In this test if i try to access my application it gives me an error because its undefined.

Then reading the documentation on the website i've found that this type of tests must be done using generate.py test-source. But running the index-source.html in the test folder the result is the same: the application is not working.

What is the right way to this? What did I do 开发者_开发问答wrong?


Using generate.py test or generate.py test-source create a testrunner for you application, like the one you have seen on the qooxdoo website. But your own testrunner contains every test you wrote in the test namespace of your application.

The testrunner is mainly designed for unit tests, which means testing single, small pieces of an application. For example if you have some kind of data manipulating object, you can easily test that by creating on of those objects like you do in the your application code. The same is true for not that small objects like your application. You can create an instance of your application in a unit test and access the methods on that application as well:

var app = new customNamespace.Application();
this.assertTrue(app.yourMethodName());

But if you really need to test the whole application at once, Selenium [1] could be a better choice. qooxdoo offers a users a Selenium user extension for easier handling qooxdoo applications.

[1] http://seleniumhq.org/

[2] http://qooxdoo.org/contrib/project/simulator

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号