Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

by.model should not be restricted to 'input' elements #321

Closed
juliemr opened this issue Dec 4, 2013 · 3 comments
Closed

by.model should not be restricted to 'input' elements #321

juliemr opened this issue Dec 4, 2013 · 3 comments
Milestone

Comments

@juliemr
Copy link
Member

juliemr commented Dec 4, 2013

At the moment, by.model matches input elements with ng-model, but nothing else using ng-model. It makes more sense semantically to match anything. The potential downside is that if you have an input and (e.g.) select with the same model, by.model becomes ambiguous. Is this an important distinction for anyone?

@gingermusketeer
Copy link

Is there a way to narrow the scope of the selector? I seem to recall using from karma which would select a subset of the dom for the input selectors to match within.

@juliemr
Copy link
Member Author

juliemr commented Dec 6, 2013

Yes - you can chain with

element(by.id('foo')).findElement(by.model('bar'));

@manojkumarvizury
Copy link

element(by.model('mymodel')).getText() for a textarea returns empty string whereas
element(by.model('mymodel')).getAttribute('value') returns the text inside a textarea.
why is that?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants