- Install Node.js >= v0.12.2 and npm
- Install node package dependencies:
$ npm install
Note: For the first time running the tests:
- You may want to check your appium setup by running:
node ./node_modules/appium/bin/appium-doctor.js
- And you will see popup "Instruments wants permission to analyze other processes." You need to allow access. You need to do this every time you install a new version of Xcode.
./node_modules/.bin/appium
# Run test by test case name:
./node_modules/.bin/mocha test/memo/script/ -g 'C0001'
# Run all the tests:
./node_modules/.bin/mocha test/memo/script/
https://github.com/TestArmada/magellan
.
└── iOSApp-Automation
├── README.md
├── common
│ └── mocha_rerun.js
├── config
│ ├── default.json
│ └── logging.js
│ └── testData.json
├── package.json
└──── test
├── mocha.opts
└── memo
├── module
│ └── memoModule.js
└── script
└── memo.js
- default.json (/config) is the setup for Local appium server, Testing app and Desired capabilities that will be sent to Appium server. Settings in this file could be set as runtime variables.
- Test scripts (test cases) could group by test flow similarity.
- For every test script, there is a matching module file (test/memo/module/) for locators and libraries reused.
- Libraries that are shared for all the module files are in common.js (/common).
- In common.js, there is an AppiumDriver constructor, it has bindModule method to bind libraries from module files.
- When create new test script, you want to create a new object of the AppiumDriver, and bind the module file(s) that will be needed for the tests. e.g.
before(function() {
appiumDriver = new AppiumDriver(Config.localServer);
appiumDriver.bindModule(SigninModule);
});