Angular e2e的排序和它的block
Ordering of Angular e2e describe and it blocks
我使用Karma在AngularJS中运行一个端到端测试。
在describe()
块中,为什么it()
块总是在任何嵌套的describe()
块之后执行,而不管它们在测试中的顺序如何?例如:describe( 'Hello Page Nav Bar', function()
{
it( 'should be on the hello page', function()
{
expect( browser().location().url() ).toBe( '/hello' );
} );
// ... many other it() blocks relating to 'Nav Bar' ...
// Create nested describe specifically for menu items within the nav bar
describe( 'Nav Bar Menu Items', function()
{
it( 'should have 12', function()
{
expect( element( '.menu-items div' ).count() ).toBe( 12 );
} );
// ... many other it() blocks relating to 'Nav Bar Menu Items' ...
} );
});
将以以下顺序执行:
* Hello Page Nav Bar
* Nav Bar Menu Items
* should have 12
* should be on the hello page
我想测试"should be on the hello page"在其他任何东西之前
我同意。
一个解决方法是始终保持描述块只包含其他"描述块"或只包含"它块"。这样,顺序是一致的。
相关文章:
- JavaScript数组排序(函数)用于对表行进行排序,而不是排序
- 使用promise和mongoose对文档进行排序
- Selectize.js:如何对整数值的选项进行排序
- Javascript排序的图像弹出窗口..可以't单独弹出
- 如何通过引用var Using DataTables来进行分页或排序
- 为什么HTML5拖放的目标是孩子?(可排序列表)
- AngularJs对所有页面中的所有记录进行排序
- 当属性不一致时,如何根据属性对JS对象列表进行排序
- 按从高到低对多个int变量进行排序
- jQuery UI可排序-多连接列表拖动
- Javascript排序字符串或数字
- 2个backbone.js集合,具有相同的模型,但排序顺序不同
- sort而不是排序javascript
- 通过从节点父级获取所有子级对节点进行排序(获取子级数组)
- 如何合并不同集合的游标并按日期排序
- 为什么我的JavaScript堆栈排序函数不起作用
- ui网格:在自定义表头模板中触发排序
- jquery Onclick函数带有导致双击的回调排序函数
- Rubaxa可与聚合物进行排序/拖放不起作用,具体取决于显示器:
- Angular e2e的排序和它的block