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

Add new copyText command #2029

Open
moxorama opened this issue Sep 9, 2024 · 1 comment
Open

Add new copyText command #2029

moxorama opened this issue Sep 9, 2024 · 1 comment
Labels
good first issue Good for newcomers wanting to contribute maestro cli Related to the command-line Maestro tool P3 Issues that are less important

Comments

@moxorama
Copy link

moxorama commented Sep 9, 2024

Use case

There is a lot of issues with input flakiness, but there is no need to test input each time
We can just paste text in input, and I hope it will be more stable

#1225

Proposal

There is the pasteText command in maestro, so adding copyText with string argument will give us more complete api.

Instead of

- tapOn:
    id: email-feild

- inputText: '[email protected]'

will be something like this

- tapOn:
    id: email-feild

- copyText: '[email protected]'
- pasteText 

Or even simplier - it could be just string argument to pasteText, so test will be

- tapOn:
    id: email-feild
- pasteText  '[email protected]'

Anything else?

No response

@bartekpacia
Copy link
Contributor

Hey @moxorama, thanks for proposing this.

I guess that by problems with "input flakiness" you mean issue #2005 – good news is there's already a PR #2027 that fixes issue #2005.

Anyway, I see why you might think that pasting text would be faster than typing – but actually, under the hood pasteText just calls inputText:

private fun pasteText(): Boolean {
copiedText?.let { maestro.inputText(it) }
return true
}

So there'd be no difference in speed (unless we also made changes to how inputText works, which I think is doable, but requires some investigation if it would be stable enough on both iOS and Android).

That said, I think being able to set contents of clipboard with the hypothetical new copyText command would be a nice, small QoL addition.

copyText:
  text: This string will be saved in Maestro's clipboard

or

copyText: This string will be saved in Maestro's clipboard

@bartekpacia bartekpacia added the good first issue Good for newcomers wanting to contribute label Sep 9, 2024
@bartekpacia bartekpacia changed the title copyText command Add new copyText command Sep 9, 2024
@bartekpacia bartekpacia added maestro cli Related to the command-line Maestro tool P3 Issues that are less important labels Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers wanting to contribute maestro cli Related to the command-line Maestro tool P3 Issues that are less important
Projects
None yet
Development

No branches or pull requests

2 participants