Does anyone use Extjs 4 and JsTest Driver for testing

131 views
Skip to first unread message

Marcelo Galli

unread,
Feb 29, 2012, 10:33:53 PM2/29/12
to js-test...@googlegroups.com
Hi All,

I am starting a project and I intent to use Extjs4 and jsTeste Driver.

Does anyone used it and could share some docs or references?

Thanks

eddyystop

unread,
Mar 22, 2012, 4:08:47 PM3/22/12
to JsTestDriver
I'm in the same situation.

Burke

unread,
Mar 23, 2012, 1:08:08 PM3/23/12
to JsTestDriver
We have a pretty substantial Ext2 and Ext4 codebase and use
JsTestDriver for our tests. It's worked out great so far. I can't
think of anything that would be Ext-specific, but here are a few
things we do:

- when testing a Ext.Component, we typically will render the component
and then try to trigger events and callbacks as if the user was
interacting with the component.

- a nice way to create your objects or components in your tests is to
have a method that takes a config:

_buildCmp: function(config) {
return Ext.create('My.cool.Component', Ext.merge({
renderTo: Ext.getBody().dom
}, config));
}

this gives you the ability to setup a default set of config options
for your test, and then each test method can override as needed.

- don't forget to destroy your component:

'test component should fire event': function() {
this.cmp = this._buildCmp({ ..... });
// test stuff here
},

tearDown: function() {
Ext.destroy(this.cmp);
}

- if you need stub/mock/spy capability, check out SinonJS
(sinonjs.org). We use it extensively and it has a great integration
with the TestCase object.

Here are a few recent blog posts we've done talking about some of this
stuff in more detail:

http://www.rallydev.com/engblog/2012/02/21/javascript-testing-render-that-component/
http://www.rallydev.com/engblog/2011/09/23/easy-mocking-in-your-javascript-tests/
http://www.rallydev.com/engblog/2012/01/31/easy-mocking-with-jstestdriver-and-sinonjs/
http://www.rallydev.com/engblog/2011/09/26/javascript-testing-best-practices/

Marcelo Galli

unread,
Mar 23, 2012, 3:40:39 PM3/23/12
to js-test...@googlegroups.com
Nice to hear it! I will take a look and study the links you sent me. 

I got Siesta for test, but I end loving it. In one week all my componets was tested and the test suite is getting bigger and until now everything is working.

I didn't have a clue how to do it in JsTestDriver and for sure you considerations opened my mind about it.

The only problem about Siesta is that is paid, but they promise it is integrated with PhantonJs and Selenium. In the next 30 days I will use it in Jenkins and let u know about my experience.

Thanks!

Marcelo

--
You received this message because you are subscribed to the Google Groups "JsTestDriver" group.
To post to this group, send email to js-test...@googlegroups.com.
To unsubscribe from this group, send email to js-test-drive...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/js-test-driver?hl=en.


Reply all
Reply to author
Forward
0 new messages