草庐IT

page-tables

全部标签

javascript - Protractor 和 Angular : How to test two pages in an app, 一个接一个?

我想在我的Angular应用程序的两个单独页面上运行Protractor测试:/dashboard和/articles。复杂的是我必须手动登录应用程序。目前我有这个设置:varLoginPage=function(){ptor=protractor.getInstance();this.login=function(url){ptor.get(url);ptor.findElement(protractor.By.model('email')).sendKeys(config.LOGIN_EMAIL);ptor.findElement(protractor.By.model('pass

javascript - 带转到页面的 Angular ng-table

我正在使用ng-table设置自定义分页控件。我想要一个只允许有效页码的输入。到目前为止,我有现有的分页。script(type="text/ng-template"id="ng-table-pagination-input")div(class="ng-cloakng-table-pager"ng-if="params.data.length")brul(ng-if="pages.length"class="paginationng-table-pagination")li(ng-class="{'disabled':!page.active&&!page.current,'acti

javascript - 从 console.table() 中删除索引

我正在控制台中查看一组数据。console.table(myArray)始终将索引作为第一列。这在查看对象数据时很好,当索引是键时,但当索引是数组索引时则不行(在我的例子中,它会分散注意力/烦人/从内容中消失)。有没有办法显示没有这个索引的表?可选的columns参数允许只显示想要的列...除了索引。 最佳答案 如MDNWebdocs所示Thefirstcolumninthetablewillbelabeled(index).Ifdataisanarray,thenitsvalueswillbethearrayindices.Ifd

javascript - 卡斯珀JS : Why does my url change to about:blank when my page is loaded?

我是PhantomJS/CasperJS的初学者。我只想启动一个session并验证它是否正常。这是我的代码:varcasper=require('casper').create({verbose:true,logLevel:'debug',pageSettings:{loadImages:false,loadPlugins:false,userAgent:'Mozilla/5.0(WindowsNT10.0;WOW64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/39.0.2171.71Safari/537.36Edge/12.0'}});ca

javascript - Firefox 扩展和 XUL : get page source code

我正在开发我的第一个Firefox扩展,为此我需要获得当前页面的完整源代码。我如何使用XUL做到这一点? 最佳答案 你需要一个xulbrowser将内容加载到的对象。将页面的“view-source:”版本加载到浏览器对象中,其方式与“ViewPageSource”菜单相同。请参阅chrome://global/content/viewSource.js中的函数viewSource()。该函数可以从缓存中加载,也可以不加载。内容加载后,原始来源由:varsource=browser.contentDocument.getElemen

javascript - 实现 "this page is asking you to confirm that you want to leave"

这是当我想离开某些页面时Firefox发出的警告。根据我在上面看到的页面以及当我在填写表格后尝试关闭页面时出现此警告,我只能假设它在动态页面上工作。哪种技术用于实现此功能?我如何在一个简单的hello-world页面上自己实现它? 最佳答案 您基本上为beforeunload事件实现了一个处理程序。这使您可以警告用户他们有未保存的数据。伪代码:window.onbeforeunload=functionwarnUsers(){if(needToConfirm){//checktoseeifanychangestothedataent

javascript - Highcharts 错误 #16 : charts not showing on the same page

我有一个网站,其中一个页面我已经成功添加了一张Highcharts。现在我将完全相同的代码复制到同一页面,但不同的asp页面,但是第一个图表消失了,第二个图表没有显示。它给我一个错误:UncaughtHighchartserror#16:www.highcharts.com/errors/16highcharts.js:16UncaughtSyntaxError:UnexpectedtokenILLEGALDashboard.aspx:657UncaughtTypeError:Object[objectObject]hasnomethod'highcharts'Dashboard.as

javascript - "An IndexedDB transaction that was not yet complete has been aborted due to page navigation"

我正在使用IndexedDB来存储一些数据。它似乎有效,但如果我刷新页面,我会在Firefox(36.0.4)的浏览器控制台中看到:尚未完成的IndexedDB事务已因页面导航而中止。。我正在使用这个(本地)文件进行测试:varrequest=window.indexedDB.open("test_db",2);request.onupgradeneeded=function(event){request.result.createObjectStore("test_store");};request.onsuccess=function(event){vardb=request.re

javascript - 未调用 ES6 angular-meteor ng-table getData 函数

我正在尝试将我的代码重构为ES6。我正在使用angular-meteor和ng-table。重构前,数据显示在表格中。但是,重构为ES6语法后,数据不再显示。这是重构代码的片段:classMyController{constructor($scope,$reactive,NgTableParams,MyService){'ngInject';$reactive(this).attach($scope);this.subscribe('myCollection');this.myService=MyService;this.helpers({items(){returnthis.mySe

javascript - Protractor - 失败 : stale element reference: element is not attached to the page document

我的Protractore2e页面对象中有一个函数可以取消选中下拉菜单中的多个选项。它以前工作正常,但现在我收到以下错误:Failed:staleelementreference:elementisnotattachedtothepagedocument我已经尝试在for循环的每次迭代中获取元素,但是for循环在第一次解决promise之前执行,这意味着x的“限制”值被重复传递,并且测试只是点击多次使用相同的下拉选项。this.uncheckColumns=function(limit){element(by.className('fa-cog')).click();element.a