Detox: How to test with pasteboard?

Created on 5 Aug 2017  Â·  16Comments  Â·  Source: wix/Detox

I'm using detox to test a RN app, how to test with Clipboard?

accepteenhancement looking for contributors

Most helpful comment

You can use xcrun simctl pbcopy/pbpaste to pass clipboard between device and computer. This would be nice if you could add this feature via PR.

All 16 comments

@iwater what is that?

set some string at clipboard, then read that from app, or set string into
clipboard from app and check it from test as expected

2017-08-06 3:39 GMT+08:00 Anton Kuznetsov notifications@github.com:

@iwater https://github.com/iwater what is that?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/wix/detox/issues/222#issuecomment-320466013, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAGpiWv2it9N_1EB9Ns5Dg4M_BwSG7Zwks5sVMTdgaJpZM4Oug5d
.

not sure that it will be a main priority feature :)

It's a perfectly valid feature request though. I quickly checked Earlgrey, It seems there is no support for this there.

What will this feature test? That the system clipboard is working correctly?

I had an app many many years ago, where the primary event to it was copy pasting a longer text to it.
It is actually a different event than typing characters into the textfield one after another. (Although, you have to work a bit for that. ;) )

I am not talking about what @iwater described.

I am thinking about actions like, copy paste into a specific view the current clipboard.

Edge case? Definitely. But, I think it can't be covered by simply long clicking into a textview then trying to tap the paste button.

in my app, it check the clipboard , if there is a url as expected, the app
will show a dialog

2017-08-07 7:16 GMT+08:00 Simon Racz notifications@github.com:

I had an app many many years ago, where the primary event to it was copy
pasting a longer text to it.
It is actually a different event than typing characters into the textfield
one after another. (Although, you have to work a bit for that. ;) )

I am not talking about what @iwater https://github.com/iwater described.

I am thinking about actions like, copy paste into a specific view the
current clipboard.

Edge case? Definitely. But, I think it can't be covered by simply long
clicking into a textview then trying to tap the paste button.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/wix/detox/issues/222#issuecomment-320539242, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAGpiYO_uoDDHlMbZHGcIb8Q7y5bV8tTks5sVkldgaJpZM4Oug5d
.

I can think of many cases where apps would want to test that they have copied the correct text to clipboard. For example, a passwords keeping app.

You can use xcrun simctl pbcopy/pbpaste to pass clipboard between device and computer. This would be nice if you could add this feature via PR.

Would Paste text be faster than "simulated" typing? Speed is valuable when running [many] automated test cases.

@markhu No, it should be the same.
Detox’ future support for Pasteboard will only be for expecting values in the pasteboard, so I don’t see how Detox can be helpful in your case. Replacing text is the fastest way to enter text.

I would welcome readPasteboard method.

I have a usecase with copy to clipboard button. I would like to read the device's pasteboard to verify, that the button actually works.

As mentioned above there is simctl in the xcode utils (for iOS of course), but seems somehow broken.

I found JS sim utils, which don't work properly...
https://github.com/appium/node-simctl/issues/79
It would be valuable to have this API...

@LeoNatan Can you please share why the related pull request was deleted without any comment?

The issue has been closed for inactivity.

Pull request was closed because it had many issues, the person working on it was no longer working on it and it went stale. We don’t have the resources to commit to this. If someone takes the JS side and implements it in a PR, I’ll add the iOS native side.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lc3t35 picture lc3t35  Â·  4Comments

rengarima picture rengarima  Â·  4Comments

LeoNatan picture LeoNatan  Â·  4Comments

danut-t picture danut-t  Â·  3Comments

jrobber picture jrobber  Â·  3Comments