javascript - Using Global Variables Dalek JS -


firstly great testing tool alternative here guys heavily use selenium. might basic kind of new javascript , node.js in paticular.

i able use global variables in scripts having trouble doing so

i have file called variables on same level test.js script example, , in example assigning google variable url, when running test fails load.

require('variables.js');  module.exports = { 'log traceiq': function (test) {  test  .open(url)  .done(); } }; 

i tried , test starts run hangs @ opening stage

require('./variables');  module.exports = { 'open google': function (test) {  test   .open(url)   .done(); } };  

this output in console

 running tests  running browser: google chrome  os: linux 3.5.0-45-generic x86_64  browser version: 31.0.1650.63  >> warning: done not called!   running test - "open google" ✔ 0 assertions run ✔ test - "open google" succeeded 

is there blindly obvious doing wrong here ?

any appreciated

thanks

well looks user error on part nut post answer incase helps else. setting variables in node.js different typical client side javascript.

so setting

var url = "www.google.co.uk" 

i needed set

global.url = "www.google.co.uk" 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -