Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Commit

Permalink
update e2e app setup
Browse files Browse the repository at this point in the history
  • Loading branch information
devfd committed Jul 15, 2016
1 parent 882646b commit 566198a
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 227 deletions.
139 changes: 0 additions & 139 deletions e2e/android/app/build.gradle

This file was deleted.

43 changes: 0 additions & 43 deletions e2e/android/app/src/main/java/com/geocodere2eapp/MainActivity.java

This file was deleted.

36 changes: 0 additions & 36 deletions e2e/android/build.gradle

This file was deleted.

5 changes: 0 additions & 5 deletions e2e/android/settings.gradle

This file was deleted.

4 changes: 3 additions & 1 deletion e2e/js/index.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ class GeocoderE2EApp extends Component {
<TouchableOpacity style={{padding: 10, backgroundColor: '#2c3e50'}} onPress={() => {
this.refs.geoInput.blur();

this.setState({result: null});

const [lat, lng] = this.state.reverseInput.split(' ');

Geocoder.reverseGeocodeLocation({latitude: 1 * lat, longitude: 1 * lng}).then((res) => {
Geocoder.geocodePosition({lat: 1 * lat, lng: 1 * lng}).then((res) => {
this.setState({ result: res[0] });
});
}}>
Expand Down
4 changes: 2 additions & 2 deletions e2e/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ npm install ../../$NPM_PACKAGE > /dev/null
rm -rf ../../$NPM_PACKAGE

echo "Prepare android"
cp -r ../android .
rnpm link react-native-geocoder

echo "Prepare JS app"
cp ../js/index.android.js .

echo "Compile android"
cd android
./gradlew clean assembleDebug -PdisablePreDex
./gradlew clean assembleDebug
7 changes: 6 additions & 1 deletion e2e/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@ echo "Start Appium"
node_modules/.bin/appium &
APPIUM_PID=$!

echo "Start static http server"
http-server &
HTTPSERVER_PID=$!

echo "Start packager"
node e2e/GeocoderE2EApp/node_modules/react-native/local-cli/cli.js start --reset-cache &
PACKAGER_PID=$!

sleep 5

node_modules/.bin/mocha && SUCCESS=$? || SUCCESS=$?
node_modules/.bin/mocha --require test/setup.js test/e2e && SUCCESS=$? || SUCCESS=$?

kill $APPIUM_PID
kill $HTTPSERVER_PID
kill $PACKAGER_PID

exit $SUCCESS

0 comments on commit 566198a

Please sign in to comment.