2017-11-24 9 views
0

ユーザーのメールアドレスを入力したら、Nextを押してDetoxをパスワードフィールドに移動します。Detox:iOS SimulatorキーボードのNextを押す方法

私は、要素IDでパスワードフィールドを探して、フォーカスのために.tap()を呼び出しようとしましたが、キーボードがパスワードフィールドを部分的に閉塞し、75%の可視性基準を満たしていません。

Error Trace: [ 
    { 
    "Description" : "Assertion with matcher [M] failed: UI element [E] failed to match the following matcher(s): [S]", 
    "Description Glossary" :  { 
     "M" : "matcherForSufficientlyVisible(>=0.750000)", 
     "E" : "<RCTUITextField:0x7f9abd45f190; AX=Y; AX.id='Password Input'; AX.value='your new password'; AX.frame={{42.5, 342.5}, {235, 40}}; AX.activationPoint={160, 362.5}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {235, 40}}; alpha=1; text=''>", 
     "S" : "matcherForSufficientlyVisible(>=0.750000)" 
    }, 
    "Error Domain" : "com.google.earlgrey.ElementInteractionErrorDomain", 
    "Error Code" : "3", 
    "File Name" : "GREYAssertions.m", 
    "Function Name" : "+[GREYAssertions grey_createAssertionWithMatcher:]_block_invoke", 
    "Line" : "75" 
    } 
] 

どうすればこの問題を解決できますか?私はdetoxを使用して反応ネイティブのアプリをテストしています。

ありがとうございました。

答えて

1

それはそうのようなテキスト入力の最後に\nを追加するのと同じくらい簡単ですが判明:

const email = '[email protected]'; 
await element(by.id('email_input')).typeText(`${email}\n`);