Mahmoud
Mahmoud

Reputation: 936

Timeout error when running e2e test in angular cli projet

I started working with e2e test with protractor and jasmine in angular cli project

describe('my-web-client App', function() {
  let page: myWebClientPage;

  beforeEach((done) => {
    page = new myWebClientPage();
  });

  it('should show menubar', () => {
    page.navigateTo();
    expect( page.getAppMenubar().isPresent() ).toEqual(true); // getAppMenubar() return element(by.css('app-menubar'));
  });
});

But even with a simple test I received the following errors enter image description here

Upvotes: 1

Views: 429

Answers (1)

alecxe
alecxe

Reputation: 474071

You specify the done callback but never execute it and, according to jasmine documentation:

... spec will not start until the done function is called in the call to beforeEach above. And this spec will not complete until its done is called.

You can just omit it:

beforeEach(() => {
  page = new myWebClientPage();
});

Upvotes: 1

Related Questions