简体   繁体   English

e2e测试角度UI网格的规范方法

[英]Canonical way to e2e test angular UI grid

The Story: 故事:

Recently, our UI switched from custom tables to Angular UI grid as it got stabilized and feature-rich. 最近,由于稳定​​和功能丰富,我们的UI从自定义表切换到Angular UI网格

The main Angular UI grid page claims to have "e2e testing integration", but we are having the hard time making this work. Angular UI网格的主要页面声称具有“ e2e测试集成”,但是我们很难做到这一点。

From what we understand, what they meant under "e2e testing integration" is the two helper files : gridTestUtils and gridObjectTestUtils . 据我们了解,它们在“ e2e测试集成”下的含义是两个帮助文件gridTestUtilsgridObjectTestUtils

There are multiple problems with that: 有很多问题:

  • 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 这两个帮助程序文件不是angular-ui-grid模块本身的一部分,并且不能作为单独的库使用,这意味着我们需要基本上复制这两个文件的当前内容,并手动在本地创建它们
  • 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 看起来所有帮助程序功能都需要事先知道网格ID,但是我们的网格具有自动生成的ID(实际上是由angular-ui-grid本身),并且我们使用其他定位器来定位网格

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. 另一方面,这些帮助程序文件中提供的诸如resizeHeaderCell()shiftClickHeaderCell()方法确实非常方便,并且可以节省大量测试时间。

The Question: 问题:

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? 测试角度UI网格的规范方法是什么?有人通过上述辅助函数与库进行过e2e-test-test集成吗?

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 . 您可以通过npm安装ui-grid存储库: npm install angular-ui/ui-grid

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM