在IE量angular器Asyc错误

我目前正在尝试testing下面的代码片段:

<footer class="footer"> <div class="container"> <div class="row"> <form subscribe-directive="" ng-controller="SubscribeController" class="form col-xs-12 col-sm-8 col-md-6 col-lg-4 ng-scope ng-dirty ng-valid ng-valid-email"> <h3 class="footer__title text-uppercase margin-bottom-25">Sign up!</h3> <div class="row"> <div class="col-sm-8 col-xs-7"> <input type="email" class="form-control ng-touched ng-dirty ng-valid ng-valid-email" ng-disabled="working || subscription.done" placeholder="Email Address" ng-model="subscription.email"> </div> <div class="col-sm-4 col-xs-5"> <button ng-click="submit(subscription.email)" ng-disabled="working || !subscription.email || subscription.done" ng-class="{'working': working}" class="btn btn--inverse btn-red form-control" type="submit" disabled="disabled"> <span ng-bind-html="submitBtn" class="ng-binding">SUBSCRIBE</span> </button> </div> </div> <p ng-show="callback_message" class="msg ng-binding ng-hide" ng-bind-html="callback_message"></p> </form> <nav class="col-xs-12 col-md-6 col-lg-offset-2"> <ul class="nav navbar-nav navbar-right margin-bottom-25"> <li><a href="/press">Press</a> </li> <li><a href="/news">News</a> </li> <li><a href="/contact">Contact Us</a> </li> <li><a target="_blank" href="//test.com/en">Test Project</a> </li> </ul> <ul class="nav navbar-nav navbar-right"> <li class="footer__social-icon"> <a target="_blank" href="https://www.facebook.com/"><i class="fa fa-facebook"></i></a> </li> <li class="footer__social-icon"> <a target="_blank" href="https://twitter.com/"><i class="fa fa-twitter"></i></a> </li> <li class="footer__social-icon"> <a target="_blank" href="https://www.youtube.com/user/"><i class="fa fa-youtube"></i></a> </li> </ul> </nav> </div> <div class="row"> <div class="col-xs-12 col-sm-6 copy"> <a href="/privacy">Privacy Policy</a> <br> Copyright &copy; Test-inc. All Rights Reserved. </div> <div class="col-xs-12 col-sm-6 text-right copy"> <br> Microsoft Ventures. Supported by Microsoft Ventures London Accelerator </div> </div> </div> </footer> 

但是当我做了以下的行动:

 it('User should see a message that he has already been added to the campaing when entering the same email twice', function () { browser.executeScript("window.scrollBy(0,10000)"); basePage.email.sendKeys('bruno@test.com'); basePage.subscribe.click().then(function () { browser.sleep(7000); basePage.confirmMessage('Contact already added to target campaign'); }); 

在我的basePage上:

 //this.email = element(by.model('subscription.email')); this.email = element(by.xpath('/html/body/footer/div/div[1]/form/div/div[1]/input')); this.waitlistBtn = element.all(by.binding('submitBtn')); this.subscribe = element(by.buttonText('SUBSCRIBE')); 

我一直得到follwing错误(我正在运行它对BrowserStack):

 Failures: 1) New Landing page module verification --> User should be correctly added to the update list Message: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. Stack: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. at Timer.listOnTimeout (timers.js:110:15) 

这是我的configuration的一部分:

 { name: testName, browserName: 'IE', browser_version: '11.0', os: 'Windows', os_version: '8.1', resolution: '2048x1536', 'browserstack.user': browserstackUser, 'browserstack.key': browserstackKey, 'browserstack.debug': 'true', 'browserstack.selenium_version': '2.45.0', 'browserstack.ie.driver': '2.44', ignoreProtectedModeSettings: true } onPrepare: function () { jasmine.getEnv().addReporter(reporter); 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().pageLoadTimeout(90000); browser.manage().timeouts().implicitlyWait(100000); } 

我必须澄清,它不会发生在IE浏览器的其他testing,它只发生在位于页脚的这部分。

你能帮忙吗? 你有什么build议吗? 或者你能看到我做错了什么?

谢谢。-

由于我有很多问题要避免使用ASync,因此我决定避免使用IE浏览器。 我做了以下:

 it('User should see a message that he has already been added to the campaing when entering the same email twice', function () { browser.getCapabilities().then(function (capabilities) { browser = capabilities.caps_.browserName; platform = capabilities.caps_.platform; }).then(function () { console.log('Browser:', browser, 'on platform', platform); if (browser == 'internet explorer') { console.log('IE Was avoided for this test.'); } else { basePage.email.sendKeys('bruno@test.com'); console.log('Mande el mail'); basePage.subscribe.click().then(function () { basePage.confirmMessage('Contact already added to target campaign'); }); } }); }); 

请读者如果有更好的解决scheme,请发表。