dmtrKovalenko / cypress-real-events

Fire native system events from Cypress.
MIT License
763 stars 67 forks source link

`realType` not supporting `{moveToEnd}` #653

Closed Wilt closed 3 months ago

Wilt commented 6 months ago

I found that some of the commands mentioned here (like {moveToEnd}) aren't supported by realType while other commands like {backspace} and {enter} are working fine. Is there a reason why those other commands aren't supported and if not, would it be possible to implement the whole list mentioned here: https://docs.cypress.io/api/commands/type#Arguments?

When using {moveToEnd} I get the following error output:

Unrecognized character "{moveToEnd}".

shakcho commented 4 months ago

I also checked {moveToEnd}, {moveToStart}, {selectall}, {meta} is not supported. I tried to achieve the same using

cy.realPress(['Control', 'a'])
cy.realType(`{end}`) 

to achieve{moveToEnd} but looks like Ctrl+a is also not working as expected.

any idea how we can achieve the functionality of {moveToEnd} using realType?

nnaydenow commented 3 months ago

Any updates on this because I'm trying to simulate select all, cut and paste using in similar way?

    cy.realPress(["Meta", "a"])
    cy.realPress(["Meta", "x"])
    cy.realPress(["Meta", "v"])
dmtrKovalenko commented 3 months ago

this is a bit weird though to call Home key as move to end, but I'll add a support for it

dmtrKovalenko commented 3 months ago

I am not sure why text selection from keyboard not working but you can use

    // use 2 clicks fro selecting only one word
    cy.get("input[name=q]").realClick({ clickCount: 3 });

to simulate native selection

dmtrKovalenko commented 3 months ago

:tada: This issue has been resolved in version 1.13.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: