4

デトックスで見つけようとしている要素を見つけるのに問題があります。まだ何かを見つけることができません。セットアップ手順に従いましたが、何らかの理由で機能しません。

https://github.com/wix/detox/blob/master/docs/Introduction.GettingStarted.mdで説明されているように、非常に基本的なセットアップを使用していますが、何らかの理由で機能したくありません。

成分:

render() {
    return (
        <View testID="MainView">...</View>
    )
}

テスト:

describe('Example', () => {
  beforeEach(async () => {
    await device.reloadReactNative();
  });
  it('should have main view', async () => {
    await expect(element(by.id('MainView'))).toExist();
  });
})

エラー:

Exception with Assertion: {
    "Assertion Criteria" : "assertWithMatcher:isNotNil",
    "Element Matcher" : "(((respondsToSelector(accessibilityIdentifier) && accessibilityID('MainView')) && !(kindOfClass('RCTScrollView'))) || (kindOfClass('UIScrollView') && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && ancestorThatMatches(((respondsToSelector(accessibilityIdentifier) && accessibilityID('MainView')) && kindOfClass('RCTScrollView'))))))",
    "Recovery Suggestion" : "Check if the element exists in the UI hierarchy printed below. If it exists, adjust the matcher so that it accurately matches element."

}

Error Trace: [
    {
        "Description" : "Interaction cannot continue because the desired element was not found.",
        "Error Domain": "com.google.earlgrey.ElementInteractionErrorDomain",
        "Error Code" : "0",
        "File Name" : "GREYElementInteraction.m",
        "Function Name" : "-[GREYElementInteraction matchedElementsWithTimeout:error:]",
        "Line" : "124"
    }
]

私は他の投稿でこの問題を見てきましたが、通常は testID をサポートしていない要素を見つけようとすることに関係していますが、私の知る限り、Viewサポートが必要です。

どんな助けでも大歓迎です。

4

0 に答える 0