美文网首页
4 react native

4 react native

作者: 冰皮月饼真好吃 | 来源:发表于2017-12-18 10:32 被阅读0次

1 有placeholder的textinput

EarlGrey.select(elementWithMatcher: grey_text("Email")).assert(grey_sufficientlyVisible()).perform(grey_tap()).perform(grey_typeText("ugcp1213@qq.com\n"));

EarlGrey.select(elementWithMatcher: grey_text("Password")).assert(grey_sufficientlyVisible()).perform(grey_tap()).perform(grey_typeText("12345678\n"))

1) grey_tap()  avoid exception

2)  "\n" is "return" of keyboard, hide keyboard 

2  Button with label ( Accessibility Inspector could find)

EarlGrey.select(elementWithMatcher: grey_accessibilityLabel("SIGN IN")).assert(grey_sufficientlyVisible()).perform(grey_tap());

react-native file:

<TouchableOpacity accessible={true}

accessibilityLabel={'LOGIN_WITH_FACEBOOK'} TouchableOpacity>

earlgrey file:

EarlGrey.select(elementWithMatcher: grey_accessibilityLabel("LOGIN_WITH_FACEBOOK")).perform(grey_tap());

3 import components(play up view) from others 

react-native file:

banners.push (

<TouchableOpacity  accessible={true}                        accessibilityLabel={'PLAY_UP_VIEW'} .....>

</TouchableOpacity>

);

Earlgrey file 

EarlGrey.select(elementWithMatcher: grey_accessibilityLabel("PLAY_UP_VIEW")).assert(grey_sufficientlyVisible()).perform(grey_tap());

相关文章

网友评论

      本文标题:4 react native

      本文链接:https://www.haomeiwen.com/subject/piidwxtx.html