PDA

View Full Version : GridPanel: Assigining class names to columns for Selenium testing



ayqazi
24 Feb 2011, 8:41 AM
Hi,

So here is my problem: I want to use a Selenium test to make sure stuff can be seen and edited the way I want it in a GridPanel.

I don't want my tests to be dependent on the order in which columns are displayed, in case I want to change the order around at any time. So I'd like to assign a custom class name to all cells in a particular column.

I can't figure out how to do this from the docs here (http://dev.sencha.com/deploy/dev/docs/?class=Ext.grid.Column), can someone point me in the right direction?

Eventually, I'd like to use a CSS selector such as (all of the below currently works fine, except the .custom_field_name class selector):

.x-grid3-body .x-grid3-row:nth-child(1) .custom_field_name .x-grid3-cell-inner

Thanks

Condor
24 Feb 2011, 8:58 AM
Give your columns an 'id' (which is also useful when you are using a state manager) and test for .x-grid3-col-{id}

ayqazi
24 Feb 2011, 9:16 AM
That works great, thanks