標籤:base nes 效率 前端測試 runner javascrip tle ref repo
背景
Web自動化測試越來越被重視, 因為現在Web已經是工程化的狀態。 如何通過工具測試, 保證Web開發的品質,提升開發效率,是Web工具的誕生的來由。
Web測試分為以下幾個方面:
1、 介面測試 測試介面是否正常,這是前端測試最基礎的環節。
2、 功能測試 測試功能操作是否正常,由於涉及互動,這部分測試比介面測試會更複雜
3、 效能測試 頁面效能越來越受到關注,並且效能需要在開發過程中持續關注,否則很容易隨著業務迭代而下降。
4、 安全性測試 測試Web介面和WebServer的安全性, 這裡有專業工具(Nessus WebInspect)。不是本文調研點。
5、 單元測試 這個測試在其它語言領域已經比較成熟, 在Web領域對一些只適應用一些通用性較強的庫和架構。
6、 易用性測試 測試Web介面是否容易被使用者使用。一般人為參與更加直接有效,不推薦工具。
7、 相容性測試 測試多種瀏覽器訪問的正常性。
部分分類來源於:
http://www.open-open.com/lib/view/open1436021333747.html
調研
下面結合測試功能點,匯總各種測試需求以及測試載入器。
| 分類 |
工具 |
URL |
描述 |
| 介面測試 |
PhantomCSS |
https://github.com/Huddle/PhantomCSS |
Visual/CSS regression testing with PhantomJS
CSS regression testing. A CasperJS module for automating visual regression testing with PhantomJS 2 or SlimerJS and Resemble.js. |
| 介面測試 |
page-monitor |
https://github.com/fouber/page-monitor |
capture webpage and diff the dom change with phantomjs |
| 功能測試 |
phantomjs |
http://phantomjs.org/ |
PhantomJS is a headless WebKit scriptable with a JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG.
對於web測試、介面、網路捕獲、頁面自動化訪問等等方面可以說是信手拈來。百度在此平台上做了不少實踐。 |
| 功能測試 |
casperjs |
http://casperjs.readthedocs.io/en/latest/
http://casperjs.org/ |
casperjs是對PhantomJS的封裝,提供了更加易用的API, 增強了測試等方面的支援。 |
| 功能測試 |
SlimerJS |
http://www.slimerjs.org/index.html |
SlimerJS is similar to PhantomJs, except that it runs on top of Gecko, the browser engine of Mozilla Firefox, instead of Webkit, and is not yet truly headless. |
| 功能測試 |
TestCafe |
https://testcafe.devexpress.com/ |
Functional Web Testing MADE EASY |
| 效能測試 |
Phantomas |
https://github.com/macbre/phantomas |
PhantomJS-based web performance metrics collector and monitoring tool |
| 單元測試 |
Karma和Jasmine |
http://blog.fens.me/nodejs-karma-jasmine/ |
Nodejs領域: Jasmine做單元測試,Karma自動化完成單元測試
https://jasmine.github.io/2.5/introduction Sinon -- 打樁架構Mocha -- 測試架構Chai -- 測試架構 |
| 單元測試 |
QUnit |
http://qunitjs.com/ |
QUnit is a powerful, easy-to-use JavaScript unit testing framework. It‘s used by the jQuery, jQuery UI and jQuery Mobile projects and is capable of testing any generic JavaScript code, including itself! |
| 相容性測試 |
selenium |
www.seleniumhq.org |
selenium可以自動化的擷取多個瀏覽器下的,前端工程師來說還可以藉助Node的webdriver (http://webdriver.io/)來輕鬆開發測試指令碼。還可以用:http://nightwatchjs.org/ |
| 相容性測試 |
dalekjs |
http://dalekjs.com/ |
Automated cross browser testing with JavaScript!Exterminate all the bugs! |
自動化測試管理工具(Test Runner): http://karma-runner.github.io/1.0/index.html (google angular出品)
Web自動化測試載入器調研