等到页面加载Zombie测试节点

时间:2017-09-13 16:47:11

标签: javascript node.js mocha zombie.js

执行此测试时,我总是得到超时错误。 我需要取消注释this.timeout函数才能使其正常工作......我认为在页面加载时调用了完成的回调..

describe('home page', function() {
    //this.timeout(20500);
    before(function() {
        this.server = http.createServer(app).listen(3001);
        this.browser = new Browser({
            site: 'http://localhost:3000'
        });
    });

    // load the contact page before each test
    before(function(done) {
        this.browser.visit('/', done);
    });

    it('should show contact a form', function() {
        assert.ok(this.browser.success);
        assert.equal(this.browser.text('h1'), 'hello');
        assert.equal(this.browser.text('form label'), 'First NameLast NameEmailMessage');

    })});

0 个答案:

没有答案