F
F
Finom2015-06-03 18:05:04
JavaScript
Finom, 2015-06-03 18:05:04

How to navigate to a page using Karma?

Hello. Trying to make friends with Karma test runner. The task is this: there are many html pages with scripts. It is necessary that the tool go through these pages and check some points. "Is the field filled with such and such a value", "does the object have such and such a property", etc. Unfortunately, I can't figure out how to navigate through the pages. When using "browser().navigateTo( 'first.html' );" an exception is thrown "ReferenceError: browser is not defined".
Full jasmine test code:

describe("A suite", function() {
  beforeEach(function () {
    browser().navigateTo( 'first.html' );
  }); 
  
  it("contains spec with an expectation", function() {
    expect(true).toBe(true);
  }); 
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kostik, 2015-06-03
@kostiknoir

karma.js is unit tests
What you need is called e2e (end-to-end) tests.
It's fro protractor

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question