Skip to content

Commit

Permalink
Add e2e test for out of tree platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
empyrical committed Aug 25, 2018
1 parent 7c013d6 commit 92c1b7b
Show file tree
Hide file tree
Showing 35 changed files with 710 additions and 1 deletion.
14 changes: 14 additions & 0 deletions ContainerShip/scripts/run-ci-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ AVD_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1)
ANDROID_NPM_DEPS="appium@1.5.1 mocha@2.4.5 wd@0.3.11 colors@1.0.3 pretty-data2@0.40.1"
CLI_PACKAGE=$ROOT/react-native-cli/react-native-cli-*.tgz
PACKAGE=$ROOT/react-native-*.tgz
DUMMY_PLATFORM_PACKAGE=$ROOT/RNTester/js/OutOfTreeTestPlatform/react-native-dummy-*.tgz

# solve issue with max user watches limit
echo 65536 | tee -a /proc/sys/fs/inotify/max_user_watches
Expand Down Expand Up @@ -96,6 +97,11 @@ function e2e_suite() {
npm pack
cd ..

# install dummy platform
cd RNTester/js/OutOfTreeTestPlatform
npm pack
cd ../../../

# can skip cli install for non sudo mode
if [ $RUN_CLI_INSTALL -ne 0 ]; then
npm install -g $CLI_PACKAGE
Expand Down Expand Up @@ -229,6 +235,8 @@ function e2e_suite() {

# js tests
if [ $RUN_JS -ne 0 ]; then
npm install $DUMMY_PLATFORM_PACKAGE --save

# Check the packager produces a bundle (doesn't throw an error)
react-native bundle --max-workers 1 --platform android --dev true --entry-file index.js --bundle-output android-bundle.js
if [ $? -ne 0 ]; then
Expand All @@ -241,6 +249,12 @@ function e2e_suite() {
echo "Could not build iOS bundle"
return 1
fi

react-native bundle --max-workers 1 --platform dummy --dev true --entry-file index.js --bundle-output dummy-bundle.js
if [ $? -ne 0 ]; then
echo "Could not build out-of-tree dummy bundle"
return 1
fi
fi

# directory cleanup
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/

'use strict';

const AccessibilityInfo = {};

module.exports = AccessibilityInfo;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
'use strict';

module.exports = require('UnimplementedView');
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
'use strict';

module.exports = require('UnimplementedView');
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
'use strict';

module.exports = require('UnimplementedView');
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/

'use strict';

const DatePickerAndroid = {
async open(options: Object): Promise<Object> {
return Promise.reject({
message: 'DatePickerAndroid is not supported on this platform.',
});
},
};

module.exports = DatePickerAndroid;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
'use strict';

module.exports = require('UnimplementedView');
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
'use strict';

module.exports = require('UnimplementedView');
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
'use strict';

module.exports = require('UnimplementedView');
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
'use strict';

module.exports = require('UnimplementedView');
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
'use strict';

module.exports = require('UnimplementedView');
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
'use strict';

module.exports = require('UnimplementedView');
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
'use strict';

module.exports = require('UnimplementedView');
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/

'use strict';

const React = require('React');
const StyleSheet = require('StyleSheet');
const Text = require('Text');
const View = require('View');

class DummyProgressViewIOS extends React.Component {
render() {
return (
<View style={[styles.dummy, this.props.style]}>
<Text style={styles.text}>
ProgressViewIOS is not supported on this platform!
</Text>
</View>
);
}
}

const styles = StyleSheet.create({
dummy: {
width: 120,
height: 20,
backgroundColor: '#ffbcbc',
borderWidth: 1,
borderColor: 'red',
alignItems: 'center',
justifyContent: 'center',
},
text: {
color: '#333333',
margin: 5,
fontSize: 10,
},
});

module.exports = DummyProgressViewIOS;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/

'use strict';

module.exports = require('View');
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/

'use strict';

const React = require('React');
const StyleSheet = require('StyleSheet');
const Text = require('Text');
const View = require('View');

class DummySegmentedControlIOS extends React.Component {
render() {
return (
<View style={[styles.dummy, this.props.style]}>
<Text style={styles.text}>
SegmentedControlIOS is not supported on this platform!
</Text>
</View>
);
}
}

const styles = StyleSheet.create({
dummy: {
width: 120,
height: 50,
backgroundColor: '#ffbcbc',
borderWidth: 1,
borderColor: 'red',
alignItems: 'center',
justifyContent: 'center',
},
text: {
color: '#333333',
margin: 5,
fontSize: 10,
},
});

module.exports = DummySegmentedControlIOS;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/

'use strict';

module.exports = {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/

'use strict';

const React = require('React');
const StyleSheet = require('StyleSheet');
const TabBarItemIOS = require('TabBarItemIOS');
const View = require('View');

class DummyTabBarIOS extends React.Component<$FlowFixMeProps> {
static Item = TabBarItemIOS;

render() {
return (
<View style={[this.props.style, styles.tabGroup]}>
{this.props.children}
</View>
);
}
}

const styles = StyleSheet.create({
tabGroup: {
flex: 1,
},
});

module.exports = DummyTabBarIOS;
Loading

0 comments on commit 92c1b7b

Please sign in to comment.