I have an Ionic 6 app and I'm testing it with cypress 9.3.1.
In my app I'm using an ion-searchbar like this:
<ion-searchbar *ngIf="showSearchbar" [value]="search" (search)="searchQuestions($event)"
placeholder="{{'components.search.placeholder' | translate}}">
The searchQuestions method looks like this:
public searchQuestions(event): void {
console.log('test');
this.triggerSearch.emit(event.target.value);
}
When I test it manually everything works fine, but when I execute the cypress code like this:
cy.get('.searchbar-input')
.type('test1' + '{leftArrow}{del}{enter}' + 'test');
the input field is filled with testtest, so the {leftArrow}{del} is working, but the console.log from searchQuestions is not executed and the event is not emitted
EDIT: When I use (keyup.enter)="searchQuestions($event)" instead of (search)="searchQuestions($event)" it seems to work fine. But I guess replacing it would be problematic for native apps and keeping both might cause problems.