Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

ReferenceError: window is not defined at Object. #102

Closed
lisakhr opened this issue Jan 20, 2015 · 10 comments
Closed

ReferenceError: window is not defined at Object. #102

lisakhr opened this issue Jan 20, 2015 · 10 comments

Comments

@lisakhr
Copy link

lisakhr commented Jan 20, 2015

Hi!
I installed gemini and tried to run examples from tutorial and got the error:
"ReferenceError: window is not defined at Object. (\gemini\node_modules\gemini\lib\browser\client-scripts\gemini.coverage.js:129:3) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at requireWithNoCache (\node_modules\gemini\lib\gemini.js:18:18) at Array.forEach (native) at ~\node_modules\gemini\lib\gemini.js:60:26"

Am i doing smth wrong?

@SevInf
Copy link
Contributor

SevInf commented Jan 20, 2015

Can you please provide more info about which OS and node versions are you using?

@lisakhr
Copy link
Author

lisakhr commented Jan 20, 2015

OS: win 8.1
node: 0.10.35

@SevInf
Copy link
Contributor

SevInf commented Jan 20, 2015

Can you also point me to example your are using and the command you are running?

@lisakhr
Copy link
Author

lisakhr commented Jan 20, 2015

I tried config:
rootUrl: http://yandex.com
gridUrl: http://localhost:4444/wd/hub

browsers:
chrome:
browserName: chrome
version: "37.0"

firefox:
browserName: firefox
version: "31.0"

and test file:

var gemini = require('gemini');

gemini.suite('yandex-search', function(suite) {
suite.setUrl('/')
.setCaptureElements('.main-table')
.capture('plain')
.capture('with text', function(actions, find) {
actions.sendKeys(find('.input__control'), 'hello gemini');
});
});

command: gemini gather {path to project folder}
tried both - selenium server and phantomJS
Also tried gemini-gui - the same result

@SevInf
Copy link
Contributor

SevInf commented Jan 20, 2015

Can you try to launch it using path to test file instead of a path to project folder and report the result?

@lisakhr
Copy link
Author

lisakhr commented Jan 20, 2015

When I launch it using a path to file - there is no error with gemini, but I have another problem like "environment you requested was unavailable."
Selenium Server (version 2.42.2) is launched localhost. In gemini-config - firefox version 30.0, which according to
https://docs.google.com/spreadsheetsd/1ro2XjjJk428HdIjFm3ESWhiKJiTmBkR_BiRVKqHlEms
/edit#gid=0
is supported by selenium server 2.42.2.
Thanks for your help!

@SevInf
Copy link
Contributor

SevInf commented Jan 20, 2015

Thanks.
About the original problem, make sure the folder you are pointing gemini to contains only gemini tests. There is no way to distinguish JS with a tests in it from any other JS files, so when you pointing it to a folder, gemini tries to load all .js files it founds there.

For the second problem, make sure you have Firefox 30 installed – selenium can not automatically download and install browsers, it only can launch and drive what already installed on your machine.

@lisakhr
Copy link
Author

lisakhr commented Jan 20, 2015

My project folder contains a config-file, one test file and "node-modules" folder, which was created by local installation of gemini.
Second problem - solved.

@SevInf
Copy link
Contributor

SevInf commented Jan 20, 2015

Yes, I believe its the problem – gemini descends into node_modules directory and tries to load *.js files it encounters there.
The easiest workaround for you should be putting the tests into some some sub-folder of the project and point gemini to it instead of project root. If your subfolder name will be gemini you won't have to specify a folder at all – we are loading tests from there by default.

@lisakhr
Copy link
Author

lisakhr commented Jan 20, 2015

It's working! Thanks a lot!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants