离子框架 - 使用量角器和ios仿真器进行e2e测试

eNd*_*ddy 9 selenium hybrid-mobile-app appium protractor ionic-framework

我有一个使用Ionic框架的混合应用程序构建,并希望使用量角器在模拟器上进行测试.如何设置使用量角器在模拟器上运行测试?

这是我到目前为止所尝试的:

1)我的所有测试都在浏览器中运行良好.

2)安装Appium(http://appium.io/)

3)修改了我的protractor.config.js文件:

exports.config = {
  seleniumAddress: 'http://localhost:4723/wd/hub',

   specs: [
     'e2e/*_spec.coffee'
    ],

   capabilities: {
     browserName: '',
     'appium-version': '1.3',
      platformName: 'iOS',
      platform: 'Mac',
      platformVersion: '8.2',
      deviceName: 'iPhone 5s',
     app: 'absolute_path/platforms/ios/build/emulator/taco.app'
   },

   baseUrl: 'http://localhost:8100',
 };
Run Code Online (Sandbox Code Playgroud)

这将启动模拟器,但不会运行测试.这是一个示例规范......

describe 'Taco', ->
  describe 'Login', ->
    beforeEach ->
      browser.get('http://localhost:8100')
      browser.executeScript('window.localStorage.clear();')
      browser.waitForAngular()

    it 'should login with valid credentials', ->
      expect(element(By.css('.home-template')).isPresent()).toBe(true)

      element(By.linkText('I have an account')).click()
      element(By.model('credentials.email')).sendKeys('taco1@taco.com')
Run Code Online (Sandbox Code Playgroud)