Open mpochron opened 9 years ago
That problem from file cordova-test/node/CDVTest.js
:
value: function get_cordova_version() {
var child = _child_process2['default'].spawnSync("cordova", ["-v"]);
if (child.stderr && child.stderr.toString() != "") {
return false;
}
console.log(child.stdout); // here null
return child.stdout.toString();
}
child.stdout
pirnts null
, also i have cordova@5.0.0
Got error : error: { [Error: spawnSync ENOENT] code: 'ENOENT', errno: 'ENOENT', syscall: 'spawnSync'
Hey @machei, good to hear you're trying cordova-test
. I actually didn't test it on Windows, I'll try to make it work with you.
First, I see you got this error
? Error: Tests path not found, C:\Developer\Projects\p\test/mocha
Are you executing cordova-test inside a cordova project ?
I'll take a look now, in the script that gets cordova version, to check why it fails.
Do you have cordova in the global path or you execute it from it folder; if you exec
cordova -v
in a terminal, does it give you the version ?
Or you use it like;
C:\\my\folder\to\cordova -v
?
? Error: Tests path not found, C:\Developer\Projects\p\test/mocha
- I know about athat error, I had wrong with folder name.
Still error caught with cordova -v
and appium -v
. I have placed string to returns of these functions like that return "5.0.0"
.
Cordova and appium are installed globally, these command works anywhere.
Other error still:
Machei@MacheiPC /cygdrive/c/Developer/Projects/p develop ± cordova-test android tests/mocha
✓ Parsing cli params
{"platform":"android","platform_path":"C:\\Developer\\Projects\\p\\platforms\\android","tests_path":"C:\\Developer\\Projects\\p\\tests/mocha","compile":true,"env":"mocha","env_files":"*.js","isLocal":true}
✓ Checking selected platform is supported
ANDROID
✓ Checking test(s) path exists
✓ Cordova installed, cordova version: 5.0.0
✓ Getting cordova project info
Project name: Test Proejct
Package name: app.test.project
Compiling cordova application, this may take a while!
✓ Cordova project compiled
✓ Checking compiled application exists
✓ Checking appium is installed
Appium installed, appium version: 1.4.10
✓ Checking appium is running & available
✓ Platform capabilities updated
Running test; mocha C:\Developer\Projects\p\tests/mocha\01_splash.js --platform android
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn mocha ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)
at Function.Module.runMain (module.js:503:11)
at startup (node.js:129:16)
at node.js:814:3
✘ Machei@MacheiPC /cygdrive/c/Developer/Projects/p develop ± appium -v
1.4.10
✘ Machei@MacheiPC /cygdrive/c/Developer/Projects/p develop ±
mmm, it shouldnt throw an error on cordova -v
since cordova build android
does work.
can you try with cordova-test android tests\mocha
? maybe windows is getting a wrong path with a / as separator
cordova-test android tests\mocha \\ Error: Tests path not found, ...\p\testsmocha
cordova-test android tests\\mocha \\ error in prev comment
cordova-test android tests/mocha \\ error in prev comment
I tried to type command following as abowe.
My mocha is fine working in other way:
✘ Machei@MacheiPC /cygdrive/c/Developer/Projects/p/tests/mocha feature/teste2e ± mocha 01_splash.js
Array
#indexOf()
√ should return -1 when the value is not present
1 passing (6ms)
``
I'll create a windows vm and check what's the problem. I'll give you feedback soon.
Hey @machei, I just made an improvement on the path parser. Can you reinstall the cli, npm install -g cordova-test
and try again ?
I'm still investigating why the cli trhows an error when getting cordova(and appium) version.
Has there been any update on this issue? I am experiencing the same thing:
return child.stdout.toString();
^
TypeError: Cannot read property 'toString' of null
This is from within CDVTest.js:103
I have the same issue (I think...)
TypeError: Cannot read property 'toString' of null
at CDVTestLocal.getCordovaVersion (C:\Users\Petro\AppData\Roaming\npm\node_modules\cordova-test\dist\CDVTest.js:103:26)
at CDVTestLocal.checkSettings (C:\Users\Petro\AppData\Roaming\npm\node_modules\cordova-test\dist\CDVTest.js:166:29)
at CDVAutomator.run (C:\Users\Petro\AppData\Roaming\npm\node_modules\cordova-test\dist\CDVAutomator.js:63:35)
at Object.
same of cordova 9.0.0 (cordova-lib@9.0.1)
Sorry for the super late reply, this project was unsupported due to lack of time. I just added the label as deprecated. I just tried the project on MacOs and it works. I'm creating a new release, but won't be able to help much, especially on Windows.
This is working with 9.0.0 (cordova-lib@9.0.1)
on MacOs
https://github.com/Urucas/cordova-test/pull/23
I'm new user, and starting to use this plugin cordova.