OSDN Git Service

Regular updates
[twpd/master.git] / zombie.md
1 ---
2 title: Zombie
3 category: JavaScript libraries
4 layout: 2017/sheet
5 intro: |
6   [Zombie](http://zombie.js.org/) is a full-stack testing solution for Node.js.
7 ---
8
9 ## Zombie
10
11 ### Examples
12
13 ```js
14 browser
15   .visit("http://.../", ->)
16   .fill("email", "zombie@underworld.dead")
17   .fill("password", "eat-the-living")
18   .select("Born", "1985")
19   .uncheck("Send newsletter")
20   .clickLink("Link name")
21   .pressButton("Sign", () => { ... })
22   .text("H1")
23 ```
24
25 ### Expectations
26
27 ```js
28 expect(browser.query("#brains"))
29
30 expect(browser.body.queryAll(".hand")).length 2
31
32 console.log(browser.html())
33 console.log(browser.html("table.parts"))
34
35 expect(Browser.text(".card-nopad small"), "A better way to get around!")
36 ```