UI-Element Release 0.4
I’ve been quietly releasing some minor bugfixes for UI-Element. The release today adds a keys() method intended to simplify defining defaultValues for UI-Elements. It returns the keys of an object as a list of strings.
Also, elements defined with a leading underscore will not be considered as bona fide UI elements. This is to facilitate usage of locally “scoped” variables within the UI-Element definitions. For example:
// the regexp for the current pageset var storePages = 'store/.*'; // define variable specific to the UI elements for this // pageset myMap[storePages]._labelMap = { 'Shipping Info': 'shipinfo.php' , 'FAQ': 'faq.php' , 'Returns': 'returns.php' , 'Contact': 'custserv.php' }; myMap[storePages]['sidebar_link'] = { description: 'sidebar link to a section of the store', args: [ { name: 'label', description: 'the label of the link', defaultValues: keys(myMap[storePages]._labelMap) } ], getXPath: function(args) { var label = args['label']; label = myMap[storePages]._labelMap[label]; return "//ul[@id='sidebar']/descendant::a" + "[contains(@href, '" + label + "')]"; } };
I’m also making the test package available. It contains the Selenium IDE unit tests. Download links:
selenium-ide-0.8.7-ui-0.4.xpi
selenium-ide-0.8.7-ui-0.4-test.xpi