Giter Site home page Giter Site logo

real_devices_tests's Introduction

Introduction

A try out for using nightwatch+magellan FTW (native mobile app automation test + mobile web automation test + desktop web automation test)

Installation

$ npm install
# if you want to run app test, run following commands too
$ npm install [email protected]
$ npm install wd

Usage

run tests:

To run in local

# Run native app test
### iOS
$ npm run test:ios

### Android
$ AVD_NAME=${YOUR_AVD} npm run android:launch
$ npm run test:android

# Run mobile web test
$ ./node_modules/.bin/magellan --serial  --max_test_attempts 1 --local_browser appiummweb --test tests/demo-mweb.js --sync_browsers safari,iphone,ipad

# Run desktop web test
$ ./node_modules/.bin/magellan --serial  --max_test_attempts 1 --local_browser chrome --test tests/demo-web.js

To run on Saucelabs

NOTE: before run the app test on saucelabs, you need to

  • for iOS
    • zip ./app/yourapp.app with zip -r app/yourapp.zip app/yourapp.app
    • upload ./app/yourapp.zip to saucelabs via following curl
  • for Android
    • upload ./app/yourapp.apk to saucelabs via following curl (replace .zip with .apk)
$ curl -u ${SAUCE_USERNAME}:${SAUCE_ACCESS_KEY} -X POST "http://saucelabs.com/rest/v1/storage/${SAUCE_USERNAME}/yourapp.zip?overwrite=true" -H "Content-Type: application/octet-stream" --data-binary @./app/yourapp.zip
# Run native app test
### iOS
$ DPRO=ios ./node_modules/.bin/magellan --nightwatch_config conf/nightwatch.json --profile appium-ios-app --test tests/demo-app.js --serial --max_test_attempts=1

### Android
$ DPRO=android ./node_modules/.bin/magellan --nightwatch_config conf/nightwatch.json --profile appium-android-app --test tests/demo-app.js --serial --max_test_attempts=1


# Run mobile web test
$ ./node_modules/.bin/magellan --nightwatch_config conf/nightwatch.json --max_test_attempts=1 --profile appium-ios-browser --test=tests/demo-mweb.js --serial --max_test_attempts=1


# Run desktop web test
$ ./node_modules/.bin/magellan --nightwatch_config conf/nightwatch.json --max_test_attempts=1 --profile <http url to the profile> --test=tests/demo-web.js --serial --max_test_attempts=1

run app tests with wd:

follow steps

  1. pull latest master
  2. npm install to install latest [email protected]
  3. npm install wd since wd is in optionalDependencies
  4. mkdir ./lib/custom_commands/wd
  5. ./node_modules/.bin/owl --output ./lib/custom_commands/wd --config ./conf/nightwatch.json

Check if wd*.js files are created in ./lib/custom_commands/wd. If so, run following command.

DPRO=ios ./node_modules/.bin/magellan --local_browser appiumiosapp  --test tests/demo-app.wd.js --max_test_attempts 1  --serial

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.