我是Zombie.js测试的新手,很难搜索,所以我会在这里问...
示例: (Globla变量)
hello = {"world" : "...."}
所以我测试了类似的东西:
describe('Check varibles', function() {
it('If ---> hello <--- exits', function(done) {
browser.assert.global('hello');
done();
});
it('If ---> hello.world <--- exits', function(done) {
// ????
done();
});
});
我可以检查hello
是否退出。 但如果检查是否退出hello.world`?
我尝试过:
browser.assert.global('hello.world'); // AssertionError: undefined == true
答案 0 :(得分:0)
哦,我有一个替代(直接使用assert
)
首先:需要assert
const assert = require('assert');
执行以下操作:
it('If ---> hello.world <--- exits', function(done){
assert.ok(browser.window.hello.world);
//assert.ok(!browser.window.hello.world); <-- or check if not exits
done();
});