I am trying to pass a variable to a cypress function to type and then press enter.
I have found that this doesn't work.
const valToType = "ABCD"
cy.get('#MyID').type(valToType).type('{enter}');
I have seen elsewhere the workaround is to do
cy.get('#MyID').type('ABCD{enter}');
However I'd really like to keep this a variable. Anyone know how this is possible with cypress?