Edit in Plunker
<script>
  angular.module('windowExample', [])
    .controller('ExampleController', ['$scope', '$window', function ($scope, $window) {
      $scope.greeting = 'Hello, World!';
      $scope.doGreeting = function(greeting) {
        $window.alert(greeting);
      };
    }]);
</script>
<div ng-controller="ExampleController">
  <input type="text" ng-model="greeting" />
  <button ng-click="doGreeting(greeting)">ALERT</button>
</div>
it('should display the greeting in the input box', function() {
 element(by.model('greeting')).sendKeys('Hello, E2E Tests');
 // If we click the button it will block the test runner
 // element(':button').click();
});
; $http.get("test_data.json", {cache: $templateCache}).success(function(userComments) { self.userComments = userComments; }); self.explicitlyTrustedHtml = $sce.trustAsHtml( '<span onmouseover="this.textContent="Explicitly trusted HTML bypasses ' + 'sanitization."">Hover over this text.</span>'); });
[
{ "name": "Alice",
  "htmlComment":
      "<span onmouseover='this.textContent=\"PWN3D!\"'>Is <i>anyone</i> reading this?</span>"
},
{ "name": "Bob",
  "htmlComment": "<i>Yes!</i>  Am I the only other one?"
}
]
describe('SCE doc demo', function() {
it('should sanitize untrusted values', function() {
  expect(element.all(by.css('.htmlComment')).first().getInnerHtml())
      .toBe('<span>Is <i>anyone</i> reading this?</span>');
});

it('should NOT sanitize explicitly trusted values', function() {
  expect(element(by.id('explicitlyTrustedHtml')).getInnerHtml()).toBe(
      '<span onmouseover="this.textContent="Explicitly trusted HTML bypasses ' +
      'sanitization."">Hover over this text.</span>');
});
});
;StopFight</button> <button type="button" data-ng-click="resetFight()">resetFight</button> </div> </div> 39;, function() { invalidJsonpBtn.click(); fetchBtn.click(); expect(status.getText()).toMatch('0'); expect(data.getText()).toMatch('Request failed'); });