Functional tests run from within Node.js, not the browser environment. If you want to access the dijit/registry
instance that was loaded in the page you are testing, you need to use execute
to run a function within the remote environment:
return this.remote
.get('http://application.co.uk')
.execute(function () {
// this function runs in the browser!
var registry = require('dijit/registry');
// ... do things with registry
return something;
})
.then(function (something) {
// this function runs inside the test runner!
assert.isTrue(something);
});
You won’t be able to define dependencies that have DOM requirements (like dijit/registry
) from functional test modules. Only browser-based unit test modules will be able to load such dependencies.