I am testing my application and I'm trying to invoke button click with enter keyword:
<v-btn
class="submit-button"
block
color="primary"
@click="login"
>
Log In
</v-btn>
cy.get('.submit-button').type('{enter}');
Is there any alternative way, to click button on enter key press?
I'm using vuetify framework and v-btn
component.
Thanks
cy.get('.submit-button').type('{enter}', {force: true});
, assuming the locator that you're using is correct. – Alapan Dastype
command requires a typeable (input/textarea) element in order to work. Your code yields a button element type, that's why it fails. In case you have any input/textarea element on your page, you have tocy.get('input').type('{enter}')
– Alex Izbas