-
Zombie.js
Insanely fast, headless full-stack testing using Node.jsZombie.js
Insanely fast, headless full-stack testing using Node.js
The Bite
If you're going to write an insanely fast, headless browser, how can you not call it Zombie? Zombie it is.
Zombie.js is a lightweight framework for testing client-side JavaScript code in a simulated environment. No browser required.
Let's try to sign up to a page and see what happens:
var zombie = require("zombie");
var assert = require("assert");
// Load the page from localhost
zombie.visit("http://localhost:3000/", function (err, browser, status) {
// Fill email, password and submit form
browser.
fill("email", "zombie@underworld.dead").
fill("password", "eat-the-living").
pressButton("Sign Me Up!", function(err, browser, status) {
// Form submitted, new page loaded.
assert.equal(browser.text("title"), "Welcome To Brains Depot");
})
});
Well, that was easy.
-
相关阅读:
jQuery源代码学习笔记_01
jQuery学习心得
前端笔试题目练习
JavaScript Date学习实例:获取3分钟前的时间“hhmmss”格式
JavaScript Date 学习心得
Javascript 中的false、0、null、undefined和空字符串对象
JavaScript比较运算符——"== != === !=="区别
JavaScript运算符优先级——"++,--,&&,||“
JavaScript操作符(=?,)优先级
JavaScript控制流及关键字与C语言之比较
-
原文地址:https://www.cnblogs.com/lexus/p/2225076.html
Copyright © 2020-2023
润新知