Compare commits

...
14 Commits
Author SHA1 Message Date
butomo1989 2d25517bfa Using the latest version of docker-appium 2018-04-29 20:06:17 +02:00
Budi UtomoandGitHub e3219ac24b Changed order 2018-04-23 19:25:24 +02:00
Budi UtomoandGitHub c4fb6243c5 Fixed tag 2018-04-23 19:23:54 +02:00
Budi UtomoandGitHub d021fd69e6 Added video conference 2018-04-23 19:22:10 +02:00
butomo1989 cacfe568a2 Added video image 2018-04-23 21:17:41 +02:00
butomo1989 cb100330ad Using appium-docker-android docker image for executing Appium UI-Test 2018-03-21 19:08:48 +01:00
butomo1989 bc0972318f Using the latest version of docker-selenium 2018-03-21 12:29:54 +01:00
Budi UtomoandGitHub 3a88fa4ae4 Merge pull request #71 from greenerchen/patch-1
Add instructions for VMWare or Parallels Desktop
2018-03-05 13:44:18 +01:00
Greener Chen 398a694ccd Add supplementary images 2018-03-05 18:37:19 +08:00
Greener ChenandGitHub 14a29344b8 Add instructions for VMWare or Parallels Desktop 2018-03-05 18:28:07 +08:00
butomo1989 47621a7ccb Added sample how to build Android project 2018-02-17 10:00:03 +01:00
butomo1989 c1d66496fb Added GitHub templates 2018-02-17 09:59:09 +01:00
Budi UtomoandGitHub 1365ec736b Replaced code line 2018-02-13 11:18:50 +01:00
butomo1989 4aee17de2d Deleted unused image 2018-02-12 18:47:02 +01:00
11 changed files with 158 additions and 13 deletions
+22
View File
@@ -0,0 +1,22 @@
**Please make sure that it is an issue / a feature request. If it is a question / help wanted, please visit [our group chat](https://gitter.im/butomo1989/docker-android). Thank you!**
Operating System:
<!-- OSX Yosemite, Ubuntu 16.04, Windows 10 etc -->
Docker Image:
<!-- butomo1989/docker-android-x86-7.1.1, butomo1989/docker-android-real-device etc -->
Docker Version:
<!-- 17.09.0-ce, 17.06.2-ce etc -->
Docker-compose version (Only if you use it):
<!-- 1.16.1 etc -->
Docker Command to start docker-android:
<!-- docker run ... -->
## Expected Behavior
<!-- Explaination about expected behaviour goes here -->
## Actual Behavior
<!-- Explaination about actual behaviour goes here -->
+12
View File
@@ -0,0 +1,12 @@
### Purpose of changes
<!-- Please describe why this change is required / What problem you want to solve. -->
### Types of changes
_Put an `x` in the boxes that apply_
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
### How has this been tested?
<!-- Please describe in detail how you tested your changes. -->
+94 -1
View File
@@ -10,6 +10,10 @@
Docker-Android is a docker image built to be used for everything related to mobile website testing and Android project.
<p align="center">
<a href="https://youtu.be/pQdpjuYwvp8"><img src="./images/appiumconf2018.png" alt="Appium Conference 2018" width="600"></a>
</p>
Emulator - Samsung Device | Emulator - Nexus Device | Real Device
:---------------------------:|:---------------------------:|:---------------------------:
![][emulator samsung] |![][emulator nexus] |![][real device]
@@ -146,6 +150,23 @@ There is [example of compose file] to run complete selenium grid and docker-andr
docker-compose up -d
```
Build Android project
---------------------
docker-android can be used for building Android project and executing its unit test. This following steps will illustrate how to build Android project:
1. Clone [this sample test project](https://github.com/googlesamples/android-testing).
```bash
git clone git@github.com:googlesamples/android-testing.git
```
2. Build the project
```bash
docker run -it --rm -v $PWD/android-testing/ui/espresso/BasicSample:/root/tmp butomo1989/docker-android-x86-7.1.1 tmp/gradlew build
```
Control android emulator outside container
------------------------------------------
@@ -195,6 +216,78 @@ SMS Simulation
![][sms]
How to use docker-android in VMWare or Parallels Desktop
---------------
The following instructions are used for OS X. You'll need [docker-machine-parallels](https://github.com/Parallels/docker-machine-parallels) to create a virtual machine (vm) with tiny core linux for running docker images. After that, you may start the vm you created for VMWare Fusion or Parallels Desktop and run a docker container inside this vm. If you're going to use the android docker of emulator with x86 processor, setup this vm for nested virtualization and kvm support before you run a docker container.
1. Install docker-machine-parallels via Homebrew:
```bash
$ brew install docker-machine-parallels
```
2. Create a virtual machine for running docker images based on the virtual machine tool you use
Create a virtual machine of VMWare Fusion
```bash
$ docker-machine create --driver=vmwarefusion vmware-dev
```
Create a virtual machine of Parallels Desktop
```bash
$ docker-machine create --driver=parallels prl-dev
```
This utility `docker-machine-parallels` will fetch boot2docker.iso to create a vm of VMWare fusion or Parallels Desktop. When the vm is created, you'll see it's booted with VMWare fusion or Parallels Desktop where the network of vm is set to NAT and one IP is assigned. You'll be able to connect to vnc service inside the docker image through that IP. Say it's `10.211.55.3` and we'll use it later.
3. Setup the virtual machine for nested virtualization support
Shutdown the vm by running the command below in the boot2docker vm before you setup it.
```bash
# shutdown -h now
```
If you use VMWare Fusion, go to menu bar > Vitual Machine > Settings > Processors and Memory, expand Advanced options, and select `Enable hypervisor applications in this virtual machine`.
[![Enable nested virtualization for VMWare Fusion](images/vmwarefusion_enable_nested_virtualization.png)]
If you use Parallels Desktop, open settings screen of that vm and go to `CPU & Memory` under `hardware` tab, expand Advanced settings and select `Enable nested virtualization`.
[![Enable nested virtualization for Parallels Desktop](images/parallels_enable_nested_virtualization.png)]
4. Enable kvm inside virtual machine
Run as an account other than root to install kvm packages using tce-load.
```bash
# su docker
$ tce-load -wi kvm
```
Run as root to load kvm module after kvm packages install.
```bash
$ sudo modprobe kvm_intel
```
Check if the kvm device is loaded.
```bash
$ ls /dev/kvm
```
Check if your CPU supports hardware virtualization now
```bash
$ egrep -c '(vmx|svm)' /proc/cpuinfo
```
If **0** it means that your CPU doesn't support hardware virtualization.
If **1** or more it does - but you still need to make sure that virtualization is enabled in the BIOS.
5. You may now run a docker container
Let's run a docker image for an emulator with x86 processor.
```bash
docker run --privileged -d -p 6080:6080 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" --name android-container butomo1989/docker-android-x86-7.1.1
```
When the services inside this docker container are running, connect to http://10.211.55.3:6080/vnc.html (the IP we got when the docker machine was created) and login. The emulator with x86 processor should be running on screen.
Troubleshooting
---------------
All logs inside container are stored under folder **/var/log/supervisor**. you can print out log file by using **docker exec**. Example:
@@ -214,7 +307,7 @@ Special Thanks
[emulator nexus]: <images/emulator_nexus_5.png>
[real device]: <images/real_device.png>
[compose]: <images/compose.png>
[line]: <https://github.com/butomo1989/docker-android/blob/master/docker-compose.yml#L30>
[line]: <https://github.com/butomo1989/docker-android/blob/master/docker-compose.yml#L70>
[example of compose file]: <docker-compose.yml>
[docker-compose]: <https://docs.docker.com/compose/install/>
[1.13.0]: <https://github.com/docker/compose/releases/tag/1.13.0>
+27 -9
View File
@@ -6,28 +6,46 @@ version: "2.2"
services:
# Selenium hub
selenium_hub:
image: selenium/hub:3.7.1
image: selenium/hub:3.11.0-bismuth
ports:
- "4444:4444"
# There is a bug for using appium. Issue: https://github.com/butomo1989/docker-android/issues/73
# Real devices
#real_device:
# image: butomo1989/docker-android-real-device
# privileged: true
# depends_on:
# - selenium_hub
# ports:
# - 6080:6080
# volumes:
# - ./video-real-device:/tmp/video
# - /dev/bus/usb:/dev/bus/usb
# - ~/.android:/root/.android
# environment:
# - CONNECT_TO_GRID=True
# - APPIUM=true
# - SELENIUM_HOST=selenium_hub
# - AUTO_RECORD=True
# - BROWSER_NAME=chrome
# Using Appium Docker Android
real_device:
image: butomo1989/docker-android-real-device
privileged: true
image: appium/appium
depends_on:
- selenium_hub
ports:
- 6080:6080
network_mode: "service:selenium_hub"
privileged: true
volumes:
- ./video-real-device:/tmp/video
- /dev/bus/usb:/dev/bus/usb
- ~/.android:/root/.android
- $PWD/example/sample_apk:/root/tmp
environment:
- CONNECT_TO_GRID=True
- APPIUM=true
- SELENIUM_HOST=selenium_hub
- AUTO_RECORD=True
- BROWSER_NAME=chrome
# Enable it for msite testing
#- BROWSER_NAME=chrome
# Docker-Android for Android application testing
nexus_7.1.1:
+1 -1
View File
@@ -1,4 +1,4 @@
FROM appium/appium:1.7.2-p1
FROM appium/appium:1.8.0-p0
LABEL maintainer "Budi Utomo <budi.ut.1989@gmail.com>"
+1 -1
View File
@@ -1,4 +1,4 @@
FROM appium/appium:1.7.2-p1
FROM appium/appium:1.8.0-p0
LABEL maintainer "Budi Utomo <budi.ut.1989@gmail.com>"
+1 -1
View File
@@ -1,4 +1,4 @@
FROM appium/appium:1.7.2-p1
FROM appium/appium:1.8.0-p0
LABEL maintainer "Budi Utomo <budi.ut.1989@gmail.com>"
Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 607 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 KiB