Question

I am just getting started with karma, and although it seems that everything is hooked up properly and my unit tests are being run as expected, I can't get my end to end tests to find any elements.

When I go to the debug page, I can see a very brief flash of my application, which says to me that my proxy and config in general is hooked up properly, but when I run

describe('my app', function() {
  beforeEach(function(){
     browser().navigateTo('/');
  });
  it('should display the home page', function() {
     expect(element('title').text()).toEqual('my title');
  });
});

it never finds an element, no matter the selector I put in.

My question, though, is... is there some way that I can see what it is seeing? Can I get karma to dump the full text of the html response? If I could do that, I could at least see what it is getting back. As it stands, I am getting no debugging information at all and it is kind of frustrating.

Feel free to ask for more information if I can make it easier to answer the question. Thank you for any help you can provide.

Was it helpful?

Solution

You can use pause() inside your test to pause the execution, then you can resume from the UI.

The docs for pause() are here.

You can also use sleep(seconds) to make a timed pause, if you want to auto resume.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top