I'm writing an Angular2 test component and i've noticed this line in the tutorials:
de = fixture.debugElement.query(By.css('h1'));
de
is defined as DebugElement
type.
How can I get DebugElement
by id?
That may seem extremely simple but I can't find any direction in the docs.
You can also use by.css
de = fixture.debugElement.query(By.css('#theid'));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With