Detox: iOS Simulator how to confirm alert message

前端 未结 3 2009
忘掉有多难
忘掉有多难 2020-12-11 01:14

I am using Alert from react-native.

How do I get detox to press the \"Log out\" button on the alert message?

I tried using await element(by.te

3条回答
  •  执笔经年
    2020-12-11 01:55

    It should work with finding element by text

    await element(by.text('Log out')).tap();
    

    Demo repo: https://github.com/FDiskas/demonas/blob/c703840a991b2f3d96a18ac8c5120ee1d5f901f8/e2e/firstTest.spec.ts#L11

提交回复
热议问题