在使用Protractor端到端测试运行测试Angular应用时。我目前正面临一个问题。这是一个间歇性问题。我收到“JavascriptError:javascripterror:documentunloadedwhilewaitingresult”。日志如下:Failures:[18:51:46][Step4/4]1)vacanciesshouldcreatenewjoblisting[18:51:46][Step4/4]Message:[18:51:46][Step4/4][31mFailed:javascripterror:documentunloadedwhilewaiting
这是HTML代码:这是我的代码:browser.wait(function(){returnelement(by.id('.filepicker_dialog_container')).isPresent();}).then(function(){browser.driver.switchTo().frame('.filepicker_dialog');}).then(function(){varfileToUpload='/home/raghavendra/Desktop/f0657c76d96b9ddab5562b8391297dbbb01488fec4e79a4c13195aea
这是我的弹出框,当你将鼠标悬停在它上面时会弹出:这是将弹出窗口添加到DOM之前html的样子:AirportFee 这是之后弹出窗口可见:AirportFee 4,90€forallridestoandfromtheairport我想测试文本是否不为空。在我的测试中,我正在检查所有往返机场的行程是否有类似4,90€的字符串。此字符串不能为空。这是我的带有正则表达式的Protractor配置文件的一部分,用于检查元素是否为空以及浏览器在检查之前应等待多长时间:params:{regexNotEmpty:'^(?!\s*$).+',sleepTimeout:1000},
我的计划是将用户名和密码存储为系统环境变量,并在AngularjsProtractor配置文件中引用它们。我在/etc/environment中定义了变量。到目前为止,这是我尝试过的:params:{login:{user:$E2E_USER,pass:$E2E_PASS}}我也试过这个:params:{login:{user:process.env.E2E_USER,pass:process.env.E2E_PASS}}如有任何帮助,我们将不胜感激! 最佳答案 我使用了exportE2E_USER=username并且成功了。
我试图确保在单击某个跨度时页面滚动到某个元素。所以我需要检查元素的y位置。有人可以解释我如何获得元素的位置吗?element.all(by.css('[scroll-to="section-executive-summary-anchor"]')).then(function(elem){elem[0].click().then(function(){element(by.id('section-executive-summary-anchor')).then(function(el){//Ineed"el.position"orsomethingalongthoselines});}
我是Protractor的新手,我正在尝试测试弹出事件,这是我的代码:describe('popoverdirective',function(){varbuttons=element.all(by.tagName('button'));it('shouldshowthepopovertitlebyclicking',function(){varpopTitle="testTitle";varpopContent="testContent";element(by.model('title')).clear().sendKeys(popTitle);element(by.model('c
我有一个SPA,其中有多个具有相同类的div。我希望Protractor选择可见的div并单击它。我一直收到Failed:elementnotvisible这让人相信它正在获取一些不在这个特定页面上的元素(也许?)。我还收到WARNING-morethanoneelementfoundforlocatorBy.cssSelector('.myDiv')-第一个结果将被使用这再次让我认为它不是点击可见的,而是点击不可见的一个。这是我的规范:describe('Useractions',function(){it("shouldbeabletoclickamydiv.",function(
我在selenium网格上运行的e2e测试遇到了问题。有时测试失败是因为Error:Timeout-Asynccallbackwasnotinvokedwithintimeoutspecifiedbyjasmine.DEFAULT_TIMEOUT_INTERVAL.试图以某种方式解决它,将defaultTimeoutInterval更改为protracotr.conf.js中的更高值,但结果等待时间更长,但错误是相同的。exports.config={chromeOnly:true,chromeDriver:'../node_modules/.bin/chromedriver',fra
我正在尝试使用Protractor测试ui-select。在这个ui-select中,我有一个国家列表。我的html看起来像:{{$select.selected.name}}我的页面对象如下所示:this.country=element(by.model('datiAnagrafici.countryOfBirth'));this.fillForm=function(){this.country.sendKeys('IT');}在我的规范文件中我有:it('shouldfilltheform',function(){form.fillForm();})但是当我运行我的测试时,ng-m
我的Protractorconf.js,onPrepare函数需要发出一个http请求,如下所示,onPrepare:function(done){request.get('http://pepper/sysid').end(function(err,resp){if(err||!resp.ok){log("thereisanerror"+err.message)done()}else{global.sysid=resp.sysiddone()}})它抛出错误,done不是一个函数有没有其他方法可以在我的测试开始执行之前强制调用onPrepare中的回调?