'use strict';

/* https://github.com/angular/protractor/blob/master/docs/toc.md */

describe('my app', function() {

  browser.get('index.html');

  it('should automatically redirect to /view1 when location hash/fragment is empty', function() {
    expect(browser.getLocationAbsUrl()).toMatch("/view1");
  });


  describe('view1', function() {

    beforeEach(function() {
      browser.get('index.html#/view1');
    });


    it('should render view1 when user navigates to /view1', function() {
      expect(element.all(by.css('[ng-view] p')).first().getText()).
        toMatch(/partial for view 1/);
    });

  });


  describe('view2', function() {

    beforeEach(function() {
      browser.get('index.html#/view2');
    });


    it('should render view2 when user navigates to /view2', function() {
      expect(element.all(by.css('[ng-view] p')).first().getText()).
        toMatch(/partial for view 2/);
    });

  });
});

@@ -1,8 +1,103 @@
+/* global describe, it, expect, beforeEach, afterEach, module, inject, browser, element, by */%0A
 'use str
@@ -1006,22 +1006,224 @@
 );%0A    %7D);%0A%0A
+    it('should fire View2Ctrl when user navigates to /view2', function() %7B%0A      expect(element.all(by.css('%5Bng-view%5D p:nth-child(2)')).first().getText()).%0A        toMatch(/hey this is ctrl2/);%0A    %7D);%0A
   %7D);%0A%7D);%0A

Add one e2e test