<br><br>On Monday, 13 May 2013, Manuel Quiñones wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2013/5/13 Daniel Narvaez <<a href="javascript:;" onclick="_e(event, 'cvml', 'dwnarvaez@gmail.com')">dwnarvaez@gmail.com</a>>:<br>
> I'm on a phone so I have not yet taken a proper look. Though it looks pretty<br>
> cool. It seems to have custom browsers support, so it should be easy to run<br>
> it in sugar-html-activity.<br>
><br>
> We can look at hooking this up in sugar-build/buildbot, it should not be a<br>
> lot of work.<br>
><br>
> I suppose it should work for the libraries too if we just put some HTML in<br>
> the test dir.<br>
<br>
Yes the idea is to add unit tests in each of our libraries. I did it<br>
in lib/sugar-html-graphics inside clockjs code to get a first<br>
impression, but I will move it to sugar-html-graphics repository if we<br>
agree using Jasmine.</blockquote><div><br></div><div>Maybe a quick comparison with mocha (used by firefox os) would be worth it, since karma can run mocha tests too. I wouldnt spend too much time on it though.</div><div>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
So the proposal would be:<br>
<br>
- start writting unit tests with Jasmine framework</blockquote><div><br></div><div>Yes!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- add a command to sugar-build to run the tests with Karma</blockquote><div><br></div><div>Yeah, we can use the check command and run karma for the js modules.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- automate tests adding Karma to buildbot<br>
</blockquote><div><br></div><div>Which should just work if we use the check command.</div><div><br></div><div>Something else I would like to provide is a way to take screen snapshots. The tests could request the webview to generate a snapshot with a certain id (we could use an alert with a well known text, in lack of a better communication mecanism, could be done more cleanly with a plugin but probably not worth it for tests). At the end of test run, the runner w<span></span>ould compare the snapshots with those in test/snapshot and complain about differences. It's trivial to implement and should be pretty useful for testing visual stuff.</div>
<br><br>-- <br>Daniel Narvaez<br><br>