Skip to main content

Posts

Showing posts from August, 2015

Tickling with tests

Hello everyone, So finally we have been at the end of the project and I really enjoyed each and every part of it. So after unit testing the transform its time to write functional tests and integration tests or we can say the browser tests for our add-on. I have written the functional tests to ensure that the new add-on is imported and all the profiles are installed and the editor is using our new transform and not the old transform. So for that we have already implemented the registration of new add-on to replace it with old one and we also have to make tinyMCE uses our new transform. How to make tinyMCE uses our new transform in place of old transfrom ? So for understanding that we should have the idea how tinyMCE calls for the transform script. So it uses getToolByName in portal_transform to get the required transform. So tinyMCE search for safe_html in portal_transform and the old transform was named safe_html. So here we had two ways to proceed :- 1) Either change tinyMCE

Testing the transform

Hello everyone, now the transform for filtering html is ready and the main task is to test the transform. For that purpose I have set up the whole test environment for my add-on using testing.py for unit tests and robot tests. After setting up the environment, now its time to first write unit test for transform that we have just created to check if they are all passing and the transform is working properly or not. For creating unit test I first created test class and in that class I just call the convert function that we have created in the transform and give the input as a data stream and pass it to convert function and then get the output as required. After writing few simple test cases like 30-35 then just ran these test cases and they ran successfully. Test cases ran successfully locally :- Travis is also happy ;) Yayayay!!! Finally test cases were passing so its like a milestone for the project and its completed. The PR got merged and things working good as expect