App did not get installed. Reason: 'Aborted '. Aborting! (RuntimeError) #docker

42 views
Skip to first unread message

Lakhdar Meftah

unread,
May 10, 2017, 3:31:56 AM5/10/17
to calabash-android
Hello,
I am running an Android emulator inside docker container, everything works well. I am trying to run calabash-android and I get this error :
# calabash-android run app-debug.apk 
Feature: Click items

  Scenario: Run whole app                                                          # features/radio_screenShots.feature:3
  com.bitbar.testdroid did not get installed. Reason: 'Aborted '. Aborting! (RuntimeError)
  ./features/support/app_installation_hooks.rb:18:in `Before'
  Will not start test server because of previous failures. (RuntimeError)
  ./features/support/app_life_cycle_hooks.rb:5:in `Before'
      #When I take a screenshot
      # Wait a bit to see landscape in screenshot
    Then I wait                                                                    # calabash-android-0.9.0/lib/calabash-android/steps/progress_steps.rb:5
      #Then I set landscape screen
      #Then I take a screenshot
      #Then I set portrait screen
    Then I press view with id "radio0"                                             # calabash-android-0.9.0/lib/calabash-android/steps/press_button_steps.rb:13
    Then I press view with id "radio1"                                             # calabash-android-0.9.0/lib/calabash-android/steps/press_button_steps.rb:13
    Then I press view with id "radio2"                                             # calabash-android-0.9.0/lib/calabash-android/steps/press_button_steps.rb:13
      #Then I take a screenshot
    Then I enter text "This is a test by Guillaume" into field with id "editText1" # calabash-android-0.9.0/lib/calabash-android/steps/enter_text_steps.rb:13
      #Then I take a screenshot
    Then I hide the keyboard                                                       # features/step_definitions/calabash_steps.rb:2
    Then I press view with id "button1"                                            # calabash-android-0.9.0/lib/calabash-android/steps/press_button_steps.rb:13
    Then I take a screenshot                                                       # calabash-android-0.9.0/lib/calabash-android/steps/screenshot_steps.rb:9
    Then I go back                                                                 # calabash-android-0.9.0/lib/calabash-android/steps/navigation_steps.rb:1
    Then I press view with id "radio1"                                             # calabash-android-0.9.0/lib/calabash-android/steps/press_button_steps.rb:13
    Then I press view with id "button1"                                            # calabash-android-0.9.0/lib/calabash-android/steps/press_button_steps.rb:13
    Then I take a screenshot                                                       # calabash-android-0.9.0/lib/calabash-android/steps/screenshot_steps.rb:9

Failing Scenarios:
cucumber features/radio_screenShots.feature:3 # Scenario: Run whole app

1 scenario (1 failed)
12 steps (12 skipped)
0m1.362s


The content of app_installation_hooks.rb : 
 cat features/support/app_
app_installation_hooks.rb  app_life_cycle_hooks.rb    
root@androfleet-node0:/newCalabash# cat features/support/app_installation_hooks.rb 
require 'calabash-android/management/app_installation'

AfterConfiguration do |config|
  FeatureMemory.feature = nil
end

Before do |scenario|
  scenario = scenario.scenario_outline if scenario.respond_to?(:scenario_outline)

  feature = scenario.feature
  if FeatureMemory.feature != feature || ENV['RESET_BETWEEN_SCENARIOS'] == '1'
    if ENV['RESET_BETWEEN_SCENARIOS'] == '1'
      log 'New scenario - reinstalling apps'
    else
      log 'First scenario in feature - reinstalling apps'
    end

    ensure_app_installed
    clear_app_data
    FeatureMemory.feature = feature
    FeatureMemory.invocation = 1
  else
    FeatureMemory.invocation += 1
  end
end

FeatureMemory = Struct.new(:feature, :invocation).new


The content of app_life_cycle_hooks.rb:
require 'calabash-android/management/adb'
require 'calabash-android/operations'

Before do |scenario|
  start_test_server_in_background
end

After do |scenario|
  if scenario.failed?
    screenshot_embed
  end
  shutdown_test_server
end


Android configuration:
Android-22, build-tools:21.1.1.

And finally I run the emulator with this command :
emulator64-x86 -avd Androidx86 -no-skin -no-audio -no-window -no-boot-anim -noskin -gpu off -port 5554 -no-cache  -memory 512 -partition-size 200 &

My Dockerfile :
FROM ubuntu:16.04

RUN apt-get update && apt-get -y install \
  openjdk-8-jdk \
  qemu-kvm \
  wget \
  lib32stdc++6 lib32z1 lib32z1-dev \
  && rm -rf /var/lib/apt/lists/*

  && tar xzf android-sdk_r24.4.1-linux.tgz \
  && rm -f android-sdk_r24.4.1-linux.tgz

ENV ANDROID_HOME /android-sdk-linux
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools

RUN echo y | android update sdk --filter platform-tools --no-ui -a
RUN echo y | android update sdk --filter android-22 --no-ui -a
RUN echo y | android update sdk --filter sys-img-x86-android-22 --no-ui -a
RUN echo y | android update sdk --filter build-tools-21.1.1 --no-ui -a
RUN echo y | android update adb

ENV PATH ${PATH}:${ANDROID_HOME}/build-tools/21.1.1

RUN echo no | android create avd -n Androidx86 -t android-22


RUN sed -i -e 's/hw.ramSize=2048/hw.ramSize=512/g' /root/.android/avd/Androidx86.avd/config.ini
RUN echo "disk.dataPartition.size=223m" >> /root/.android/avd/Androidx86.avd/config.ini

ENV ANDROID_HOME /android-sdk-linux
ENV ANDROID_JARS_PATH /android-sdk-linux/platforms/android-22/android.jar

RUN apt-get update && apt-get -y install \
  iproute2 \
  redir \
  telnet \
  unzip \
  ruby-full \
  && rm -rf /var/lib/apt/lists/*
RUN gem install calabash-android

Note: calabash-android build app-debug.apk successes to create test server.


Reply all
Reply to author
Forward
0 new messages