-
Notifications
You must be signed in to change notification settings - Fork 19
/
testInn.js
30 lines (24 loc) · 796 Bytes
/
testInn.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var Browser = require("zombie");
var assert = require("assert");
assert.exists = function(selector) {
assert.ok(browser.query(selector));
}
assert.notExists = function(selector) {
assert.ok(!browser.query(selector));
}
port = process.argv[2]
console.log(port);
browser = new Browser()
browser.visit("http://localhost:" + port + "/", function() {
should_have_correct_title();
should_show_aged_brie_image_when_aged_brie_link_is_clicked();
});
should_have_correct_title = function() {
assert.equal(browser.text("title"), "Gilded Rose Inn");
}
should_show_aged_brie_image_when_aged_brie_link_is_clicked = function() {
assert.notExists(".fade.in img[src*='Aged Brie.jpg']");
browser.clickLink("Aged Brie", function() {
assert.exists(".fade.in img[src*='Aged Brie.jpg']");
})
}