Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

realType not supporting {moveToEnd} #653

Closed
Wilt opened this issue Mar 19, 2024 · 5 comments · Fixed by #679
Closed

realType not supporting {moveToEnd} #653

Wilt opened this issue Mar 19, 2024 · 5 comments · Fixed by #679
Labels

Comments

@Wilt
Copy link

Wilt commented Mar 19, 2024

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
Copy link

shakcho commented Jun 3, 2024

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
Copy link

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
Copy link
Owner

dmtrKovalenko commented Jun 15, 2024

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

@dmtrKovalenko
Copy link
Owner

dmtrKovalenko commented Jun 15, 2024

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
Copy link
Owner

🎉 This issue has been resolved in version 1.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants