How to target controls bound actions in integration tests


#1

I feel blessed that in Ember I no longer need to add js specific class names in my templates in order to bind elements to actions. But I’ve noticed that this makes targeting action bound elements in tests much more difficult. How do others solve this problem?

For instance given the following template:

{{input value=title}}
<button {{action 'save'}}>Save</button>
<button {{action 'cancel}}>Cancel</button>

How should I target these controls in my tests?

test('create post', function() {
  visit('/posts/new');
  fillIn('input', 'My new post');
  click('button');

  andThen(function() {
    //...
  });
});

Hoping there’s a better way than to add classes to these inputs simply for testing purposes.