All Projects → appcelerator-archive → appium-tests

appcelerator-archive / appium-tests

Licence: other
Tool to run Titanium mobile tests in Appium

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to appium-tests

Robotframework Appiumlibrary
AppiumLibrary is an appium testing library for RobotFramework
Stars: ✭ 259 (+1626.67%)
Mutual labels:  test-automation, appium
Unium
Automation for Unity games
Stars: ✭ 132 (+780%)
Mutual labels:  test-automation, appium
Carina
Carina automation framework: Web, Mobile, API, DB
Stars: ✭ 549 (+3560%)
Mutual labels:  test-automation, appium
carina
Carina automation framework: Web, Mobile, API, DB etc testing...
Stars: ✭ 652 (+4246.67%)
Mutual labels:  test-automation, appium
SHAFT ENGINE
SHAFT is an MIT licensed test automation engine. Powered by best-in-class frameworks like Selenium WebDriver, Appium & RestAssured it provides a wizard-like syntax to increase productivity, and built-in wrappers to eliminate boilerplate code and to ensure your tests are extra stable and your results are extra reliable.
Stars: ✭ 170 (+1033.33%)
Mutual labels:  test-automation, appium
MAQS
Magenic's automation quick start
Stars: ✭ 46 (+206.67%)
Mutual labels:  test-automation, appium
Coteafs Appium
📱 Wrapper Appium Framework in Java which supports Automation of Mobile and Tablet apps.
Stars: ✭ 93 (+520%)
Mutual labels:  test-automation, appium
MasterAppiumFramework
Automation Testing | Mobile | Java | OOPS | Appium | TestNG | Maven | ExtentReport | Java mail API | Logging (Log4J2) | Design Patterns (Page Object Model, Singleton) | Page Factories | Jenkins | Data-Driven Testing using JSON file | Expected Data using XML file
Stars: ✭ 27 (+80%)
Mutual labels:  test-automation, appium
Telegraf-Test
Telegraf Test - Simple Test ToolKit of Telegram Bots
Stars: ✭ 22 (+46.67%)
Mutual labels:  mocha, test-automation
Winappdriver
Windows Application Driver
Stars: ✭ 2,577 (+17080%)
Mutual labels:  test-automation, appium
Mobileautomationframework
Single code base framework to test android and iOS app using appium (v6.1.0), maven, testng,java. Option to start appium server programmatically.
Stars: ✭ 66 (+340%)
Mutual labels:  test-automation, appium
tropic
🍍 Test Runner Library
Stars: ✭ 29 (+93.33%)
Mutual labels:  mocha, test-automation
Cerberus Source
User-friendly automated testing framework.
Stars: ✭ 172 (+1046.67%)
Mutual labels:  test-automation, appium
qa-automation-base
There are basic projects for automation frameworks based on Kotlin/Java and TypeScript for the backend, frontend, and mobile.
Stars: ✭ 45 (+200%)
Mutual labels:  mocha, appium
Grunt Mocha
[MOVED] Grunt task for running mocha specs in a headless browser (PhantomJS)
Stars: ✭ 371 (+2373.33%)
Mutual labels:  mocha, test-automation
fetch-action-creator
Fetches using standardized, four-part asynchronous actions for redux-thunk.
Stars: ✭ 28 (+86.67%)
Mutual labels:  mocha
xappium.uitest
Xappium.UITest is a UITest helper framework built on top of Appium. This aims at making it easier to write and run UI Tests.
Stars: ✭ 60 (+300%)
Mutual labels:  appium
node-mocha-extjs
Framework for testing ExtJs applications
Stars: ✭ 19 (+26.67%)
Mutual labels:  mocha
chai-exclude
Exclude keys to compare from a deep equal operation with chai expect or assert.
Stars: ✭ 33 (+120%)
Mutual labels:  mocha
vividus-starter
VIVIDUS-based test project template
Stars: ✭ 43 (+186.67%)
Mutual labels:  test-automation

appium-tests

Tool to run Titanium mobile tests in Appium.

Caveats

Setup

  1. Make sure you have node >= 4 and npm >= 3.
  2. In this directory, run npm install.
  3. Next, install appium-doctor: [sudo] npm install -g appium-doctor.
  4. Run appium-doctor to ensure your machine is properly setup for appium testing.

Flag Usage

  • node run.js

    • Run all tests in the tests directory.
  • node run.js --suites <suites>

    • Run only the specified test suites e.g.
    node run.js --suites Slider/ios.js -> run only the iOS Slider test suite
    
    node run.js --suites Slider/ios.js,Slider/android.js -> run both the iOS and Android slider test suites.
    
  • node run.js --suites <suites> --use-sdk <ti_sdk>

    • Before running the specified test suites, rebuild the test app with the specified ti_sdk.
    • This probably won't be useful if you are running this on your local machine. But, will be useful in a Jenkins build.
  • node run.js --suites <suites> --more-logs

    • Run the specified test suites with logs enabled; this can become very noisy.
  • Below is the complete list of flags:

    Options:
    
    	-h, --help          output usage information
    	--suites <suites>   comma-delimited string of valid test suites; otherwise, run all tests
    	--use-sdk <ti_sdk>  build all test apps with the specified Titanium SDK
    	--more-logs         enables more logging; this becomes very noisy
    

