title: angular testing get element by text
body: <p>I'm trying to write unit tests for an angular 8 application. Inside spec file of a component (navbar.component.spec.ts) I want to click buttons. I want to get buttons by <strong>inner text</strong> of them. <strong>How could I do that ?</strong> </p>
  
  <p>I'm using <code>*ngFor</code> Only way I can think of is giving ids and using ids like <code>const buttonElem = debug.query(By.css('#asd'));</code></p>