Ext Js Pathfinder progress report #3

3rd progress report is under way. So far Ext Js Pathfinder can interact in a limited way with textfields and buttons. But what is it good for, if it lacks a handy set of assertions?

Writing ‘classic’ assertions in testing websites usually amounts to few things:

  • asserting site’s title is equal to some expected value
  • asserting element is present
  • asserting element is visible
  • asserting element is enabled
  • asserting on any element’s properties

First assertion is nothing specific to Ext Js, so I would not bother. One can easily check this one using CasperJs:

casper.test.assert(this.getTitle() == 'Ext JS Kitchen Sink - Basic Buttons', 'Unexpected page title');

Second is easy to already using functions that are already present in Ext Js Pathfinder:

var buttons = pathfinderObj.find('button');
casper.test.assert(buttons.length > 0, 'Buttons should be found');

Latter three are not so easy to check. I remind that we do not deal with HTML tags in Ext Js applications, only with components. Therefore, such assertions must refer to components.

Fortunately, they have rich API that will do most things for us. For now, I implemented simple wrappers for checking component’s visibility and whether it is enabled or not. Usage:

var buttons = pathfinderObj.find('button');
casper.test.assert(buttons.length > 0, 'Buttons should be found');

var firstButton = buttons[buttons.length - 1];


…and that’s it for now.

Probably there will be no new features next week due to expanding duplication in Pathfinder’s codebase and relying on Ext Js example pages instead of own implementations. Nonetheless, stay tuned.



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.