*
* Note that this method is similar to AuraUITestingUtil's findGlobalIdForComponentWithGivenProperties() and
* getEval() methods, but these tests must be run in DEV mode where $A.test is not supported.
*/
public void clickButtonByLocalId(String localId) {
JavascriptExecutor jsExecutor = (JavascriptExecutor) testCase.getDriver();
String query = "var cmp = $A.getQueryStatement().from('component').field('globalId').field('localId')"
+ ".where(\"localId === '" + localId + "'\").query();return cmp.rows[0].globalId";
String globalId = jsExecutor.executeScript(query).toString();
jsExecutor.executeScript("$A.getCmp(\"" + globalId + "\").get('e.press').fire()");
}