I'm using AngularJs 1.6 and protractor to do e2e tests.
I have the following code in my HTML template
<h1>{{exercise.a}} * {{exercise.b}}</h1>
Then in protractor I'm testing the page and want to get value of that bindings. I do
element(by.binding('exercise.a')).getText().then(console.log)
and the result is combination of exercise.a
and exercise.b
i.e. '9 * 2'
while I expect the result to be '9'
. I get exactly the same result is when I try to get value of exercise.b
i.e. '9 * 2'
while I expect '2'
.
It took me a while to find a workaround. After I modifies my code to this it start working properly
<h1><span>{{exercise.a}}</span> * <span>{{exercise.b}}</span></h1>
It seems that something combines both bindings to one.
Could anybody explain why it happens and how to make it work without workaround.