I have a side navigation bar and I'm trying to make a test to click on a link and redirect to the correspondent page.
The selector is inside element that is inside a ngFor loop.
<ng-container *ngFor="let item of listItems">
<li>
<a [data-test]="item.routerLink"></a>
</li>
</ng-container>
I already try using a[href] but had no success.
it('should redirect user to welcome', () => {
cy.getBySelector('a[href*="/welcome"]').click();
});
Thank you.