使用量angular器+ Appium + SauceLabs

我一直在尝试自动对移动我的量angular器testing。 我已经阅读了大部分的networking博客,我到达了这个与Saucelabs的Appium“官方”: https ://docs.saucelabs.com/tutorials/appium/#mobile-web-application我遵循指示在那里,并configuration我的config.js文件

 var testName = 'Testing'; //Change Project's name here in order to be identified in BrowserStack exports.config = { // The address of a running selenium server. seleniumAddress: 'http://bmsoko:[redacted]@ondemand.saucelabs.com:80/wd/hub', // Capabilities to be passed to the webdriver instance. multiCapabilities: [{ name: testName, 'appium-version': '1.4.0', 'browserName': 'Android', 'deviceName': 'Android Emulator', 'deviceOrientation': 'portrait', 'platform': 'Linux', 'version': '5.1', username: 'bmsoko', accessKey: '[redacted]' }], // Spec patterns are relative to the current working directly when // protractor is called. suites: { mobile: './././specs/mobile.js' }, // Maximum number of total browser sessions to run. Tests are queued in // sequence if number of browser sessions is limited by this parameter. // Use a number less than 1 to denote unlimited. Default is unlimited. maxSessions: 2, // protractor will save the test output in json format at this path. // The path is relative to the location of this config. resultJsonOutputFile: null, framework: 'jasmine2', // Options to be passed to Jasmine-node. jasmineNodeOpts: { showColors: true, defaultTimeoutInterval: 100000, realtimeFailure: true, showTiming: true, includeStackTrace: true, isVerbose: true, onComplete: null }, onPrepare: function () { //browser.driver.manage().window().maximize(); global.dvr = browser.driver; //variable to call selenium directly global.isAngularSite = function (flag) { browser.ignoreSynchronization = !flag; //This setup is to configure when testing non-angular pages }; browser.manage().timeouts().implicitlyWait(10000); browser.getCapabilities().then(function (cap) { browserName = cap.caps_.browserName; }); } }; 

这是我在testing中要做的事情(我知道这不是一个很好的testing,我只是想testingAppium的angular度应用程序):

 it('User should see module 1s elements on the web page', function () { browser.sleep(6000); browser.driver.findElement(by.css('.play__video')); }); 

但是当我运行我的testing,我一直得到这个错误的android:

编辑 :我可以看到网页正在打开。

Stack:Error:Failed:{“message”:“[$ injector:modulerr]由于以下原因无法实例化模块p:\ n错误:[$ injector:nomod]模块'p'不可用!忘了加载它,如果注册一个模块,确保你指定依赖关系作为第二个参数。\ nhttp://errors.angularjs.org/1.3.14/$injector/nomod?p0 = p \ n在http:// WEBAPPLICATION.com/assets/javascripts/global.js:107:21272\n at http://WEBAPPLICATIONs.com/assets/javascripts/global.js:107:29604\n at t(http://WEBAPPLICATION.com/资产/ Javascriptangular/ global.js:107:29176)\ n

我也试过这种情况:

 it('User should see module 1 s video start on the web page', function () { browser.wait(EC.visibilityOf(basePage.videoButtonModule1), 10000); basePage.videoButtonModule1.click(); expect(basePage.videoContainerModule1.isDisplayed()).toBeTruthy(); }); 

但为此我得到了上面的错误加上这个消息:

消息:失败:等待量angular器与页面同步时出错:“[ng:test]没有find元素参数的注入器getTestability \ nhttp://errors.angularjs.org/1.3.14/ng/test”

我究竟做错了什么???? 请helppppp!

编辑2 :分享我与iOS获得的错误

新的登陆页面模块validation – >用户应该看到模块1的video在网页上开始消息:失败:在页面上找不到angular度WEBAPP.com/:angular度从不提供resumeBootstrap堆栈:错误:失败:angular度不能在页面WEBAPP.com/上find:angular从未在[object object]处提供/usr/local/lib/node_modules/protractor/node_modules/jasminewd2/index.js:102:16处的resumeBootstrap.promise.ControlFlow.runInFrame_(/ usr / local / lib / usr / local / lib / node_modules / protractor / node_modules / selenium-webdriver / lib / webdriver / promise.js:1877:20) /node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:2464:25)[object object] .promise.Promise.notify_(/ usr / local / lib / node_modules / protractor / node_modules / selenium-的webdriver / LIB /的webdriver / promise.js:563:12)

我终于能够使它为我的testing工作,唯一的组合,就是魔术ONLY SAUCELABS

 multiCapabilities: [ { platformName: 'iOS', platformVersion: '7.1', browserName: '', app: 'safari', deviceName: 'iPhone Simulator', 'appium-version': "1.4.0", username: '<USERNAME>', accessKey: '<KEY>' } , { platformName: 'Android', platformVersion: '4.4', browserName: 'Browser', deviceName: 'Android Emulator', 'appium-version': "1.4.0", username: '<USERNAME>', accessKey: '<KEY>' } ], 

其他组合,而不是这些将不起作用,至less对我的应用程序。

我已经对我的原始问题发表了评论,希望他们能回答。

https://github.com/angular/protractor/issues/2247