相关疑难解决方法(0)

使用Selenium WebDriver截取屏幕截图

有谁知道是否可以使用Selenium WebDriver截取屏幕截图?(注:不是Selenium RC)

selenium selenium-webdriver ashot takesscreenshot selenium-shutterbug

478
推荐指数
16
解决办法
52万
查看次数

D3JS的单元测试策略是什么?

我是D3JS的新手,想了解D3 JS的测试策略.

要详细说明问题 - 请考虑我有一个简单的页面,显示使用TSV文件的折线图.

Java脚本代码:

function LineManager() {}
function LineProperties() { // Line Properties }
LineManager.prototype.draw = function(properties) { 
  // D3 code to draw a line with the given properties.
}
Run Code Online (Sandbox Code Playgroud)

我无法考虑编写单元测试时要考虑的测试用例.这是我写的一个示例测试..

it("should throw an exception if line graph properties are not set.", function() {
        expect(lineManager.draw.bind(lineManager)).toThrow("Line Graph properties not set");
    });

it("It should have single line chart", function() {
    lineManager.draw(properties);
    expect(lineManager.countLines()).toEqual(1);
});
Run Code Online (Sandbox Code Playgroud)

我已编写单元测试以确保正确生成TSV文件.但编写单元测试以查看数据是否正确呈现是否有意义?这不是更多的d3js单元测试而不是单元测试我的功能吗?

所以我的问题是 - 对于由d3js生成的图表应该考虑哪些测试?

unit-testing d3.js

23
推荐指数
3
解决办法
9596
查看次数