Anda di halaman 1dari 3

Pruebas automatizadas sobre iOS (iPhone / iPad)

AUTOMATIZACIN PARA APLICACIONES MVILES

Es posible? Tal vez con el proyecto Appium (www.appium.io).

Appium es un marco de programacin de cdigo abierto de testeo automatizado para el uso


con aplicaciones nativas e hbridas. Todo esto sobre aplicaciones iOS y Android usando
WebDriver.

Se pueden automatizar las pruebas E2E a travs del navegador mvil de estos dispositivos?
En teora s

Appium is an open-source tool for automating native, mobile web, and hybrid applications on iOS
and Android platforms. Native apps are those written using the iOS or Android SDKs.Mobile web
apps are web apps accessed using a mobile browser (Appium supports Safari on iOS and Chrome or
the built-in 'Browser' app on Android). Hybrid apps have a wrapper around a "webview" -- a native
control that enables interaction with web content. Projects like Phonegap, make it easy to build
apps using web technologies that are then bundled into a native wrapper, creating a hybrid app.

Importantly, Appium is "cross-platform": it allows you to write tests against multiple platforms
(iOS, Android), using the same API. This enables code reuse between iOS and Android testsuites.

https://www.youtube.com/watch?t=1&v=oTIEt11cXNk

Ejemplo de automatizacin de app en iPhone con Apium


https://www.youtube.com/watch?v=eKhuF_4KzYo (en este ejemplo se utiliza Python).

AUTOMATIZACIN PARA APPS DE NAVEGADORES MVILES ESCRITAS EN ANGULARJS

Es posible? Protractor (el framework de test E2E para aplicaciones Angular) an no lo soporta
oficialmente. No obstante, en su documentacin propone unas configuraciones que podran
servir.

Setting Up Protractor with Appium -


iOS/Safari
Setup

Install Java SDK (>1.6) and configure JAVA_HOME (Important: make sure it's
not pointing to JRE).
Follow http://ant.apache.org/manual/index.html to install ant and set up the
environment.
Follow http://maven.apache.org/download.cgi to install mvn (Maven) and set up
the environment.
o NOTE: Appium suggests installing Maven 3.0.5 (I haven't tried later
versions, but 3.0.5 works for sure).
Install Appium using node npm install -g appium. Make sure you don't install
as sudo or else Appium will complain.
o You can do this either if you installed node without sudo, or you can
chown the global node_modules lib and bin directories.
Run the following: appium-doctor and authorize_ios (sudo if necessary)
You need XCode >= 4.6.3, 5.1.1 recommended. Note, iOS8 (XCode 6) did not
work off the shelf (seehttps://github.com/appium/appium/pull/3517) but this was
resolved soon after Oct 13, 2014

Running Tests

Ensure app is running if testing local app (Skip if testing public website):

> npm start # or `./scripts/web-server.js`


Starting express web server in /workspace/protractor/testapp on port 8000

Start Appium:

> appium
info: Welcome to Appium v1.0.0-beta.1 (REV
6fcf54391fb06bb5fb03dfcf1582c84a1d9838b6)
info: Appium REST http interface listener started on 0.0.0.0:4723
info: socket.io started
Note: Appium listens to port 4723 instead of 4444.

Configure protractor:

additional dependencies:
npm install --save-dev wd wd-bridge
iPhone:
exports.config = {
seleniumAddress: 'http://localhost:4723/wd/hub',

specs: [
'basic/*_spec.js'
],

// Reference: https://github.com/appium/sample-code/blob/master/sample-
code/examples/node/helpers/caps.js
capabilities: {
browserName: 'safari',
'appium-version': '1.0',
platformName: 'iOS',
platformVersion: '7.1',
deviceName: 'iPhone Simulator',
},

baseUrl: 'http://localhost:8000',

// configuring wd in onPrepare
// wdBridge helps to bridge wd driver with other selenium clients
// See https://github.com/sebv/wd-bridge/blob/master/README.md
onPrepare: function () {
var wd = require('wd'),
protractor = require('protractor'),
wdBridge = require('wd-bridge')(protractor, wd);
wdBridge.initFromProtractor(exports.config);
}
};
iPad:
exports.config = {
seleniumAddress: 'http://localhost:4723/wd/hub',

specs: [
'basic/*_spec.js'
],

// Reference: https://github.com/appium/sample-code/blob/master/sample-
code/examples/node/helpers/caps.js
capabilities: {
browserName: 'safari',
'appium-version': '1.0',
platformName: 'iOS',
platformVersion: '7.1',
deviceName: 'IPad Simulator',
},

baseUrl: 'http://localhost:8000',

// configuring wd in onPrepare
// wdBridge helps to bridge wd driver with other selenium clients
// See https://github.com/sebv/wd-bridge/blob/master/README.md
onPrepare: function () {
var wd = require('wd'),
protractor = require('protractor'),
wdBridge = require('wd-bridge')(protractor, wd);
wdBridge.initFromProtractor(exports.config);
}
};
Note the following:

note capabilities
baseUrl is localhost (not 10.0.2.2)
selenium address is using port 4723

Anda mungkin juga menyukai