Skip to content
This repository was archived by the owner on Aug 7, 2019. It is now read-only.
This repository was archived by the owner on Aug 7, 2019. It is now read-only.

angularIntegration gets Uncaught TypeError: Object #<Object> has no method 'runs' #27

@apraditya

Description

@apraditya

First off, I can't find any doc on how to explicitly set this testing library on AngularJS app with Karma. So I blindly set it up from what I understand from the readme. Here's what I put in the karma-e2e.conf.js

files = [
  ANGULAR_SCENARIO,
  ANGULAR_SCENARIO_ADAPTER,
  'test/vendor/uitest.js',
  'test/e2e/**/*.js',
];

As for the rest of the Usage part of the readme, I don't quite get them. So I skip them anyway and straight away to the AngularJS-support and put these lines in my e2e spec:

describe("E2E: Testing RegisterCtrl", function() {

  var uit = uitest.current;
  uit.feature('angularIntegration');
  uit.append('lib/angular-mocks.js');
  uit.runs(function($httpBackend) {

    $httpBackend.whenPOST('../api/register/number/validno').respond(successfulResponse);
  });
  // ...
});

and I get the error, Uncaught TypeError: Object #<Object> has no method 'runs'. Is this due to uitest.js isn't set properly? Step 2 says the following line should be included in the pages that should be tested

<script type="text/javascript">parent.uitest && parent.uitest.instrument(window);</script>

Does it mean all of my views or I have to prepend this in beforeEach block? Thank you for creating the lib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions