e2e 测试角度 UI 网格的规范方法 [英] Canonical way to e2e test angular UI grid
问题描述
故事:
最近,我们的 UI 从自定义表格切换到 Angular UI 网格,因为它变得稳定且功能丰富.
Recently, our UI switched from custom tables to Angular UI grid as it got stabilized and feature-rich.
主要的 Angular UI 网格页面声称具有e2e 测试集成",但我们很难做到这一点.
The main Angular UI grid page claims to have "e2e testing integration", but we are having the hard time making this work.
据我们了解,他们在e2e testing integration"下的意思是两个helper文件:gridTestUtils
和 gridObjectTestUtils
.
From what we understand, what they meant under "e2e testing integration" is the two helper files: gridTestUtils
and gridObjectTestUtils
.
这有很多问题:
- 这两个帮助文件不是
angular-ui-grid
模块本身的一部分,也不能作为单独的库使用,这意味着我们需要基本上复制当前 两个文件的内容并在本地手动创建它们 - 看起来所有的辅助函数都需要事先知道网格 ID,但我们的网格具有自动生成的(实际上是由
angular-ui-grid
本身)ID,我们使用其他定位器
- these two helper files are not a part of the
angular-ui-grid
module itself and are not available as a separate library which means we need to basically copy the current contents of both files and create them locally manually - it looks like all the helper functions require a grid ID to be known beforehand, but our grids have auto-generated (by
angular-ui-grid
itself actually) ids and we locate the grids using other locators
另一方面,这些辅助文件中提供的方法,如 resizeHeaderCell()
、shiftClickHeaderCell()
真的很方便,可以节省很多时间进行测试.
On the other hand, the provided in these helper files methods like resizeHeaderCell()
, shiftClickHeaderCell()
are really handy and may save a lot of time when it comes to testing.
问题:
测试角度 UI 网格的规范方法是什么,有没有人通过上述辅助函数与库进行 e2e-test 集成?
What is the canonical way to test angular UI grids and has anyone had any luck e2e-test-integrating with the library via the above-mentioned helper functions?
推荐答案
您无需复制这些文件的当前内容并在本地手动创建它们.你可以通过 npm 安装 ui-grid 仓库:npm install angular-ui/ui-grid
.
You don't need to copy the current contents of these files and create them locally manually. You can install ui-grid repository via npm: npm install angular-ui/ui-grid
.
这篇关于e2e 测试角度 UI 网格的规范方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!