1<input type="button" value="set color" ng-click="myStyle={color:'red'}">
2<input type="button" value="set background" ng-click="myStyle={'background-color':'blue'}">
3<input type="button" value="clear" ng-click="myStyle={}">
4<br/>
5<span ng-style="myStyle">Sample Text</span>
6<pre>myStyle={{myStyle}}</pre>
1var colorSpan = element(by.css('span'));
2
3it('should check ng-style', function() {
4 expect(colorSpan.getCssValue('color')).toMatch(/rgba\(0, 0, 0, 1\)|rgb\(0, 0, 0\)/);
5 element(by.css('input[value=\'set color\']')).click();
6 expect(colorSpan.getCssValue('color')).toMatch(/rgba\(255, 0, 0, 1\)|rgb\(255, 0, 0\)/);
7 element(by.css('input[value=clear]')).click();
8 expect(colorSpan.getCssValue('color')).toMatch(/rgba\(0, 0, 0, 1\)|rgb\(0, 0, 0\)/);
9});