title: e2e testing in angularjs for page navigation
body: <p>I am writing e2e tests for my web app and stuck at the very beginning. I would appreciate any help to kick start my testing experience.</p>
  
  <p>I am completely new to angularjs. So please bear with me.</p>
  
  <p>I want to write a test that will check if we are on the landing page of the app. I am using jasmine and karma. </p>
  
  <p>here is my config file
          // Karma configuration</p>
  
  <pre><code>    module.exports = function(config) {
        config.set({
      // base path, that will be used to resolve files and exclude
          basePath: '../',
      // frameworks to use
          frameworks: ['jasmine'],
  
  
          // list of files / patterns to load in the browser
          files: [
              'source/assets/vendor/angular/angular.js',
              'test/lib/angular-mocks.js',
              'test/scripts/**/*.js',
              'test/unit/**/*.js',
              'test/e2e/**/*.js'
          ],
  
  
          // list of files to exclude
          exclude: [
  
          ],
  
  
           // test results reporter to use
          // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
          reporters: ['progress'],
  
  
          // web server port
          port: 9876,
  
  
         // enable / disable colors in the output (reporters and logs)
          colors: true,
  
  
          // level of logging
          // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN ||   config.LOG_INFO || config.LOG_DEBUG
         logLevel: config.LOG_INFO,
  
  
          // enable / disable watching file and executing tests whenever any file changes
          autoWatch: true,
  
  
          // Start the browser, currently available:
          browsers: ['Chrome'],
  
  
          // If browser does not capture in given timeout [ms], kill it
          captureTimeout: 60000,
  
  
          // Continuous Integration mode
         // if true, it capture browsers, run tests and exit
          singleRun: false
        });
      };
  </code></pre>
  
  <p>my mainscenario.js file.</p>
  
  <pre><code>        describe('appName', function() {
  
              beforeEach(function() {
                  browser().navigateTo('../../source/views/home/landing.html');
              });
  
  
              it('should automatically redirect to landing page when location hash/fragment is empty', function() {
                  expect(browser().location().url()).toBe("/landing");
              });
  </code></pre>
  
  <p>Well i cant post the screen shot of the error as it needs 10 reputation. But here is a description.</p>
  
  <pre><code>    AngularJS: Scenario Test Runner1 Errors0 Failures0 Passed
      describe: appName
      165ms should automatically redirect to landing page when location hash/fragment is empty
      118ms   browser navigate to '../../source/views/home/landing.html'
      8ms $location.url()
      http://localhost:8000/test/e2e/mainscenario.js:9:16
  
      TypeError: Object [object Object] has no method 'injector'
          at Object.&lt;anonymous&gt; (http://localhost:8000/test/lib/angular-scenario.js:27230:30)
          ...........blah blah
  </code></pre>
  
  <p>Thanks in advance.</p>