OK... I have this working:
.eval("window.dijit.registry.byId('MI1').id")
.then(function(id) {
console.log("Checking Menu Item ID: "+ id);
assert(id == "MI1", "The menu item did not have the expected ID");
})
However, I've noticed that the eval only works when it is returning a String. For example, I'd also like to be able to call ".setValue()" on a widget but this doesn't seem to work. In fact anything that returns an object seems to generate an error.