使用 Cucumber 测试 Highcharts(JS 图表库)
我有一个应用程序,我们可以在其中帮助客户通过使用 highcharts 呈现的图表来可视化数据。数据处理和可视化是我们的应用程序提供的主要价值,换句话说,它很重要并且应该进行测试。
我正在使用 Cucumber 为应用程序编写集成测试,我想包括我们的 highcharts 实现的一些基本测试。我特别热衷于测试是否绘制了正确的数据以及自定义 ajax 交互是否正常工作。示例功能可能如下所示:
Feature: Plot Related Alarm Data
As an project owner
I want to see antecedent data plotted around the time of the alarm
So that I can diagnose the issue and save gobs of money.
Background:
Given a bunch of stuff is set up
And I am logged in
# ...
Scenario: Alarm data is plotted
Given I have an alarm
# ...
When I visit the alarm show page
Then I should see 5 days of data in my graph
Scenario: Alarm data is clicked
Given # ...
When # ...
And I click on a data point
Then I should be on the data page
任何测试此类内容以及使用 Selenium、Watir 等工具的经验都将受到赞赏。
I have an application in which we help our clients visualize data via graphs rendered with highcharts. The data processing and visualization is the primary value our application provides, in other words its important and should be tested.
I am using cucumber to write integration tests for the application, I would like to include some basic tests of our highcharts implementation. I am especially keen to test that the correct data is being plotted as well as that custom ajax interactions are working correctly. An example feature might look something like this:
Feature: Plot Related Alarm Data
As an project owner
I want to see antecedent data plotted around the time of the alarm
So that I can diagnose the issue and save gobs of money.
Background:
Given a bunch of stuff is set up
And I am logged in
# ...
Scenario: Alarm data is plotted
Given I have an alarm
# ...
When I visit the alarm show page
Then I should see 5 days of data in my graph
Scenario: Alarm data is clicked
Given # ...
When # ...
And I click on a data point
Then I should be on the data page
Any experience testing things like this and which tool Selenium, Watir, etc was used would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用的策略:
使用该表中的数据(例如 http://www.highcharts.com/demo/column-parsed )
验证该表包含
使用 通过 tableish 进行表差异的预期数据
A strategy that I've used:
using the data from that table (e.g. http://www.highcharts.com/demo/column-parsed)
verify that the table contains the
expected data using table diffs via tableish