How it works...

In the first step, we have replaced QUnit.test with QUnit.only. This will run this test case only. During the development of the test case, this can be time-saving. Note that using QUnit.only will stop the test case from running via the command-line options. This can only be used for debugging or testing, and it can only work when you open the test case from the UI, so don't forget to replace it with QUnit.test after the development.

In our example of the QUnit test case, we have created the form view to test the int_color widget. If you run the QUnit test cases from the UI, you will learn that you are not able to see the created form views in the UI. From the UI of the QUnit suite, you are only able to see the logs. This makes developing a QUnit test case very difficult. To solve this issue, the debug parameter is used in the createView function. In the second step, we have added debug: true in the createView function. This will display the test form view in the browser. Here, you will be able to locate Document Object Model (DOM) elements via the browser debugger.

Warning: At the end of the test case, we destroy the view through the destroy() method. If you have destroyed the view, then you won't be able to see the form view in the UI, so in order to see it in the browser, remove that line during development.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset