5

我有一个应用程序,我们在其中帮助我们的客户通过使用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 等工具的经验将不胜感激。

4

1 回答 1

2

我使用的一个策略:

  1. 在 HTML 表格中呈现数据
  2. 使用该表中的数据在 JavaScript 中生成图表(例如http://www.highcharts.com/demo/column-parsed
  3. 使用 Cucumber 只是通过 tableish使用表差异来验证表是否包含预期数据
于 2011-04-25T14:04:21.860 回答