diff --git a/Dockerfile b/Dockerfile index 51e56e2..5bf853f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -101,10 +101,10 @@ EXPOSE 6080 #================== COPY browser_apk /root/browser_apk -#==================== -# Add Emulator Skins -#==================== -COPY skins /root/skins +#====================== +# Add Emulator Devices +#====================== +COPY devices /root/devices #=================== # Run docker-appium diff --git a/README.md b/README.md index 3754c9a..7767865 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Docker is installed in your system. Features -------- -1. Android emulator with different devices / skins +1. Android emulator with different devices 2. noVNC 3. Appium server 4. Able to connect to selenium grid @@ -92,9 +92,11 @@ List of Devices For **EMULATOR_TYPE=x86** and android version < 5.0 this feature will be not available. +![][galaxy s6] ![][nexus 5] + Type | Device Name --- | --- -Phone | Galaxy Nexus +Phone | Samsung Galaxy S6 Phone | Nexus 4 Phone | Nexus 5 Phone | Nexus 5x @@ -107,8 +109,6 @@ Tablet | Nexus 7 Tablet | Nexus 9 Tablet | Nexus 10 -![][nexus 5] - Troubleshooting --------------- All logs inside container are stored under folder **/var/log/supervisor**. you can print out log file by using **docker exec**. Example: @@ -121,4 +121,5 @@ docker exec -it appium-container tail -f /var/log/supervisor/docker-appium.stdou [Appium is ready]: "appium is ready" [connect to grid 1]: [connect to grid 2]: +[galaxy s6]: [nexus 5]: diff --git a/devices/profiles/samsung_galaxy_s6.xml b/devices/profiles/samsung_galaxy_s6.xml new file mode 100644 index 0000000..fe7e3fb --- /dev/null +++ b/devices/profiles/samsung_galaxy_s6.xml @@ -0,0 +1,101 @@ + + + + Samsung Galaxy S6 + User + + + + large + 5.10 + hdpi + long + + 1440 + 2560 + + 575.92 + 575.92 + + jazz-hands + finger + capacitive + + + + Bluetooth + Wifi + NFC + + + Accelerometer + Barometer + Compass + GPS + Gyroscope + LightSensor + ProximitySensor + + true + + back + true + true + + + front + true + true + + qwerty + nonav + 3 + hard + + 4 + + + Generic CPU + Generic GPU + + armeabi-v7a + x86 + x86_64 + + + battery + + + - + true + + 2.0 + + false + + + The device in portrait orientation + port + keyshidden + navhidden + + + The device in landscape orientation + land + keyshidden + navhidden + + + The device in portrait orientation with a keyboard open + port + keysexposed + navhidden + + + The device in landscape orientation with a keyboard open + land + keysexposed + navhidden + + + diff --git a/skins/google/galaxy_nexus/land_back.png b/devices/skins/galaxy_nexus/land_back.png similarity index 100% rename from skins/google/galaxy_nexus/land_back.png rename to devices/skins/galaxy_nexus/land_back.png diff --git a/skins/google/galaxy_nexus/land_fore.png b/devices/skins/galaxy_nexus/land_fore.png similarity index 100% rename from skins/google/galaxy_nexus/land_fore.png rename to devices/skins/galaxy_nexus/land_fore.png diff --git a/skins/google/galaxy_nexus/land_shadow.png b/devices/skins/galaxy_nexus/land_shadow.png similarity index 100% rename from skins/google/galaxy_nexus/land_shadow.png rename to devices/skins/galaxy_nexus/land_shadow.png diff --git a/skins/google/galaxy_nexus/layout b/devices/skins/galaxy_nexus/layout similarity index 100% rename from skins/google/galaxy_nexus/layout rename to devices/skins/galaxy_nexus/layout diff --git a/skins/google/galaxy_nexus/port_back.png b/devices/skins/galaxy_nexus/port_back.png similarity index 100% rename from skins/google/galaxy_nexus/port_back.png rename to devices/skins/galaxy_nexus/port_back.png diff --git a/skins/google/galaxy_nexus/port_fore.png b/devices/skins/galaxy_nexus/port_fore.png similarity index 100% rename from skins/google/galaxy_nexus/port_fore.png rename to devices/skins/galaxy_nexus/port_fore.png diff --git a/skins/google/galaxy_nexus/port_shadow.png b/devices/skins/galaxy_nexus/port_shadow.png similarity index 100% rename from skins/google/galaxy_nexus/port_shadow.png rename to devices/skins/galaxy_nexus/port_shadow.png diff --git a/skins/google/galaxy_nexus/thumb.png b/devices/skins/galaxy_nexus/thumb.png similarity index 100% rename from skins/google/galaxy_nexus/thumb.png rename to devices/skins/galaxy_nexus/thumb.png diff --git a/skins/google/nexus_10/land_back.png b/devices/skins/nexus_10/land_back.png similarity index 100% rename from skins/google/nexus_10/land_back.png rename to devices/skins/nexus_10/land_back.png diff --git a/skins/google/nexus_10/land_fore.png b/devices/skins/nexus_10/land_fore.png similarity index 100% rename from skins/google/nexus_10/land_fore.png rename to devices/skins/nexus_10/land_fore.png diff --git a/skins/google/nexus_10/land_shadow.png b/devices/skins/nexus_10/land_shadow.png similarity index 100% rename from skins/google/nexus_10/land_shadow.png rename to devices/skins/nexus_10/land_shadow.png diff --git a/skins/google/nexus_10/layout b/devices/skins/nexus_10/layout similarity index 100% rename from skins/google/nexus_10/layout rename to devices/skins/nexus_10/layout diff --git a/skins/google/nexus_10/port_back.png b/devices/skins/nexus_10/port_back.png similarity index 100% rename from skins/google/nexus_10/port_back.png rename to devices/skins/nexus_10/port_back.png diff --git a/skins/google/nexus_10/port_fore.png b/devices/skins/nexus_10/port_fore.png similarity index 100% rename from skins/google/nexus_10/port_fore.png rename to devices/skins/nexus_10/port_fore.png diff --git a/skins/google/nexus_10/port_shadow.png b/devices/skins/nexus_10/port_shadow.png similarity index 100% rename from skins/google/nexus_10/port_shadow.png rename to devices/skins/nexus_10/port_shadow.png diff --git a/skins/google/nexus_10/thumb.png b/devices/skins/nexus_10/thumb.png similarity index 100% rename from skins/google/nexus_10/thumb.png rename to devices/skins/nexus_10/thumb.png diff --git a/skins/google/nexus_4/land_back.png b/devices/skins/nexus_4/land_back.png similarity index 100% rename from skins/google/nexus_4/land_back.png rename to devices/skins/nexus_4/land_back.png diff --git a/skins/google/nexus_4/land_fore.png b/devices/skins/nexus_4/land_fore.png similarity index 100% rename from skins/google/nexus_4/land_fore.png rename to devices/skins/nexus_4/land_fore.png diff --git a/skins/google/nexus_4/land_shadow.png b/devices/skins/nexus_4/land_shadow.png similarity index 100% rename from skins/google/nexus_4/land_shadow.png rename to devices/skins/nexus_4/land_shadow.png diff --git a/skins/google/nexus_4/layout b/devices/skins/nexus_4/layout similarity index 100% rename from skins/google/nexus_4/layout rename to devices/skins/nexus_4/layout diff --git a/skins/google/nexus_4/port_back.png b/devices/skins/nexus_4/port_back.png similarity index 100% rename from skins/google/nexus_4/port_back.png rename to devices/skins/nexus_4/port_back.png diff --git a/skins/google/nexus_4/port_fore.png b/devices/skins/nexus_4/port_fore.png similarity index 100% rename from skins/google/nexus_4/port_fore.png rename to devices/skins/nexus_4/port_fore.png diff --git a/skins/google/nexus_4/port_shadow.png b/devices/skins/nexus_4/port_shadow.png similarity index 100% rename from skins/google/nexus_4/port_shadow.png rename to devices/skins/nexus_4/port_shadow.png diff --git a/skins/google/nexus_4/thumb.png b/devices/skins/nexus_4/thumb.png similarity index 100% rename from skins/google/nexus_4/thumb.png rename to devices/skins/nexus_4/thumb.png diff --git a/skins/google/nexus_5/land_back.png b/devices/skins/nexus_5/land_back.png similarity index 100% rename from skins/google/nexus_5/land_back.png rename to devices/skins/nexus_5/land_back.png diff --git a/skins/google/nexus_5/land_fore.png b/devices/skins/nexus_5/land_fore.png similarity index 100% rename from skins/google/nexus_5/land_fore.png rename to devices/skins/nexus_5/land_fore.png diff --git a/skins/google/nexus_5/land_shadow.png b/devices/skins/nexus_5/land_shadow.png similarity index 100% rename from skins/google/nexus_5/land_shadow.png rename to devices/skins/nexus_5/land_shadow.png diff --git a/skins/google/nexus_5/layout b/devices/skins/nexus_5/layout similarity index 100% rename from skins/google/nexus_5/layout rename to devices/skins/nexus_5/layout diff --git a/skins/google/nexus_5/port_back.png b/devices/skins/nexus_5/port_back.png similarity index 100% rename from skins/google/nexus_5/port_back.png rename to devices/skins/nexus_5/port_back.png diff --git a/skins/google/nexus_5/port_fore.png b/devices/skins/nexus_5/port_fore.png similarity index 100% rename from skins/google/nexus_5/port_fore.png rename to devices/skins/nexus_5/port_fore.png diff --git a/skins/google/nexus_5/port_shadow.png b/devices/skins/nexus_5/port_shadow.png similarity index 100% rename from skins/google/nexus_5/port_shadow.png rename to devices/skins/nexus_5/port_shadow.png diff --git a/skins/google/nexus_5x/land_back.png b/devices/skins/nexus_5x/land_back.png similarity index 100% rename from skins/google/nexus_5x/land_back.png rename to devices/skins/nexus_5x/land_back.png diff --git a/skins/google/nexus_5x/land_fore.png b/devices/skins/nexus_5x/land_fore.png similarity index 100% rename from skins/google/nexus_5x/land_fore.png rename to devices/skins/nexus_5x/land_fore.png diff --git a/skins/google/nexus_5x/land_shadow.png b/devices/skins/nexus_5x/land_shadow.png similarity index 100% rename from skins/google/nexus_5x/land_shadow.png rename to devices/skins/nexus_5x/land_shadow.png diff --git a/skins/google/nexus_5x/layout b/devices/skins/nexus_5x/layout similarity index 100% rename from skins/google/nexus_5x/layout rename to devices/skins/nexus_5x/layout diff --git a/skins/google/nexus_5x/port_back.png b/devices/skins/nexus_5x/port_back.png similarity index 100% rename from skins/google/nexus_5x/port_back.png rename to devices/skins/nexus_5x/port_back.png diff --git a/skins/google/nexus_5x/port_fore.png b/devices/skins/nexus_5x/port_fore.png similarity index 100% rename from skins/google/nexus_5x/port_fore.png rename to devices/skins/nexus_5x/port_fore.png diff --git a/skins/google/nexus_5x/port_shadow.png b/devices/skins/nexus_5x/port_shadow.png similarity index 100% rename from skins/google/nexus_5x/port_shadow.png rename to devices/skins/nexus_5x/port_shadow.png diff --git a/skins/google/nexus_6/land_back.png b/devices/skins/nexus_6/land_back.png similarity index 100% rename from skins/google/nexus_6/land_back.png rename to devices/skins/nexus_6/land_back.png diff --git a/skins/google/nexus_6/land_fore.png b/devices/skins/nexus_6/land_fore.png similarity index 100% rename from skins/google/nexus_6/land_fore.png rename to devices/skins/nexus_6/land_fore.png diff --git a/skins/google/nexus_6/land_shadow.png b/devices/skins/nexus_6/land_shadow.png similarity index 100% rename from skins/google/nexus_6/land_shadow.png rename to devices/skins/nexus_6/land_shadow.png diff --git a/skins/google/nexus_6/layout b/devices/skins/nexus_6/layout similarity index 100% rename from skins/google/nexus_6/layout rename to devices/skins/nexus_6/layout diff --git a/skins/google/nexus_6/port_back.png b/devices/skins/nexus_6/port_back.png similarity index 100% rename from skins/google/nexus_6/port_back.png rename to devices/skins/nexus_6/port_back.png diff --git a/skins/google/nexus_6/port_fore.png b/devices/skins/nexus_6/port_fore.png similarity index 100% rename from skins/google/nexus_6/port_fore.png rename to devices/skins/nexus_6/port_fore.png diff --git a/skins/google/nexus_6/port_shadow.png b/devices/skins/nexus_6/port_shadow.png similarity index 100% rename from skins/google/nexus_6/port_shadow.png rename to devices/skins/nexus_6/port_shadow.png diff --git a/skins/google/nexus_6p/land_back.png b/devices/skins/nexus_6p/land_back.png similarity index 100% rename from skins/google/nexus_6p/land_back.png rename to devices/skins/nexus_6p/land_back.png diff --git a/skins/google/nexus_6p/land_fore.png b/devices/skins/nexus_6p/land_fore.png similarity index 100% rename from skins/google/nexus_6p/land_fore.png rename to devices/skins/nexus_6p/land_fore.png diff --git a/skins/google/nexus_6p/land_shadow.png b/devices/skins/nexus_6p/land_shadow.png similarity index 100% rename from skins/google/nexus_6p/land_shadow.png rename to devices/skins/nexus_6p/land_shadow.png diff --git a/skins/google/nexus_6p/layout b/devices/skins/nexus_6p/layout similarity index 100% rename from skins/google/nexus_6p/layout rename to devices/skins/nexus_6p/layout diff --git a/skins/google/nexus_6p/port_back.png b/devices/skins/nexus_6p/port_back.png similarity index 100% rename from skins/google/nexus_6p/port_back.png rename to devices/skins/nexus_6p/port_back.png diff --git a/skins/google/nexus_6p/port_fore.png b/devices/skins/nexus_6p/port_fore.png similarity index 100% rename from skins/google/nexus_6p/port_fore.png rename to devices/skins/nexus_6p/port_fore.png diff --git a/skins/google/nexus_6p/port_shadow.png b/devices/skins/nexus_6p/port_shadow.png similarity index 100% rename from skins/google/nexus_6p/port_shadow.png rename to devices/skins/nexus_6p/port_shadow.png diff --git a/skins/google/nexus_7/land_back.png b/devices/skins/nexus_7/land_back.png similarity index 100% rename from skins/google/nexus_7/land_back.png rename to devices/skins/nexus_7/land_back.png diff --git a/skins/google/nexus_7/land_fore.png b/devices/skins/nexus_7/land_fore.png similarity index 100% rename from skins/google/nexus_7/land_fore.png rename to devices/skins/nexus_7/land_fore.png diff --git a/skins/google/nexus_7/land_shadow.png b/devices/skins/nexus_7/land_shadow.png similarity index 100% rename from skins/google/nexus_7/land_shadow.png rename to devices/skins/nexus_7/land_shadow.png diff --git a/skins/google/nexus_7/layout b/devices/skins/nexus_7/layout similarity index 100% rename from skins/google/nexus_7/layout rename to devices/skins/nexus_7/layout diff --git a/skins/google/nexus_7/port_back.png b/devices/skins/nexus_7/port_back.png similarity index 100% rename from skins/google/nexus_7/port_back.png rename to devices/skins/nexus_7/port_back.png diff --git a/skins/google/nexus_7/port_fore.png b/devices/skins/nexus_7/port_fore.png similarity index 100% rename from skins/google/nexus_7/port_fore.png rename to devices/skins/nexus_7/port_fore.png diff --git a/skins/google/nexus_7/port_shadow.png b/devices/skins/nexus_7/port_shadow.png similarity index 100% rename from skins/google/nexus_7/port_shadow.png rename to devices/skins/nexus_7/port_shadow.png diff --git a/skins/google/nexus_7/thumb.png b/devices/skins/nexus_7/thumb.png similarity index 100% rename from skins/google/nexus_7/thumb.png rename to devices/skins/nexus_7/thumb.png diff --git a/skins/google/nexus_9/land_back.png b/devices/skins/nexus_9/land_back.png similarity index 100% rename from skins/google/nexus_9/land_back.png rename to devices/skins/nexus_9/land_back.png diff --git a/skins/google/nexus_9/land_fore.png b/devices/skins/nexus_9/land_fore.png similarity index 100% rename from skins/google/nexus_9/land_fore.png rename to devices/skins/nexus_9/land_fore.png diff --git a/skins/google/nexus_9/land_shadow.png b/devices/skins/nexus_9/land_shadow.png similarity index 100% rename from skins/google/nexus_9/land_shadow.png rename to devices/skins/nexus_9/land_shadow.png diff --git a/skins/google/nexus_9/layout b/devices/skins/nexus_9/layout similarity index 100% rename from skins/google/nexus_9/layout rename to devices/skins/nexus_9/layout diff --git a/skins/google/nexus_9/port_back.png b/devices/skins/nexus_9/port_back.png similarity index 100% rename from skins/google/nexus_9/port_back.png rename to devices/skins/nexus_9/port_back.png diff --git a/skins/google/nexus_9/port_fore.png b/devices/skins/nexus_9/port_fore.png similarity index 100% rename from skins/google/nexus_9/port_fore.png rename to devices/skins/nexus_9/port_fore.png diff --git a/skins/google/nexus_9/port_shadow.png b/devices/skins/nexus_9/port_shadow.png similarity index 100% rename from skins/google/nexus_9/port_shadow.png rename to devices/skins/nexus_9/port_shadow.png diff --git a/skins/google/nexus_one/button.png b/devices/skins/nexus_one/button.png similarity index 100% rename from skins/google/nexus_one/button.png rename to devices/skins/nexus_one/button.png diff --git a/skins/google/nexus_one/land_back.png b/devices/skins/nexus_one/land_back.png similarity index 100% rename from skins/google/nexus_one/land_back.png rename to devices/skins/nexus_one/land_back.png diff --git a/skins/google/nexus_one/land_shadow.png b/devices/skins/nexus_one/land_shadow.png similarity index 100% rename from skins/google/nexus_one/land_shadow.png rename to devices/skins/nexus_one/land_shadow.png diff --git a/skins/google/nexus_one/layout b/devices/skins/nexus_one/layout similarity index 100% rename from skins/google/nexus_one/layout rename to devices/skins/nexus_one/layout diff --git a/skins/google/nexus_one/port_back.png b/devices/skins/nexus_one/port_back.png similarity index 100% rename from skins/google/nexus_one/port_back.png rename to devices/skins/nexus_one/port_back.png diff --git a/skins/google/nexus_one/port_shadow.png b/devices/skins/nexus_one/port_shadow.png similarity index 100% rename from skins/google/nexus_one/port_shadow.png rename to devices/skins/nexus_one/port_shadow.png diff --git a/skins/google/nexus_one/power.png b/devices/skins/nexus_one/power.png similarity index 100% rename from skins/google/nexus_one/power.png rename to devices/skins/nexus_one/power.png diff --git a/skins/google/nexus_one/power_land.png b/devices/skins/nexus_one/power_land.png similarity index 100% rename from skins/google/nexus_one/power_land.png rename to devices/skins/nexus_one/power_land.png diff --git a/skins/google/nexus_one/thumb.png b/devices/skins/nexus_one/thumb.png similarity index 100% rename from skins/google/nexus_one/thumb.png rename to devices/skins/nexus_one/thumb.png diff --git a/skins/google/nexus_one/volume_down.png b/devices/skins/nexus_one/volume_down.png similarity index 100% rename from skins/google/nexus_one/volume_down.png rename to devices/skins/nexus_one/volume_down.png diff --git a/skins/google/nexus_one/volume_down_land.png b/devices/skins/nexus_one/volume_down_land.png similarity index 100% rename from skins/google/nexus_one/volume_down_land.png rename to devices/skins/nexus_one/volume_down_land.png diff --git a/skins/google/nexus_one/volume_up.png b/devices/skins/nexus_one/volume_up.png similarity index 100% rename from skins/google/nexus_one/volume_up.png rename to devices/skins/nexus_one/volume_up.png diff --git a/skins/google/nexus_one/volume_up_land.png b/devices/skins/nexus_one/volume_up_land.png similarity index 100% rename from skins/google/nexus_one/volume_up_land.png rename to devices/skins/nexus_one/volume_up_land.png diff --git a/skins/google/nexus_s/button.png b/devices/skins/nexus_s/button.png similarity index 100% rename from skins/google/nexus_s/button.png rename to devices/skins/nexus_s/button.png diff --git a/skins/google/nexus_s/land_back.png b/devices/skins/nexus_s/land_back.png similarity index 100% rename from skins/google/nexus_s/land_back.png rename to devices/skins/nexus_s/land_back.png diff --git a/skins/google/nexus_s/land_fore.png b/devices/skins/nexus_s/land_fore.png similarity index 100% rename from skins/google/nexus_s/land_fore.png rename to devices/skins/nexus_s/land_fore.png diff --git a/skins/google/nexus_s/land_shadow.png b/devices/skins/nexus_s/land_shadow.png similarity index 100% rename from skins/google/nexus_s/land_shadow.png rename to devices/skins/nexus_s/land_shadow.png diff --git a/skins/google/nexus_s/layout b/devices/skins/nexus_s/layout similarity index 100% rename from skins/google/nexus_s/layout rename to devices/skins/nexus_s/layout diff --git a/skins/google/nexus_s/port_back.png b/devices/skins/nexus_s/port_back.png similarity index 100% rename from skins/google/nexus_s/port_back.png rename to devices/skins/nexus_s/port_back.png diff --git a/skins/google/nexus_s/port_fore.png b/devices/skins/nexus_s/port_fore.png similarity index 100% rename from skins/google/nexus_s/port_fore.png rename to devices/skins/nexus_s/port_fore.png diff --git a/skins/google/nexus_s/port_shadow.png b/devices/skins/nexus_s/port_shadow.png similarity index 100% rename from skins/google/nexus_s/port_shadow.png rename to devices/skins/nexus_s/port_shadow.png diff --git a/skins/google/nexus_s/power.png b/devices/skins/nexus_s/power.png similarity index 100% rename from skins/google/nexus_s/power.png rename to devices/skins/nexus_s/power.png diff --git a/skins/google/nexus_s/power_land.png b/devices/skins/nexus_s/power_land.png similarity index 100% rename from skins/google/nexus_s/power_land.png rename to devices/skins/nexus_s/power_land.png diff --git a/skins/google/nexus_s/thumb.png b/devices/skins/nexus_s/thumb.png similarity index 100% rename from skins/google/nexus_s/thumb.png rename to devices/skins/nexus_s/thumb.png diff --git a/skins/google/nexus_s/volume_down.png b/devices/skins/nexus_s/volume_down.png similarity index 100% rename from skins/google/nexus_s/volume_down.png rename to devices/skins/nexus_s/volume_down.png diff --git a/skins/google/nexus_s/volume_down_land.png b/devices/skins/nexus_s/volume_down_land.png similarity index 100% rename from skins/google/nexus_s/volume_down_land.png rename to devices/skins/nexus_s/volume_down_land.png diff --git a/skins/google/nexus_s/volume_up.png b/devices/skins/nexus_s/volume_up.png similarity index 100% rename from skins/google/nexus_s/volume_up.png rename to devices/skins/nexus_s/volume_up.png diff --git a/skins/google/nexus_s/volume_up_land.png b/devices/skins/nexus_s/volume_up_land.png similarity index 100% rename from skins/google/nexus_s/volume_up_land.png rename to devices/skins/nexus_s/volume_up_land.png diff --git a/skins/google/pixel_c/land_back.png b/devices/skins/pixel_c/land_back.png similarity index 100% rename from skins/google/pixel_c/land_back.png rename to devices/skins/pixel_c/land_back.png diff --git a/skins/google/pixel_c/land_fore.png b/devices/skins/pixel_c/land_fore.png similarity index 100% rename from skins/google/pixel_c/land_fore.png rename to devices/skins/pixel_c/land_fore.png diff --git a/skins/google/pixel_c/land_shadow.png b/devices/skins/pixel_c/land_shadow.png similarity index 100% rename from skins/google/pixel_c/land_shadow.png rename to devices/skins/pixel_c/land_shadow.png diff --git a/skins/google/pixel_c/layout b/devices/skins/pixel_c/layout similarity index 100% rename from skins/google/pixel_c/layout rename to devices/skins/pixel_c/layout diff --git a/skins/google/pixel_c/port_back.png b/devices/skins/pixel_c/port_back.png similarity index 100% rename from skins/google/pixel_c/port_back.png rename to devices/skins/pixel_c/port_back.png diff --git a/skins/google/pixel_c/port_fore.png b/devices/skins/pixel_c/port_fore.png similarity index 100% rename from skins/google/pixel_c/port_fore.png rename to devices/skins/pixel_c/port_fore.png diff --git a/skins/google/pixel_c/port_shadow.png b/devices/skins/pixel_c/port_shadow.png similarity index 100% rename from skins/google/pixel_c/port_shadow.png rename to devices/skins/pixel_c/port_shadow.png diff --git a/devices/skins/samsung_galaxy_s6/S6_Land.png b/devices/skins/samsung_galaxy_s6/S6_Land.png new file mode 100755 index 0000000..10b3092 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/S6_Land.png differ diff --git a/devices/skins/samsung_galaxy_s6/S6_Port.png b/devices/skins/samsung_galaxy_s6/S6_Port.png new file mode 100755 index 0000000..f110515 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/S6_Port.png differ diff --git a/devices/skins/samsung_galaxy_s6/arrow_down.png b/devices/skins/samsung_galaxy_s6/arrow_down.png new file mode 100755 index 0000000..2d58468 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/arrow_down.png differ diff --git a/devices/skins/samsung_galaxy_s6/arrow_left.png b/devices/skins/samsung_galaxy_s6/arrow_left.png new file mode 100755 index 0000000..b2f0139 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/arrow_left.png differ diff --git a/devices/skins/samsung_galaxy_s6/arrow_right.png b/devices/skins/samsung_galaxy_s6/arrow_right.png new file mode 100755 index 0000000..05df3a1 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/arrow_right.png differ diff --git a/devices/skins/samsung_galaxy_s6/arrow_up.png b/devices/skins/samsung_galaxy_s6/arrow_up.png new file mode 100755 index 0000000..4555581 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/arrow_up.png differ diff --git a/devices/skins/samsung_galaxy_s6/button.png b/devices/skins/samsung_galaxy_s6/button.png new file mode 100755 index 0000000..0e66abb Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/button.png differ diff --git a/devices/skins/samsung_galaxy_s6/controls.png b/devices/skins/samsung_galaxy_s6/controls.png new file mode 100755 index 0000000..04b85e2 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/controls.png differ diff --git a/devices/skins/samsung_galaxy_s6/hardware.ini b/devices/skins/samsung_galaxy_s6/hardware.ini new file mode 100755 index 0000000..ef402b1 --- /dev/null +++ b/devices/skins/samsung_galaxy_s6/hardware.ini @@ -0,0 +1,21 @@ +hw.lcd.density=200 + +hw.trackBall = no + +hw.keyboard = yes + +hw.dPad = no + +hw.camera = yes + +hw.gps = yes + +hw.battery = yes + +hw.accelerometer = yes + +hw.sdCard = yes + +hw.touchScreen = yes + +hw.gsmModem = yes \ No newline at end of file diff --git a/devices/skins/samsung_galaxy_s6/key-num.png b/devices/skins/samsung_galaxy_s6/key-num.png new file mode 100755 index 0000000..ecb8d9a Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/key-num.png differ diff --git a/devices/skins/samsung_galaxy_s6/key.png b/devices/skins/samsung_galaxy_s6/key.png new file mode 100755 index 0000000..e7354e2 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/key.png differ diff --git a/devices/skins/samsung_galaxy_s6/key2.png b/devices/skins/samsung_galaxy_s6/key2.png new file mode 100755 index 0000000..88ded28 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/key2.png differ diff --git a/devices/skins/samsung_galaxy_s6/keyboard.png b/devices/skins/samsung_galaxy_s6/keyboard.png new file mode 100755 index 0000000..c484a35 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/keyboard.png differ diff --git a/devices/skins/samsung_galaxy_s6/land-button1.png b/devices/skins/samsung_galaxy_s6/land-button1.png new file mode 100755 index 0000000..1053c24 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/land-button1.png differ diff --git a/devices/skins/samsung_galaxy_s6/land-button2.png b/devices/skins/samsung_galaxy_s6/land-button2.png new file mode 100755 index 0000000..9b62cce Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/land-button2.png differ diff --git a/devices/skins/samsung_galaxy_s6/land-button3.png b/devices/skins/samsung_galaxy_s6/land-button3.png new file mode 100755 index 0000000..3901850 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/land-button3.png differ diff --git a/devices/skins/samsung_galaxy_s6/layout b/devices/skins/samsung_galaxy_s6/layout new file mode 100755 index 0000000..5c2be14 --- /dev/null +++ b/devices/skins/samsung_galaxy_s6/layout @@ -0,0 +1,459 @@ +parts { + portrait { + background { + image S6_Port.png + } + buttons { + soft-left { + image port-button1.png + x 131 + y 1015 + } + home { + image port-button2.png + x 240 + y 1006 + } + back { + image port-button3.png + x 431 + y 1015 + } + } + } + landscape { + background { + image S6_Land.png + } + buttons { + soft-left { + image land-button1.png + x 1019 + y 411 + } + home { + image land-button2.png + x 1010 + y 222 + } + back { + image land-button3.png + x 1021 + y 113 + } + } + } + + device { + display { + width 474 + height 839 + x 0 + y 0 + } + } + + controls { + background { + image controls.png + } + buttons { + soft-left { + image button.png + x 61 + y 147 + } + home { + image button.png + x 5 + y 147 + } + back { + image button.png + x 117 + y 147 + } + dpad-up { + image arrow_up.png + x 77 + y 53 + } + dpad-down { + image arrow_down.png + x 77 + y 106 + } + dpad-left { + image arrow_left.png + x 53 + y 53 + } + dpad-right { + image arrow_right.png + x 123 + y 53 + } + dpad-center { + image select.png + x 77 + y 81 + } + phone-dial { + image button.png + x 5 + y 76 + } + phone-hangup { + image button.png + x 173 + y 76 + } + + power { + image button.png + x 173 + y 5 + } + + volume-up { + image button.png + x 117 + y 5 + } + + volume-down { + image button.png + x 61 + y 5 + } + + search { + image button.png + x 173 + y 147 + } + + } + } + + keyboard { + background { + image keyboard.png + } + buttons { + 1 { + image key-num.png + x 6 + y 3 + } + 2 { + image key-num.png + x 44 + y 3 + } + 3 { + image key-num.png + x 82 + y 3 + } + 4 { + image key-num.png + x 120 + y 3 + } + 5 { + image key-num.png + x 158 + y 3 + } + 6 { + image key-num.png + x 196 + y 3 + } + 7 { + image key-num.png + x 234 + y 3 + } + 8 { + image key-num.png + x 272 + y 3 + } + 9 { + image key-num.png + x 309 + y 3 + } + 0 { + image key-num.png + x 348S + y 3 + } + + q { + image key.png + x 6 + y 23 + } + w { + image key.png + x 44 + y 23 + } + e { + image key.png + x 82 + y 23 + } + r { + image key.png + x 120 + y 23 + } + t { + image key.png + x 158 + y 23 + } + y { + image key.png + x 196 + y 23 + } + u { + image key.png + x 234 + y 23 + } + i { + image key.png + x 272 + y 23 + } + o { + image key.png + x 310 + y 23 + } + p { + image key.png + x 347 + y 23 + } + + a { + image key.png + x 25 + y 47 + } + s { + image key.png + x 63 + y 47 + } + d { + image key.png + x 101 + y 47 + } + f { + image key.png + x 139 + y 47 + } + g { + image key.png + x 177 + y 47 + } + h { + image key.png + x 215 + y 47 + } + j { + image key.png + x 253 + y 47 + } + k { + image key.png + x 291 + y 47 + } + l { + image key.png + x 329 + y 47 + } + + + CAP { + image key2.png + x 5 + y 71 + } + z { + image key.png + x 63 + y 71 + } + x { + image key.png + x 101 + y 71 + } + c { + image key.png + x 139 + y 71 + } + v { + image key.png + x 177 + y 71 + } + b { + image key.png + x 215 + y 71 + } + n { + image key.png + x 253 + y 71 + } + m { + image key.png + x 291 + y 71 + } + DEL { + image key2.png + x 329 + y 71 + } + + SYM { + image key2.png + x 6 + y 95 + } + T { + image key.png + x 63 + y 95 + } + SPACE { + image spacebar.png + x 100 + y 95 + } + PERIOD { + image key.png + x 291 + y 95 + } + NEXT { + image key2.png + x 329 + y 95 + } + + + + + + + } + } +} + +layouts { + portrait { + width 1000 + height 1100 + color 0xe0e0e0 + event EV_SW:0:1 + + part1 { + name portrait + x 0 + y 0 + } + + part2 { + name landscape + x 1000 + y 0 + } + + part3 { + name device + x 57 + y 133 + } + part4 { + name controls + x 691 + y 266 + } + part5 { + name keyboard + x 608 + y 649 + } + + } + + landscape { + width 1100 + height 1000 + color 0xe0e0e0 + event EV_SW:0:0 + + dpad-rotation 3 + + part1 { + name portrait + x 950 + y 0 + } + + part2 { + name landscape + x 0 + y 0 + } + + part3 { + name device + x 134 + y 516 + rotation 3 + } + + part4 { + name controls + x 720 + y 716 + } + + part5 { + name keyboard + x 89 + y 716 + } + } +} + +keyboard { + charmap qwerty2 +} + +network { + speed full + delay none +} diff --git a/devices/skins/samsung_galaxy_s6/manifest.ini b/devices/skins/samsung_galaxy_s6/manifest.ini new file mode 100755 index 0000000..cb41aad --- /dev/null +++ b/devices/skins/samsung_galaxy_s6/manifest.ini @@ -0,0 +1,12 @@ +name=note_4 +vendor=Samsung Electronics Co., Inc. +description=WVGA Android 2.3 device without physical keyboard and three way navigation. + +# default skin +skin=S6 + +# version of the Android platform on which this add-on is built. +api=9 + +# revision of the add-on +revision=1 diff --git a/devices/skins/samsung_galaxy_s6/port-button1.png b/devices/skins/samsung_galaxy_s6/port-button1.png new file mode 100755 index 0000000..7d227e3 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/port-button1.png differ diff --git a/devices/skins/samsung_galaxy_s6/port-button2.png b/devices/skins/samsung_galaxy_s6/port-button2.png new file mode 100755 index 0000000..c3fbd0a Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/port-button2.png differ diff --git a/devices/skins/samsung_galaxy_s6/port-button3.png b/devices/skins/samsung_galaxy_s6/port-button3.png new file mode 100755 index 0000000..d45fb2d Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/port-button3.png differ diff --git a/devices/skins/samsung_galaxy_s6/power_l.png b/devices/skins/samsung_galaxy_s6/power_l.png new file mode 100755 index 0000000..64ba7d9 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/power_l.png differ diff --git a/devices/skins/samsung_galaxy_s6/power_p.png b/devices/skins/samsung_galaxy_s6/power_p.png new file mode 100755 index 0000000..b56ed21 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/power_p.png differ diff --git a/devices/skins/samsung_galaxy_s6/select.png b/devices/skins/samsung_galaxy_s6/select.png new file mode 100755 index 0000000..cc8ce3e Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/select.png differ diff --git a/devices/skins/samsung_galaxy_s6/spacebar.png b/devices/skins/samsung_galaxy_s6/spacebar.png new file mode 100755 index 0000000..d37a446 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/spacebar.png differ diff --git a/devices/skins/samsung_galaxy_s6/volume_down_l.png b/devices/skins/samsung_galaxy_s6/volume_down_l.png new file mode 100755 index 0000000..3dd8d70 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/volume_down_l.png differ diff --git a/devices/skins/samsung_galaxy_s6/volume_down_p.png b/devices/skins/samsung_galaxy_s6/volume_down_p.png new file mode 100755 index 0000000..896f304 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/volume_down_p.png differ diff --git a/devices/skins/samsung_galaxy_s6/volume_up_l.png b/devices/skins/samsung_galaxy_s6/volume_up_l.png new file mode 100755 index 0000000..9865108 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/volume_up_l.png differ diff --git a/devices/skins/samsung_galaxy_s6/volume_up_p.png b/devices/skins/samsung_galaxy_s6/volume_up_p.png new file mode 100755 index 0000000..6301477 Binary files /dev/null and b/devices/skins/samsung_galaxy_s6/volume_up_p.png differ diff --git a/devices/skins/source.txt b/devices/skins/source.txt new file mode 100644 index 0000000..87b7839 --- /dev/null +++ b/devices/skins/source.txt @@ -0,0 +1,3 @@ +Sources: +1. Android Studio IDE +2. http://developer.samsung.com/technical-doc/view.do?v=T000000095 \ No newline at end of file diff --git a/images/appium_with_selenium_grid_01.png b/images/appium_with_selenium_grid_01.png index 9e00dbc..d291181 100644 Binary files a/images/appium_with_selenium_grid_01.png and b/images/appium_with_selenium_grid_01.png differ diff --git a/images/appium_with_selenium_grid_02.png b/images/appium_with_selenium_grid_02.png index 28f4fc2..3eb4907 100644 Binary files a/images/appium_with_selenium_grid_02.png and b/images/appium_with_selenium_grid_02.png differ diff --git a/images/run_under_galaxy_s6.png b/images/run_under_galaxy_s6.png new file mode 100644 index 0000000..7515474 Binary files /dev/null and b/images/run_under_galaxy_s6.png differ diff --git a/images/run_under_nexus_5.png b/images/run_under_nexus_5.png index 86f7457..b9ade69 100644 Binary files a/images/run_under_nexus_5.png and b/images/run_under_nexus_5.png differ diff --git a/skins/google/source.txt b/skins/google/source.txt deleted file mode 100644 index 4d5d74e..0000000 --- a/skins/google/source.txt +++ /dev/null @@ -1 +0,0 @@ -copied from Android Studio IDE \ No newline at end of file diff --git a/src/__init__.py b/src/__init__.py index 511707c..c4ddef8 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -1,5 +1,6 @@ import os +ROOT = '/root' WORKDIR = os.path.dirname(__file__) CONFIG_FILE = os.path.join(WORKDIR, 'nodeconfig.json') LOGGING_FILE = os.path.join(WORKDIR, 'logging.conf') diff --git a/src/android.py b/src/android.py index 6a59481..e5ad488 100644 --- a/src/android.py +++ b/src/android.py @@ -14,6 +14,34 @@ TYPE_X86_64 = 'x86_64' API_LEVEL_ANDROID_5 = 21 +def get_available_sdk_packages(): + """ + Get list of available sdk packages. + + :return: List of available packages. + :rtype: bytearray + """ + logger.info('List of Android SDK: ') + output_str = subprocess.check_output('android list sdk'.split()) + logger.info(output_str) + return [output.strip() for output in output_str.split('\n')] if output_str else None + + +def get_item_position(keyword, items): + """ + Get position of item in array by given keyword. + + :return: item position + :rtype: int + """ + pos = 0 + for p, v in enumerate(items): + if keyword in v: + pos = p + break # Get the first item that match with keyword + return pos + + def get_api_level(android_version): """ Get api level of android version. @@ -72,7 +100,7 @@ def install_package(android_path, emulator_file, api_level, sys_img): titel=titel, cmd=cmd), shell=True) -def create_avd(android_path, device, skin, avd_name, sys_img, api_level): +def create_avd(android_path, device, avd_name, api_level): """ Create android virtual device. @@ -80,62 +108,43 @@ def create_avd(android_path, device, skin, avd_name, sys_img, api_level): :type android_path: str :param device: name of device :type device: str - :param skin: emulator skin that want to be used - :type skin: str :param avd_name: desire name :type avd_name: str - :param sys_img: system image - :type sys_img: str :param api_level: api level :type api_level: str """ - # Bug: cannot use skin for system image x86 with android version < 5.0 - if sys_img == TYPE_X86: - cmd = 'echo no | android create avd -f -n {name} -t android-{api}'.format(name=avd_name, api=api_level) - else: + # Create android emulator + cmd = 'echo no | android create avd -f -n {name} -t android-{api}'.format(name=avd_name, api=api_level) + if device != 'emulator': # Link emulator skins - skins_rsc = os.path.join(android_path, 'skins') - skins_dst = os.path.join(android_path, 'platforms', 'android-{api}'.format(api=api_level), 'skins') + from src import ROOT + skin_rsc_path = os.path.join(ROOT, 'devices', 'skins') + logger.info('Skin ressource path: {rsc}'.format(rsc=skin_rsc_path)) - for provider in os.listdir(skins_rsc): - provider_devices = os.path.join(skins_rsc, provider) - for device in os.listdir(provider_devices): - os.symlink(os.path.join(provider_devices, device), os.path.join(skins_dst, device)) + skin_dst_path = os.path.join(android_path, 'platforms', 'android-{api}'.format(api=api_level), 'skins') + logger.info('Skin destination path: {dst}'.format(dst=skin_dst_path)) - # Create android emulator - cmd = 'echo no | android create avd -f -n {name} -t android-{api}'.format(name=avd_name, api=api_level) - if device and skin: - cmd += ' -d {device} -s {skin}'.format(device=device.replace(' ', '\ '), skin=skin) + for s in os.listdir(skin_rsc_path): + os.symlink(os.path.join(skin_rsc_path, s), os.path.join(skin_dst_path, s)) + + # Hardware and its skin + device_name_bash = device.replace(' ', '\ ') + skin_name = device.replace(' ', '_').lower() + logger.info('device name in bash: {db}, skin name: {skin}'.format(db=device_name_bash, skin=skin_name)) + + # For custom hardware profile + profile_dst_path = os.path.join(ROOT, '.android', 'devices.xml') + if 'samsung' in device.lower(): + # profile file name = skin name + profile_src_path = os.path.join(ROOT, 'devices', 'profiles', '{profile}.xml'.format(profile=skin_name)) + logger.info('Hardware profile resource path: {rsc}'.format(rsc=profile_src_path)) + logger.info('Hardware profile destination path: {dst}'.format(dst=profile_dst_path)) + os.symlink(profile_src_path, profile_dst_path) + + # append command + cmd += ' -d {device} -s {skin}'.format(device=device_name_bash, skin=skin_name) logger.info('AVD creation command: {cmd}'.format(cmd=cmd)) titel = 'AVD creation process' subprocess.check_call('xterm -T "{titel}" -n "{titel}" -e \"{cmd}\"'.format( titel=titel, cmd=cmd), shell=True) - - -def get_available_sdk_packages(): - """ - Get list of available sdk packages. - - :return: List of available packages. - :rtype: bytearray - """ - logger.info('List of Android SDK: ') - output_str = subprocess.check_output('android list sdk'.split()) - logger.info(output_str) - return [output.strip() for output in output_str.split('\n')] if output_str else None - - -def get_item_position(keyword, items): - """ - Get position of item in array by given keyword. - - :return: item position - :rtype: int - """ - pos = 0 - for p, v in enumerate(items): - if keyword in v: - pos = p - break # Get the first item that match with keyword - return pos diff --git a/src/service.py b/src/service.py index 5f6413d..846f5c7 100644 --- a/src/service.py +++ b/src/service.py @@ -11,42 +11,48 @@ def start(): Installation of needed sdk package, creation of android emulator and execution of appium server. """ - # Get all needed environment variables + # Android SDK path android_path = os.getenv('ANDROID_HOME', '/root') logger.info('Android path: {path}'.format(path=android_path)) - emulator_type = os.getenv('EMULATOR_TYPE', android.TYPE_ARMEABI).lower() - logger.info('Emulator type: {type}'.format(type=emulator_type)) + + # Emulator informations + emu_type = os.getenv('EMULATOR_TYPE', android.TYPE_ARMEABI).lower() + emu_type = android.TYPE_ARMEABI if emu_type not in [android.TYPE_ARMEABI, android.TYPE_X86] else \ + emu_type + logger.info('Emulator type: {type}'.format(type=emu_type)) + emu_file = 'emulator64-x86' if emu_type == android.TYPE_X86 else 'emulator64-arm' + logger.info('Emulator file: {file}'.format(file=emu_file)) + + # Device name + device = os.getenv('DEVICE', 'Nexus 5') + + # Android version android_version = os.getenv('ANDROID_VERSION', '4.2.2') logger.info('Android version: {version}'.format(version=android_version)) + + # Selenium grid connection connect_to_grid = str_to_bool(str(os.getenv('CONNECT_TO_GRID', False))) logger.info('Connect to selenium grid? {input}'.format(input=connect_to_grid)) - # Install needed sdk packages - emulator_type = android.TYPE_ARMEABI if emulator_type not in [android.TYPE_ARMEABI, android.TYPE_X86] else \ - emulator_type - emulator_file = 'emulator64-x86' if emulator_type == android.TYPE_X86 else 'emulator64-arm' - logger.info('Emulator file: {file}'.format(file=emulator_file)) + # Install android sdk package api_level = android.get_api_level(android_version) - device_name = os.getenv('DEVICE', 'Nexus 5') - logger.info('Device: {device}'.format(device=device_name)) - skin_name = device_name.replace(' ', '_').lower() - logger.info('Skin: {skin}'.format(skin=skin_name)) - if emulator_type == android.TYPE_X86: + # Bug: cannot use skin for system image x86 with android version < 5.0 + if emu_type == android.TYPE_X86: if int(api_level) < android.API_LEVEL_ANDROID_5: sys_img = android.TYPE_X86 - skin_name = 'emulator' + device = 'emulator' else: sys_img = android.TYPE_X86_64 else: sys_img = '{type}-v7a'.format(type=android.TYPE_ARMEABI) - logger.info('System image: {sys_img}'.format(sys_img=sys_img)) - android.install_package(android_path, emulator_file, api_level, sys_img) + android.install_package(android_path, emu_file, api_level, sys_img) # Create android virtual device - avd_name = '{device}_{version}'.format(device=skin_name, version=android_version) + logger.info('Device: {device}'.format(device=device)) + avd_name = '{device}_{version}'.format(device=device.replace(' ', '_').lower(), version=android_version) logger.info('AVD name: {avd}'.format(avd=avd_name)) - android.create_avd(android_path, device_name, skin_name, avd_name, sys_img, api_level) + android.create_avd(android_path, device, avd_name, api_level) # Run appium server appium.run(connect_to_grid, avd_name, android_version) diff --git a/src/tests/android/test_create_avd.py b/src/tests/android/test_create_avd.py index 0e13422..ad584d5 100644 --- a/src/tests/android/test_create_avd.py +++ b/src/tests/android/test_create_avd.py @@ -6,36 +6,43 @@ import mock from src import android -@mock.patch('os.symlink') @mock.patch('subprocess.check_call') +@mock.patch('os.symlink') class TestAvd(TestCase): """Unit test class to test method create_avd.""" def setUp(self): self.android_path = '/root' - self.device = 'Nexus\ 5' - self.skin = 'nexus_5' - self.avd_name = 'nexus_5_5.0' + self.avd_name = 'test_avd' self.api_level = 21 - def test_avd_creation_x86_64(self, mocked_sys_link, mocked_suprocess): + def test_nexus_avd(self, mocked_suprocess, mocked_sys_link): with mock.patch('os.listdir') as mocked_list_dir: mocked_list_dir.return_value = ['file1', 'file2'] self.assertFalse(mocked_list_dir.called) self.assertFalse(mocked_sys_link.called) self.assertFalse(mocked_suprocess.called) - android.create_avd(self.android_path, self.device, self.skin, self.avd_name, android.TYPE_X86_64, - self.api_level) + android.create_avd(self.android_path, 'Nexus 5', self.avd_name, self.api_level) self.assertTrue(mocked_list_dir.called) self.assertTrue(mocked_sys_link.called) self.assertTrue(mocked_suprocess.called) - def test_avd_creation_x86(self, mocked_sys_link, mocked_suprocess): + def test_samsung_avd(self, mocked_suprocess, mocked_sys_link): with mock.patch('os.listdir') as mocked_list_dir: mocked_list_dir.return_value = ['file1', 'file2'] self.assertFalse(mocked_list_dir.called) self.assertFalse(mocked_sys_link.called) self.assertFalse(mocked_suprocess.called) - android.create_avd(self.android_path, self.device, self.skin, self.avd_name, android.TYPE_X86, - self.api_level) + android.create_avd(self.android_path, 'Samsung Galaxy S6', self.avd_name, self.api_level) + self.assertTrue(mocked_list_dir.called) + self.assertTrue(mocked_sys_link.called) + self.assertTrue(mocked_suprocess.called) + + def test_default_avd(self, mocked_suprocess, mocked_sys_link): + with mock.patch('os.listdir') as mocked_list_dir: + mocked_list_dir.return_value = ['file1', 'file2'] + self.assertFalse(mocked_list_dir.called) + self.assertFalse(mocked_sys_link.called) + self.assertFalse(mocked_suprocess.called) + android.create_avd(self.android_path, 'emulator', self.avd_name, self.api_level) self.assertFalse(mocked_list_dir.called)