Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Testing and documentation for Ext.js?

Tags:

extjs

extjs4

How do I test and document my Ext.js code? Can't find any information on their webpage.

like image 791
ajsie Avatar asked Mar 11 '26 05:03

ajsie


1 Answers

Documentation

To generate Ext JS documentation, you can use any JavaScript documentation tool like JSDoc. There are also two Ext related documentation tools available: Ext-doc and JsDuck.

Testing

To test your Ext JS frontend you have different options:

For unit testing, there is the excellent Jasmin behavior-driven development framework available, which is used to test your JavaScript in isolation. It offers many functionality like matchers, spies, mocks and clock handling. I suggest to use the API documentation, since it offers more information that the main site.

Sencha itself is using Jasmine, you can see the core tests in src/core/test/unit/spec. They even released a headless spec runner based on webkit: Headless Testing for Continuous Integration with Git and Jasmine

For acceptance testing, you can basically use any acceptance testing tool like HTMLUnit or Selenium.

I personally use Capybara with the Selenium webdriver, but the advantage of Capybara is that there exists many other drivers for other technologies: capybara-webkit, Akephalos (uses HTMLUnit), Capybara-zombie, Capybara-phantomjs to name just a few.

The advantage of Selenium webdriver is, that it remote controls Firefox and it thus supports everything Firefox does. The other drivers are all meant for headless testing and are faster than Selenium but don't support the same range of functionality. I regularly try every available driver for my growing test suite, but I always end with Selenium again.

Depending on your needs, you can stack Cucumber on top of Capybara, which uses test features written in a business-readable domain-specific language.

For testing your code automatically on file modification, I suggest you to try out Guard which has testing specific guards like Guard Jasmine headless webkit and Guard Cucumber and Guard Rspec for running Capybara tests.

like image 151
Netzpirat Avatar answered Mar 12 '26 21:03

Netzpirat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!