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

Commit 566198a

Browse files
committed
update e2e app setup
1 parent 882646b commit 566198a

File tree

7 files changed

+11
-227
lines changed

7 files changed

+11
-227
lines changed

e2e/android/app/build.gradle

Lines changed: 0 additions & 139 deletions
This file was deleted.

e2e/android/app/src/main/java/com/geocodere2eapp/MainActivity.java

Lines changed: 0 additions & 43 deletions
This file was deleted.

e2e/android/build.gradle

Lines changed: 0 additions & 36 deletions
This file was deleted.

e2e/android/settings.gradle

Lines changed: 0 additions & 5 deletions
This file was deleted.

e2e/js/index.android.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ class GeocoderE2EApp extends Component {
5151
<TouchableOpacity style={{padding: 10, backgroundColor: '#2c3e50'}} onPress={() => {
5252
this.refs.geoInput.blur();
5353

54+
this.setState({result: null});
55+
5456
const [lat, lng] = this.state.reverseInput.split(' ');
5557

56-
Geocoder.reverseGeocodeLocation({latitude: 1 * lat, longitude: 1 * lng}).then((res) => {
58+
Geocoder.geocodePosition({lat: 1 * lat, lng: 1 * lng}).then((res) => {
5759
this.setState({ result: res[0] });
5860
});
5961
}}>

e2e/prepare.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ npm install ../../$NPM_PACKAGE > /dev/null
2121
rm -rf ../../$NPM_PACKAGE
2222

2323
echo "Prepare android"
24-
cp -r ../android .
24+
rnpm link react-native-geocoder
2525

2626
echo "Prepare JS app"
2727
cp ../js/index.android.js .
2828

2929
echo "Compile android"
3030
cd android
31-
./gradlew clean assembleDebug -PdisablePreDex
31+
./gradlew clean assembleDebug

e2e/run.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,20 @@ echo "Start Appium"
99
node_modules/.bin/appium &
1010
APPIUM_PID=$!
1111

12+
echo "Start static http server"
13+
http-server &
14+
HTTPSERVER_PID=$!
15+
1216
echo "Start packager"
1317
node e2e/GeocoderE2EApp/node_modules/react-native/local-cli/cli.js start --reset-cache &
1418
PACKAGER_PID=$!
1519

1620
sleep 5
1721

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

2024
kill $APPIUM_PID
25+
kill $HTTPSERVER_PID
2126
kill $PACKAGER_PID
2227

2328
exit $SUCCESS

0 commit comments

Comments
 (0)