Arquivo da tag: Appium

AngularJS – Using Protractor to Test Mobile Safari with Appium

package.json

{
  "name": "multiCapabilities",
  "version": "0.0.0",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "test-e2e": "protractor test/protractor.conf.js",
    "test-e2e-dev": "protractor test/protractor.conf.js --chrome",
    "test-e2e-ios": "protractor test/protractor.conf.js --ios"
  },
  "devDependencies": {
    "appium": "^1.2.0",
    "protractor": "^1.0.0"
  }
}

protractor.conf.js

var browsers = {
  firefox: {
    name: 'Firefox',
    browserName: 'firefox'
  },
  chrome: {
    name: 'Chrome',
    browserName: 'chrome'
  },
  ios: {
    name: 'iOS 7 - iPad',
    platformName: 'iOS',
    platformVersion: '7.1',
    deviceName: 'iPad Simulator',
    browserName: 'Safari',
    orientation: 'landscape'
  }
}

var config = {
  specs: [
    './e2e/**/*.spec.js'
  ],

  baseUrl: 'http://localhost:3333'
};

if (process.argv[3] === '--chrome') {
  config.capabilities = browsers.chrome;
} else if (process.argv[3] === '--ios') {
  config.seleniumAddress = 'http://localhost:4723/wd/hub';
  config.capabilities = browsers.ios;
} else {
  config.multiCapabilities = [
    browsers.firefox,
    browsers.chrome
  ]
}

exports.config = config;

Share and Enjoy !

0Shares
0


0