wix / Detox

Gray box end-to-end testing and automation framework for mobile apps
https://wix.github.io/Detox/
MIT License
11.2k stars 1.92k forks source link

Please add Paste from Other apps Permission #4333

Open Daha62 opened 9 months ago

Daha62 commented 9 months ago

Description

There is no way to automatically allowed to paste from CoreSimulatorBrigde to an app, also there is no way to do it through xcrun simctl, and no way to do it through applesimutils

image

Your environment

Detox version: React Native version: Node version: Device model: OS: Test-runner (select one): jest / other

github-actions[bot] commented 9 months ago

Hello! We appreciate you bringing this issue to our attention. It looks like this could be a valuable addition or fix to our project. We believe that this feature would benefit greatly from contributions from the community, even from first-time contributors.

If you're interested in contributing to this feature, please take a look at our contribution guide. It has all the information you need to know about how to submit a pull request and contribute to our project.

You're also welcome to join our Discord server and discuss this feature with the collaborators or other contributors under the channel 'contributions'.

Please feel free to reach out to us if you have any questions, or need help with anything. We appreciate your feedback and look forward to working with you!

noomorph commented 9 months ago

@asafkorem wdyt?

asafkorem commented 9 months ago

Hey @Daha62, Since there's no way to do that with Xcrun simctl or ASU it might be complicated to implement (requires research). However, it will be easier to do when we'll introduce system dialogs interaction support on Detox v21.

Can you please elaborate what it the use case? Do you have a cross-apps scenario that you're testing?

Daha62 commented 9 months ago

Was trying to inspect the reason of this alert, but unsuccessfully. Also had some thoughts about xCode version (but it doesn't matter). Tried to review tests, but I don't have any copy/paste actions. It appears randomly on ios simulator (16.2), detox version is 20.10.0

image
patriciazumo commented 3 months ago

Hi @asafkorem,

I'm trying to interact with this dialog by using https://wix.github.io/Detox/docs/next/api/system#tap, with Detox 20.23, but without success. I tried:

  1. system.element(by.system.label('Allow Paste')).tap()
  2. system.element(by.system.type('button')).atIndex(1).tap()

and also tried these (which I think that don't make much sense but it didn't hurt to try):

  1. system.element(by.system.label('Allow')).tap()
  2. system.element(by.system.label('Allow Paste')).atIndex(0).tap()

Can you spot anything I'm doing wrong? 🙏

patriciazumo commented 3 months ago

In addition to my previous comment, is there any news regarding adding this permission?

In my case, I need to test a flow where there's a button that pastes a string, which is not human readable text like a very long ID, that the user copied from some other app (like a chat app, a reminder note, etc.). So in my case, I'm using execSync(echo ${theStringToBePasted} | pbcopy, { stdio: 'inherit' }) to copy the string to the Clipboard and then tap the mentioned button to paste it.

Daha62 commented 2 months ago

also tried system.element but without success (Detox 20.22.2)