How to Write Tests

1. Test Suite Structure

All test suites live in the tests directory and should have the following folder structure:

tests/
|--- suite_name/
	 |--- test_app/
	 |--- platform.js
	 |--- platform2.js
...

Info:

  • suite_name should be an API supported by Titanium SDK or Hyperloop e.g. Slider.
  • test_app should be a Titanium Classic, Alloy, or Hyperloop enabled project.
  • platform.js is a mocha file that will execute test cases (via Appium) in the test_app on the designated mobile platform.
  • It's important that the platform.js file name is a valid platform (ios.js or android.js), since it tells this tool which mobile platform to use when: installing the test_app and running the tests.

2. test_config.js

The test_config.js file (which lives at the root of this project) contains information about all the test suites and which Appium server to connect to.

High-level notes:

module.exports = {
	// this will connect to the local running appium server; you can leave as-is
	server: {
		host: 'localhost',
		port: 4723
	},

	// this tracks all the test suites (per platform) in the 'tests' directory
	tests: {
		ios: {

			// these are properties straight from appium and more are defined here:
			// https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/default-capabilities-arg.md
			desiredCapabilities: {
				automationName: 'XCUITest' // leave as-is for ios
			},

			// the suite_name folder should exist in the 'tests' directory
			suite_name: {
				proj: 'SAMPLE', // name of the 'test_app'

				// list of simulators you want the test app to run against
				testDevices: [
					{
						deviceName: 'iPhone 7 Plus', // the simulator created in xcode
						platformVersion: '10.2' // the platform version associated with the simulator
					},
					...
				]
			},

			suite_name2: { ... }
			...
		},

		android: {
			desiredCapabilities: {
				automationName: 'Appium' // leave as-is for android
			},
			suite_name: {
				proj: 'SAMPLE',

				// these two properties are needed when testing against android
				appPackage: 'com.company.name',
				appActivity: '.SomeActivity',

				// list of genymotion emulators you want the test app to run against
				testDevices: [
					{
						deviceName: 'Custom Phone - 6.0.0 - API 23 - 768x1280', // the genymotion emulator created in the genymotion app
						platformVersion: '6.0' // the platform version associated with the emulator
					},
					...
				]
			}
		}

		// other platforms can be added in the future
	}
};

Actual:

module.exports = {
	server: {
		host: 'localhost',
		port: 4723
	},
	tests: {
		ios: {
			desiredCapabilities: {
				automationName: 'XCUITest',
				noReset: true
			},
			Slider: {
				proj: 'KitchenSink',
				testDevices: [
					{
						deviceName: 'iPhone 7 Plus',
						platformVersion: '10.2'
					},
					{
						deviceName: 'iPhone 7',
						platformVersion: '10.1'
					}
				]
			}
		},
		android: {
			desiredCapabilities: {
				automationName: 'Appium',
				noReset: true
			},
			Slider: {
				proj: 'KitchenSink',
				appPackage: 'com.appcelerator.kitchensink',
				appActivity: '.KitchensinkActivity',
				testDevices: [
					{
						deviceName: 'Custom Phone - 6.0.0 - API 23 - 768x1280',
						platformVersion: '6.0'
					},
					{
						deviceName: 'Custom Phone - 7.0.0 - API 24 - 768x1280',
						platformVersion: '7.0'
					}
				]
			}
		}
	}
};

3. Mocha Files

To write the Appium test cases, you will need to be familiar with mocha and Promises. Look at https://github.com/appcelerator/qe-appium/tree/master/test for examples.

Couple notes about those examples vs these test suites:

Main Loop

run.js is the entry point file and contains the main loop, which does the following:

  1. runAppium() - launches the local Appium server.
  2. buildTestApps() - if --use-sdk flag is passed, then build all the test apps before moving onto the next task.
  3. createTests() - create a data structure from --suites and loop through the data structure. While looping:
  4. launchGeny() - if the test app needs to be tested on an Android platform, launch the designated Genymotion emulator first. iOS simulators will be launched in the next step by Appium.
  5. startClient() - after the simulator/genymotion is launched, install the test app to the device and connect to the Appium local server.
  6. new Mocha().addFile().run() - run the associated mocha test suite.
  7. stopClient() - after a mocha test suite is finished running, disconnect the mobile device from the Appium local server. Depending on the desiredCapabilities, iOS simulators can be left running or killed.
  8. quitGeny() - if a Genymotion emulator is launched, gracefully kill the process.
  9. killAppium() - after all the test suites are executed, kill the Appium local server.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].