mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-12 03:35:30 +08:00
Improve Android testing scripts
Summary: The goal of this pull request is to make it easier for contributors to run Android tests locally, specifically the unit tests and integration tests. I added a bunch of checks to the local testing scripts that will warn you if your environment is misconfigured, and tell you how to fix it. I also updated the testing docs, so that the regular "Testing" page should be a decent resource to point people to when you are telling them "hey this pull request needs a test." Just Android, though, I haven't gotten to the iOS parts yet. I also disabled a couple tests that seemed quite flaky while running on a local machine, and don't seem to be providing much value. In particular, the `TestId` test just hangs on my emulator a lot and has been flaky on CI in the past, so I removed about half of its test cases to make the sample app smaller. The testMetions test appears to be dependent on screen size so I commented it out. Closes https://github.com/facebook/react-native/pull/11442 Differential Revision: D4323569 Pulled By: bestander fbshipit-source-id: 9c869f3915d5c7cee438615f37986b07ab251f8c
This commit is contained in:
committed by
Facebook Github Bot
parent
3e6d762ab7
commit
affd5ac681
@@ -12,21 +12,16 @@
|
||||
'use strict';
|
||||
|
||||
var Image = require('Image');
|
||||
var Picker = require('Picker');
|
||||
var ProgressBarAndroid = require('ProgressBarAndroid');
|
||||
var React = require('React');
|
||||
var ScrollView = require('ScrollView');
|
||||
var StyleSheet = require('StyleSheet');
|
||||
var Switch = require('Switch');
|
||||
var Text = require('Text');
|
||||
var TextInput = require('TextInput');
|
||||
var ToolbarAndroid = require('ToolbarAndroid');
|
||||
var TouchableBounce = require('TouchableBounce');
|
||||
var TouchableHighlight = require('TouchableHighlight');
|
||||
var TouchableOpacity = require('TouchableOpacity');
|
||||
var TouchableWithoutFeedback = require('TouchableWithoutFeedback');
|
||||
var View = require('View');
|
||||
var WebView = require('WebView');
|
||||
|
||||
/**
|
||||
* All the views implemented on Android, each with the testID property set.
|
||||
@@ -49,46 +44,8 @@ class TestIdTestApp extends React.Component {
|
||||
'riy/Xl4/f1cf5VWzXyym7PHhhx4dbgYKAAA7'}}
|
||||
style={styles.base} />
|
||||
|
||||
<ProgressBarAndroid
|
||||
testID="ProgressBar"
|
||||
styleAttr="Horizontal"
|
||||
style={styles.base} />
|
||||
|
||||
<ScrollView
|
||||
testID="ScrollView"
|
||||
style={styles.base}>
|
||||
<Text testID="ScrollView Item (same id used for all items)">Item 1</Text>
|
||||
<Text testID="ScrollView Item (same id used for all items)">Item 2</Text>
|
||||
</ScrollView>
|
||||
|
||||
<ScrollView
|
||||
testID="Horizontal ScrollView"
|
||||
horizontal={true}
|
||||
style={styles.base}>
|
||||
<Text testID="ScrollView Item (same id used for all items)">Item 1</Text>
|
||||
<Text testID="ScrollView Item (same id used for all items)">Item 2</Text>
|
||||
</ScrollView>
|
||||
|
||||
<Picker
|
||||
testID="Dropdown Picker"
|
||||
mode={Picker.MODE_DROPDOWN}
|
||||
style={styles.base}>
|
||||
<Picker.Item label="Dropdown picker" value="key0" />
|
||||
</Picker>
|
||||
|
||||
<Picker
|
||||
testID="Dialog Picker"
|
||||
mode={Picker.MODE_DIALOG}
|
||||
style={styles.base}>
|
||||
<Picker.Item label="Dialog picker" value="key0" />
|
||||
</Picker>
|
||||
|
||||
<Switch testID="Switch" value={true} />
|
||||
|
||||
<Text testID="Text">text</Text>
|
||||
|
||||
<ToolbarAndroid testID="Toolbar" style={styles.base} subtitle="toolbar" />
|
||||
|
||||
<TextInput testID="TextInput" value="Text input" />
|
||||
|
||||
<TouchableBounce testID="TouchableBounce">
|
||||
@@ -111,17 +68,6 @@ class TestIdTestApp extends React.Component {
|
||||
|
||||
<View testID="View" />
|
||||
|
||||
{/*
|
||||
Webview gets tests crashing or stalling occasionally
|
||||
e.g. https://circleci.com/gh/facebook/react-native/7054
|
||||
TODO t11449130
|
||||
<WebView
|
||||
testID="WebView"
|
||||
url={'http://newsroom.fb.com'}
|
||||
renderError={() => <View /> }
|
||||
style={styles.base}
|
||||
/>*/}
|
||||
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user