【发布时间】:2015-02-20 04:06:16
【问题描述】:
我们正在使用protractor 来测试内部 AngularJS 应用程序。
除了功能测试之外,我们还借助基于 nodejs browser-perf 库的 protractor-perf 来检查性能回归。因为,"Performance is a feature"。
使用protractor-perf,我们可以在进行浏览器操作时测量和断言不同的性能特征for example:
browser.get('http://www.angularjs.org');
perf.start(); // Start measuring the metrics
element(by.model('todoText')).sendKeys('write a protractor test');
element(by.css('[value="add"]')).click();
perf.stop(); // Stop measuring the metrics
if (perf.isEnabled) { // Is perf measuring enabled ?
// Check for perf regressions, just like you check for functional regressions
expect(perf.getStats('meanFrameTime')).toBeLessThan(60);
};
现在,对于另一个内部应用程序,我们有一组用 Python 编写的基于硒的测试。
是否可以使用 selenium-python 检查性能回归,或者我应该使用 protractor 重写测试以便能够编写浏览器性能测试?
【问题讨论】:
-
希望这可能help...在GTAC - 2013 中对此进行了详细讨论。
-
@VivekSingh 确实如此。在这个谷歌测试自动化会议演讲中提出的想法非常棒,并且与我所问的非常相关。我将尝试以特定于 python 的方式开发这个想法,我希望我能在这里提交一个答案。非常感谢。
-
很高兴知道它有帮助...干杯...
标签: python selenium selenium-webdriver protractor performance-testing