0

React Native プロジェクトでデトックスを使用する。コンポーネントは次のとおりです。

<TouchableWithoutFeedback
  testID={'rss_list_' + this.props.index}
  onPress={this.selectItem}
>
  <View testID={'rss_list_text_' + this.props.index}>
    <Text style={styles.itemText}>
      {this.props.item.title ? this.props.item.title.trim() : "no title"}
    </Text>
  </View>
</TouchableWithoutFeedback>

実際のテスト:

  it('should have an Rss List', async () => {
    await expect(element(by.id('RssList'))).toExist();
  });

  it('should have a Header', async () => {
    await expect(element(by.id('main_header'))).toExist();
  });

  it('should have a populated rss list', async () => {
    await expect(element(by.id('rss_list_populated'))).toExist();
  });

  it('should have an rss item', async () => {
    await expect(element(by.id('rss_list_2'))).toBeVisible();
  });

  it('should tap on the rss item', async () => {
    await element(by.id('rss_list_2')).tap();
  });

  it('should see the item view', async () => {
    await waitFor(element(by.id('item_view'))).toBeVisible().withTimeout(10000);
  });

問題:

RSS アイテムが成功し、アイテムが見つかります。ただし、TouchableWithoutFeedback、View、または Text 要素をタップしようとすると成功しますが、その下の関数は起動しません。テストは失敗しません Detox は、Tap が発生したことを示していますが、Tap の結果である item_view は表示されません。タイトルにあるタップ、マルチタップ、ロングプレスのすべての方法を試しました。また、テスト中に手動でタップしようとしましたが、うまくいきません。デトックスでタップできるのは一部の要素タイプだけですか?

更新: 今日 Appium で試してみましたが、要素をクリックすることもできませんでした。問題はTouchableWithoutFeedbackにあるようです

4

1 に答える 1