Tuesday 7 May 2013

Appium - Installation


There are some notice when playing with Appium. Take care of it:
  1. Appium:
    • Newly automation testing open source, we don't have a lot of tutorials about it
  2. Using Virtual Machine:
    • We should get a little unknown bugs and don't know how to fixed them:
      • assert
      • swipe
      • module
  3. Install nopejs:
    1. Option 1:
      • Simply go go: http://nodejs.org/
      • Click install for download pkg package
      • Install the file
    2. Option 2:
  4. Install appium server:
    1. Option 1:
      • Git appium project: https://github.com/appium/appium
      • ./reset.sh
      • Create bin file:
        • chmod +x /path/to/appium/app/bin.js
        • cd /usr/local/bin/
        • ln -s /path/to/appium/app/bin.js appium
        • ln -s /path/to/appium/instruments/client_bin.js instruments_client
    2. Option 2:
      • sudo npm install appium -g
        • This command will download and added modules for nodejs at:
          • /usr/local/lib/node_modules/appium
          • /usr/local/lib/node_modules/instruments
      • Also create bin file at:
        • /usr/local/bin/appium
        • /usr/local/bin/instruments_client
    3. Option 2:
      • npm install appium
        • This command will download and create appium project folder
      • Create bin file:
        • chmod +x /path/to/appium/app/bin.js
        • cd /usr/local/bin/
        • ln -s /path/to/appium/app/bin.js appium
        • ln -s /path/to/appium/instruments/client_bin.js instruments_client
  5. Install mocha & grunt modules:
    1. Option 1:
      • sudo npm install mocha -g
      • sudo npm install grunt-cli -g
      • This command will download and added modules for nodejs at:
        • /usr/local/lib/node_modules/_mocha
        • /usr/local/lib/node_modules/mocha
        • /usr/local/lib/node_modules/grunt-cli
      • Also create bin file at:
        • /usr/local/bin/_mocha
        • /usr/local/bin/mocha
        • /usr/local/bin/grunt
    2. Option 2:
      • npm install mocha
      • npm install grunt-cli
        • This command will download and create mocha & grunt-cli modules folder
      • Create bin file:
        • cd /usr/local/bin/
        • ln -s /path/to/mocha/bin/_mocha _mocha
        • ln -s /path/to/mocha/bin/mocha mocha
        • ln -s /path/to/grunt-cli/bin/grunt grunt
  6. Small test for appium:
  7. Build nodejs modules folder for Appium:
    • Git project folder from GitHub: https://github.com/appium/appium
      • Make sure you get all files and folders in there, because we have another 2 small projects in appium git:
        • submodules:
          • appium.io
          • instruments-without-delay
    • Install nodejs modules:
      • cd appium
      • npm install mocha
      • npm install grunt-cli
      • npm install
        • This command will using package.json file
  8. Create .app file for test:
    • Using Xcode:
      • Go to your iOS project folder
        • xcodebuild -sdk iphonesimulator6.0
    • Using grunt:
      • Stay at root folder of appium source
        • grunt buildApp:<AppName>:<SDK>
        • grunt buildApp:TestApp:iphonesimulator6.0
    • The .app file should in "build/Release-iphonesimulator" folder in iOS project
  9. How to use grunt:
  10. Some popular issues:
    1. Fatal error: Could not find Android SDK, make sure to export ANDROID_HOME
    2. ReferenceError: describe is not defined
      • We must using mocha function all times

Good luck!

No comments:

Post a Comment