大佬教程收集整理的这篇文章主要介绍了angularjs – 量角器开关,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
这是我的测试:
describe("Harvest",function() { beforeEach(function () { browser.get('http://localhost:8110/'); expect(browser.getCurrentUrl()).toMatch('_*#/login$'); element(by.model('user.username')).sendKeys('sam'); element(by.model('user.password')).sendKeys('pass'); element(by.id('bt_signin')).click(); }); afterEach(function () { browser.executeScript('window.sessionStorage.clear();'); }); describe('A user',function () { beforeEach(function () { browser.get('http://localhost:8110/'); }); it('should be able to obtain an access token from harvest',function () { expect(browser.getCurrentUrl()).toMatch('_*#/home$'); //Display and close the window element(by.id('btHarvest')).click(); expect(element(by.id('modalHarvest')).isPresent()).toBe(true); element(by.id('btCloseModal')).click(); expect(element(by.id('modalHarvest')).isPresent()).toBe(false); //AuthenticatE into harvest element(by.id('btHarvest')).click(); expect(element(by.id('modalHarvest')).isPresent()).toBe(true); browser.switchTo().frame('iframeHarvest'); //It fails here with a null exceptions,guess it can't find it element(by.id('email')).sendKeys(browser.params.harvestLoginS.User); element(by.id('user_password')).sendKeys(browser.params.harvestLogins.password); element(by.id('sign-in-button')).click(); expect(element(by.name('commit')).isPresent()).toBe(true); browser.driver.switchTo().defaultContent(); }); }); });
这是生成的异常
1) Harvest A user should be able to obtain an access token from harvest message: [31mError: Error while waiTing for Protractor to sync with the page: {}[0m Stacktrace: Error: Error while waiTing for Protractor to sync with the page: {} at Error (<anonymous>) ==== async task ==== WebDriver.executeScript() at null.<anonymous> (/Users/samdurand/workspace/cake/subbie/src/test/web/js/features/harvest.js:45:22) ==== async task ==== Asynchronous test function: it() Error at null.<anonymous> (/Users/samdurand/workspace/cake/subbie/src/test/web/js/features/harvest.js:26:5) at null.<anonymous> (/Users/samdurand/workspace/cake/subbie/src/test/web/js/features/harvest.js:20:3) at Object.<anonymous> (/Users/samdurand/workspace/cake/subbie/src/test/web/js/features/harvest.js:1:63)
1) Projects A user is possible to create a project based on harvest data message: [31mError: Error while waiTing for Protractor to sync with the page: {}[0m Stacktrace: Error: Error while waiTing for Protractor to sync with the page: {} at Error (<anonymous>)
以上是大佬教程为你收集整理的angularjs – 量角器开关全部内容,希望文章能够帮你解决angularjs – 量角器开关所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。