I have a bunch of views that are built up via render: function(), but
they are really basic things. For example, one of them is simply 3
divs pushed into the view.
e.g. context.push("<div data-type='a' class= 'z'><img src
='somepath'></img></div>")
I want to quickly access stuff inside without building out the proxys
(mostly because I tried my hand at the proxys and failed miserably) so
I tried something like this
PickerPaneView = App['mainPage.downloader.contentView.picker']
at this point in SC the picker is
'picker:MyApp.myCustomView.design({ contentBinding: blahblah });
I want to be able to say PickerPaneView.data-type.'a'.click or
something. Basically, some way to access the div and click on it. I
tried doing something like PickerPaneView.childViews[0].click etc but
that doesn't work.
This is a reoccurring problem for me where I get really simple views
given to me, but they have the context.push to do something really
basic. Another example is this one
context.push(
'<div class="align">',
'<div class="name"><span class="click">%@</span></
div>'.fmt(title1),
'<div class="date"><span class="click">%@</span></
div>'.fmt(value2),
'<div class="clickable"></div>',
'</div>'
);
and I just want to be able to click on those specific divs. I tried
writing a custom view like here,
https://github.com/FrozenCanuck/Lebowski/blob/master/examples/custom_view/spec/custom_view.rb
for the second one (with a view with two divs that represent nothing
more than name/date) so I could click on them, and it was a mess. Is
there some way to just utilize core_query from the top level and say
"core_query('some div or class property')[0].click" ? I have atleast
30 views that are nothing more than 1-2 divs/spans with a single
string in them, and making proxy views for these seem cumbersome and
mostly pointless. That could also be frustrating speaking. Note I
don't control the SC code given to me, and cannot alter that code at
all. I'm just trying to automate testing of it.
Any guidance would be appreciated