2014-03-22 04:03:13 +00:00
|
|
|
---
|
|
|
|
title: Zombie
|
2015-11-24 05:09:17 +00:00
|
|
|
category: JavaScript libraries
|
2020-06-22 15:55:02 +00:00
|
|
|
intro: |
|
|
|
|
[Zombie](http://zombie.js.org/) is a full-stack testing solution for Node.js.
|
2014-03-22 04:03:13 +00:00
|
|
|
---
|
|
|
|
|
2020-06-22 15:55:02 +00:00
|
|
|
## Zombie
|
2014-03-22 04:03:13 +00:00
|
|
|
|
2020-06-22 15:55:02 +00:00
|
|
|
### Examples
|
2014-03-22 04:03:13 +00:00
|
|
|
|
2020-06-22 15:55:02 +00:00
|
|
|
```js
|
|
|
|
browser
|
|
|
|
.visit("http://.../", ->)
|
|
|
|
.fill("email", "zombie@underworld.dead")
|
|
|
|
.fill("password", "eat-the-living")
|
|
|
|
.select("Born", "1985")
|
|
|
|
.uncheck("Send newsletter")
|
|
|
|
.clickLink("Link name")
|
|
|
|
.pressButton("Sign", () => { ... })
|
|
|
|
.text("H1")
|
|
|
|
```
|
2014-03-22 04:03:13 +00:00
|
|
|
|
2020-06-22 15:55:02 +00:00
|
|
|
### Expectations
|
2014-03-22 04:03:13 +00:00
|
|
|
|
2020-06-22 15:55:02 +00:00
|
|
|
```js
|
|
|
|
expect(browser.query("#brains"))
|
2014-03-22 04:03:13 +00:00
|
|
|
|
2020-06-22 15:55:02 +00:00
|
|
|
expect(browser.body.queryAll(".hand")).length 2
|
2014-03-22 04:03:13 +00:00
|
|
|
|
2020-06-22 15:55:02 +00:00
|
|
|
console.log(browser.html())
|
|
|
|
console.log(browser.html("table.parts"))
|
2014-03-22 04:03:13 +00:00
|
|
|
|
2020-06-22 15:55:02 +00:00
|
|
|
expect(Browser.text(".card-nopad small"), "A better way to get around!")
|
|
|
|
```
|