Get help with testing, discuss unit testing strategies etc.


Post by tonvoon »

Hi!

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.

Ton

Post by mats »

this will be part of the next release :)

Post by tonvoon »

Mats,

That sounds great. Was it already done and not documented? Is it in the nightly build?

I'm happy to try the feature out and write up some sample documentation.

Ton

Post by mats »

Yep, look at examples/ advanced, open it as a separate suite and you see custom recorder demo in it. Any feedback would be very nice :)

Post by tonvoon »

Mats,

I just had a quick look at the latest build. This looks like exactly what I was hoping for. Thank you.

I will give it a spin and let you know.

Ton

Post by mats »

Cool, great to hear :) Please send all your feedback our way and we'll try to improve!

Post by tonvoon »

Mats,

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.

Is there anything else I can help with?

Ton

Post by mats »

Hm, all looks good here. Can you please zip up a proper test case for us?

Post by tonvoon »

Mats,

I've sent an email to info@bryntum with recreation steps of a publicly available server.

The issue only occurs when the recorderClass is specified, so I think it is related to the changes made for that feature.

Ton

Post by tonvoon »

It turns out that I subclassed the wrong class. In case anyone else comes across this, the change was:
-    isa     : Siesta.Recorder.Recorder,
+    isa     : Siesta.Recorder.ExtJS,
Then the ExtJS components are recorded correctly. Thanks to Mats for pointing it out.

Post Reply