We love the Siesta recorder, but one of the downsides is that it doesn't always pick the best identifiers for elements within our app.
We can change them individually, but I'd like a way for the "best" way to persist when next recording.
Is there a feature like this in Siesta? Alternatively, where is the best place to look to add this functionality? Ideally, I want to be able to do something like:
harnesss.configure({
recorder: new Opsview.Recorder
});
Then have:
Opsview.Recorder:
extends: Siesta.Recorder
recognizerFilter: function( targetArray ) {
// targetArray is the list of targets that fills the target/value column in the recorder
// Add custom logic that sees if a certain target is used, to unshift at the beginning a preferred item, eg: ">> #navmenu"
return targetArray
}
So that means we can keep updating recognizerFilter to add preferred targets.
I've had a play with this. The getPossibleTargets() function is correctly called and I can access the target and the list of targets from the super class. However, the targets doesn't include any component query targets, so I think there's been a regression.
Using siesta 4.1.0, I get 4 targets for our menu button, which are:
* #toptoolbarmain #menumain => .x-btn-icon-el
* >>#toptoolbarmain #menumain
* .menumain .x-btn-icon-el.x-btn-glyph
* 837,11
However, with the nightly siesta-2016-06-14-standard, I only get the last two.
Furthermore, the Ext Component Inspector does not return anything and throws this error in the web console: "Uncaught TypeError: e.recorder.extractor.findComponentQueryFor is not a function". So I suspect something got broken in this change.