diff --git a/README.md b/README.md index 3f40464..f352291 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Quick Start 2. Run docker-android ```bash - docker run --privileged -d -p 6080:6080 -p 4723:4723 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" -e APPIUM=False --name android-container butomo1989/docker-android-x86-5.0.1 + docker run --privileged -d -p 6080:6080 -p 4723:4723 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" --name android-container butomo1989/docker-android-x86-5.0.1 ``` **Optional arguments** diff --git a/example/android/python/README.md b/example/android/python/README.md index 25b977b..e89bb65 100644 --- a/example/android/python/README.md +++ b/example/android/python/README.md @@ -1,7 +1,7 @@ -Docker-Android-Appium Sample ----------------------------- +Docker-Android Sample UITests with Appium +----------------------------------------- -Example UI test to use docker-appium. +Example UI test with [Appium] to use docker-android. Requirements ============ @@ -12,3 +12,5 @@ Quick Start =========== 1. pip install -r requirements.txt 2. python app_simple.py + +[Appium]: diff --git a/src/app.py b/src/app.py index af21590..75c3bf8 100644 --- a/src/app.py +++ b/src/app.py @@ -167,7 +167,7 @@ def run(): cmd = 'emulator -avd {name}'.format(name=avd_name) subprocess.Popen(cmd.split()) - appium = str_to_bool(str(os.getenv('APPIUM', True))) + appium = str_to_bool(str(os.getenv('APPIUM', False))) if appium: logger.info('Run appium server...') appium_run(avd_name) diff --git a/src/tests/__init__.py b/src/tests/__init__.py index 5ec9eee..fdefef7 100644 --- a/src/tests/__init__.py +++ b/src/tests/__init__.py @@ -37,6 +37,7 @@ class TestApp(TestCase): @mock.patch('subprocess.Popen') def test_run_with_appium(self, mocked_avd, mocked_subprocess): with mock.patch('src.app.appium_run') as mocked_appium: + os.environ['APPIUM'] = str(True) app.run() self.assertTrue(mocked_avd.called) self.assertTrue(mocked_subprocess.called) @@ -46,7 +47,6 @@ class TestApp(TestCase): @mock.patch('subprocess.Popen') def test_run_withhout_appium(self, mocked_avd, mocked_subprocess): with mock.patch('src.app.appium_run') as mocked_appium: - os.environ['APPIUM'] = str(False) app.run() self.assertTrue(mocked_avd.called) self.assertTrue(mocked_subprocess.called)