The app is designed to fetch the customer for the id that's entered, which means there's an event handler set up to do this.
From type#Events-that-fire, these events are fired automatically
The following events will be fired based on what key was pressed identical to the event spec:
- keydown
- keypress
- beforeinput
- textInput
- input
- keyup
Also, since you tried cy.get('#ID').type('1234567{enter}'), the change event is also sent
Additionally change events will be fired either when the {enter} key is pressed
These steps should help you
Try blurring the input
The test should mimic the actions a user takes, but {enter} may not trigger the response. Try cy.get('#ID').type('1234567').blur()
Checking for event listeners
Take a look at the Elements tab / Event Listeners in devtools to see what events are set up on the element.
Use .trigger() to fire the events that are listed. Even if they are one the above, still try to fire them after the .type() since there may be a timing issue.
Check for fetch
Take a look at the devtools Network tab to see if a fetch is triggered. The .type() command may be working but the fetch of customer data failing.
Switch to cypress-real-events
Add the package cypress-real-events and use
cy.get('#ID').focus()
cy.realtype('1234567{enter}')
cy.get('#ID').trigger(...) // events found in devtools
or
cy.get('#ID').focus()
cy.realtype('1234567').blur()
cy.get('#ID').trigger(...) // events found in devtools