chenchaoyi / iOSApp_AppiumAutomation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quint Appium iOS App Automation

sample test demo:

Setup

$ npm install

Run tests

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.

start Appium server:

./node_modules/.bin/appium

execute tests:

# 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/

TODO: Magellan Integration

https://github.com/TestArmada/magellan

About the tests

file structure, e.g:

.
└── 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);
    });

About


Languages

Language:JavaScript 98.5%Language:Shell 1.5%