layerId naming conventions and WebDriver port

26 views
Skip to first unread message

BrandonK

unread,
Feb 7, 2012, 8:13:48 PM2/7/12
to lebowskifw
Hello,
I've two questions to discuss.

1) When using Lebowski, I've found it much simpler when the SproutCore
element has the layerId field set.

For instance, to access the password field on a login page, before I
would have:
@password =
self.child_views.first('SC.FormView').child_views[2,'SC.FormRowView'].child_views[1,'SC.TextFieldView']

Once you have a layerId set though, you have:
@password = App['#loginPassword']

While this is much simpler, you now have an additional problem. Now
you need to provide that layerId label for each element that you care
about. It needs to be unique and ideally it would be something
meaningful.

I was wondering if anyone has any rules of thumbs for uniquely naming
their SproutCore elements while still maintaining readability.

I found this snippet of code that purportedly will automatically fill
in the layerId for you:

http://martinottenwaelter.fr/2010/01/testing-and-auto-generated-ids-in-sproutcore/

Has anyone tried this, and if so were there any issues? I'm a bit wary
to try it as the code creates labels with '.' notation, and I've had
issues with Lebowski being able to handle labels with '.' in them in
the past.

2) Previously, MikeC mentioned that he was working on a port for
Lebowski to use WebDriver. This in turn would allow using Selenium 2
to interact with the latest Browsers that are most needed for test
coverage. He also tentatively mentioned a January/February release
date. I know it's not quite the end of February and I should be
patient, but is there any update on this? Is there anything that I or
the community can do to help? Is there perhaps a git project we can
take a look at?

Michael Cohen

unread,
Feb 8, 2012, 2:17:45 PM2/8/12
to lebow...@googlegroups.com
Hey Brandon,

While you can set a view's layer ID to be whatever you'd like, my personal preference it to leave the layer IDs alone and instead make use of SproutCore's page and outlet features in order to access views that are deeply nested. Use of SC.Page provides a nice way of modularizing features into logical groups and let's you use SC.outlet to create simple paths to views within the page. In addition, the pages provide a way of name spacing the views. Example:

// In your SproutCore app
MyApp.fooPage = SC.Page.create({


});

// In Lebowski
@some_view = app['fooPage.someView']

The only thing required is simply updating your SC app code to contain the outlets.

Regarding the migration of Lebowski over to WebDriver, work is being done and I've made a lot of progress; however, other priorities pop up that I need to address that happen to put Lebowski development efforts on hold. I don't have any control over this, but work on  Lebowski will resume. At this point I can't provide any details of when the migration effort will be complete as things keep popping up that warrant my attention. Sadly there's only one of me running around trying to juggle a bunch of different projects :-/.

-Mike
Reply all
Reply to author
Forward
0 new messages