1

I want to check if my app.component.htm has the tag chart html tag necessary to render my chartComponent.

// app.e2e-spec.ts

import { AppPage } from './app.po';
import { by, element } from 'protractor';

describe('App', () => {
  let page: AppPage;

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

  it('should have a chart element', () => {
    page.navigateTo();
    const elem =  element(by.css('chart'));
    expect(elem.isPresent()).toBeTruthy();
  });
});

Then the component:

// app.component.html
<chart></chart>

Always fails with - Failed: script timeout: result was not received in 11 seconds

What is wrong with it? The chart element rendered as expected in the browser.

TetraDev
  • 16,074
  • 6
  • 60
  • 61
  • I just tried replicating what you posted and couldn't. For starters the closing `chart` tag is missing the `/` (not sure if intentional). Secondly, it doesn't actually show up in my page, I just have an empty `app-root`. Also my IDE says: " 'chart' is not a known element: 1. If 'chart' is an Angular component, then verify that it is part of this module. 2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component." Can you please provide more information on how to replicate? – MkMan Oct 04 '18 at 11:27
  • `` is a custom component - for brevity I did not include the code, but assume its a regular angular component generated with Angular CLI. The closing tag was a typo, in my app it is closed properly. Try to embed any custom component and then reference the html with protractor. – TetraDev Oct 04 '18 at 19:38

0 Answers0