Using Node.js for UI Testing

Pedro Teixeira

  • 出版商: Packt Publishing
  • 出版日期: 2013-03-24
  • 售價: $1,000
  • 貴賓價: 9.5$950
  • 語言: 英文
  • 頁數: 146
  • 裝訂: Paperback
  • ISBN: 1782160523
  • ISBN-13: 9781782160526
  • 相關分類: Node.js使用者介面 UI
  • 海外代購書籍(需單獨結帳)

買這商品的人也買了...

相關主題

商品描述

Learn how to easily automate testing of your web apps using Node.js, Zombie.js, and Mocha

Overview

  • Use automated tests to keep your web app rock solid and bug-free while you code
  • Use a headless browser to quickly test your web application every time you make a small change to it.
  • Use Mocha to describe and test the capabilities of your web app.

In Detail

Automating tests for your user interfaces has always been the holy grail of programming. Now, using Zombie.js and Mocha you can create and quickly run your tests, allowing you to test even small changes. Increase your confidence in the code and minimize the number of times you have to use a real browser while you develop.

"Using Node.js for UI Testing" is a quick and thorough guide on how to automatically test your web app, keeping it rock solid and bug-free. You will learn how to simulate complex user behaviour and verify that your application behaves correctly.

You will create a web app in Node.js that uses complex user interactions and AJAX; by the end you will be able to fully test it from the command-line. Then you will start creating the user interface tests for this application using Mocha as a framework and Zombie.js as a headless browser.

You will also create a complete test suite, module by module, testing simple and complex user interactions.

What you will learn from this book

  • Creating your test suite using Mocha.
  • Building a web application using Node.js and Flatiron.js.
  • Loading documents into the Zombie.js headless browser.
  • Triggering user events in Zombie.js.
  • Querying the DOM to test your application behaviour.
  • Injecting complex events into your application.
  • Triggering and testing complex user interactions and AJAX calls.
  • Inspecting the Zombie headless browser state.

Approach

Full of techniques and tips for simulating user interactions and verifying that your application is behaving correctly.

Who this book is written for

This book is for frontend and backend web application developers that know how to program in JavaScript.

商品描述(中文翻譯)

學習如何使用Node.js、Zombie.js和Mocha輕鬆自動化測試您的網頁應用程式

概述:
- 在編寫程式碼時使用自動化測試來保持您的網頁應用程式穩定無誤
- 使用無頭瀏覽器快速測試您的網頁應用程式,每次進行微小更改時都能進行測試
- 使用Mocha描述和測試您的網頁應用程式的功能

詳細內容:
自動化測試用於用戶界面一直是程式設計的終極目標。現在,使用Zombie.js和Mocha,您可以創建並快速運行測試,從而使您能夠測試即使是微小的更改。增加您對程式碼的信心,並在開發過程中最大程度地減少使用真實瀏覽器的次數。

《使用Node.js進行UI測試》是一本快速而全面的指南,教您如何自動測試您的網頁應用程式,使其保持穩定無誤。您將學習如何模擬複雜的用戶行為並驗證您的應用程式的正確行為。

您將在Node.js中創建一個使用複雜用戶互動和AJAX的網頁應用程式;最終,您將能夠從命令行完全測試它。然後,您將開始使用Mocha作為框架和Zombie.js作為無頭瀏覽器為此應用程式創建用戶界面測試。

您還將逐個模塊創建完整的測試套件,測試簡單和複雜的用戶互動。

本書將教您以下內容:
- 使用Mocha創建測試套件
- 使用Node.js和Flatiron.js構建網頁應用程式
- 將文件加載到Zombie.js無頭瀏覽器中
- 在Zombie.js中觸發用戶事件
- 查詢DOM以測試應用程式行為
- 將複雜事件注入到應用程式中
- 觸發和測試複雜的用戶互動和AJAX呼叫
- 檢查Zombie無頭瀏覽器的狀態

這本書適合前端和後端網頁應用程式開發人員,他們懂得如何使用JavaScript編程。