Node version: 10.13.0
npm version: 6.4.1
Output from running the test:
$ npm run e2e
> protractor e2e/protractor.conf.js
[15.11.04] W/launcher - You have specified both capabilitties and multicapabilities. This will result in capabilities being ignored
[15.11.04] W/launcher - Running 1 Instances of Webdriver
[15.11.04] W/launcher - Ignoring uncaught error: Server terminated early with status 0
[15.11.08] W/launcher - BUG: Launcher exited with 1 tasks remaining
npm verb stack Error: 'protractor test/protractor.conf.js'
npm verb stack Exit status 100
Chrome navigator version: 87.0.4280
Selenium server Standalone version:
npm install http://path/selenim-server-3.141.59.tgz
chromedriver version:
npm install http://path/chromdriver-2.46.0.tgz
first thing I see is
You have specified both capabilitties and multicapabilities. This will result in capabilities being ignored
Make sure it is not causing your problem
Second, chromdriver-2.46.0.tgz is not the right version to control chrome 87.0.4280.
Check this page for the chromdriver version you need https://chromedriver.storage.googleapis.com/LATEST_RELEASE_87.0.4280
Related
I learn React and try to run an app. When I start the app in terminal, it goes nice and works as expected, but when I do the very same thing in container it fails. Here are the details:
root#b8457ff69aac:/app# node -v
v16.17.0
root#b8457ff69aac:/app# npm -v
8.15.0
The error:
root#b8457ff69aac:/app# npm start server
> voting_app#1.1.0 start
> npm run server
> voting_app#1.1.0 server
> live-server public --host=localhost --port=9001 --middleware=./disable-browser-cache.js
(node:134) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
Serving "public" at http://localhost:9001 (http://127.0.0.1:9001)
/app/node_modules/opn/index.js:82
reject(new Error('Exited with code ' + code));
^
Error: Exited with code 3
at ChildProcess.<anonymous> (/app/node_modules/opn/index.js:82:13)
at Object.onceWrapper (node:events:628:26)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1093:16)
at Socket.<anonymous> (node:internal/child_process:451:11)
at Socket.emit (node:events:513:28)
at Pipe.<anonymous> (node:net:757:14)
Dockerfile
FROM node:16.17.0
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 9001
# for sake of debug
CMD [ "sleep" , "infinity" ]
And running it:
docker run -p 9001:9001 vote-app:test2
/app/node_modules/opn/index.js:82
reject(new Error('Exited with code ' + code));
hints that the opn module is failing. That module is used to op(e)n a browser, which can't happen in a container.
Add --no-browser to your live-server command line to prevent it trying to open a browser.
Furthermore, you'll need --host=0.0.0.0 instead of --host=localhost so the exposed port can work from within the container.
As an aside, you'll probably also want to see if you can update your version of live-server to get rid of that deprecation warning.
For a create-react-app I have created some tests in a __test__ folder at the same level as the src
After running npm test the project folder I get the following error
How can I fix this so that I can run my tests?
jenkins#VBOX:dashboard$ npm test
> react-scripts test --env=jsdom
Determining test suites to run...fs.js:1236
throw error;
^
Error: watch /home/jenkins/dev/git-stash/dashboard/node_modules/react-scripts/node_modules/babel-jest/node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/node_modules/babel-types/node_modules/babel-runtime/node_modules/core-js/fn/symbol ENOSPC
at exports._errnoException (util.js:907:11)
at FSWatcher.start (fs.js:1234:19)
at Object.fs.watch (fs.js:1262:11)
at NodeWatcher.watchdir (/home/jenkins/dev/git-stash/dashboard/node_modules/react-scripts/node_modules/jest/node_modules/jest-cli/node_modules/sane/src/node_watcher.js:144:20)
at Walker.<anonymous> (/home/jenkins/dev/git-stash/dashboard/node_modules/react-scripts/node_modules/jest/node_modules/jest-cli/node_modules/sane/src/node_watcher.js:353:12)
at emitTwo (events.js:87:13)
at Walker.emit (events.js:172:7)
at /home/jenkins/dev/git-stash/dashboard/node_modules/react-scripts/node_modules/jest/node_modules/jest-cli/node_modules/sane/node_modules/walker/lib/walker.js:69:16
at go$readdir$cb (/home/jenkins/dev/git-stash/dashboard/node_modules/react-scripts/node_modules/jest/node_modules/jest-cli/node_modules/graceful-fs/graceful-fs.js:149:14)
at FSReqWrap.oncomplete (fs.js:82:15)
npm ERR! Test failed. See above for more details.
Sometimes we hit the limit on the number of files we can watch simultaneously and we gains the error while having plenty of free space.
On Linux (Debian Wheezy, npm v3.10.10, node v6.10.2) it can be fixed by trying $ npm dedupe first, and, if still necessary, by
$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
Credits go to hexo.io.
So that nonsensical word in all caps at the end of the first line of every node error... that's an error code. This one was ENOSPC, which means "no space on drive".
i.e. your drive was full, You must've freed up space before running npm install again, and it was the former not the latter that fixed your problem.
I got exactly same problem. and I solve this issue by installing newest npm. I got ENOSPC error with npm version 2.15.11. and it works well with v3.10.10.
why webdriver-update command not found although protractor is installed ?
i installed protractor node as
sudo npm install protractor -g
and when i try to make
sudo webdriver-manager update
it return with
sudo: webdriver-manager: command not found
i tried also to install it manually but i failed to do.
tamer#tamer-Inspiron-N5110:/media/tamer/Work/conFusion/test$ protractor protractor.conf.js
[15:23:48] I/direct - Using ChromeDriver directly...
[15:23:48] I/launcher - Running 1 instances of WebDriver
[15:23:48] E/direct - Error code: 135
[15:23:48] E/direct - Error message: Could not find chromedriver at /home/tamer/.npm-global/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.22
[15:23:48] E/direct - Error: Could not find chromedriver at /home/tamer/.npm-global/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.22
at Direct.getNewDriver (/home/tamer/.npm-global/lib/node_modules/protractor/built/driverProviders/direct.js:65:27)
at Runner.createBrowser (/home/tamer/.npm-global/lib/node_modules/protractor/built/runner.js:198:43)
at /home/tamer/.npm-global/lib/node_modules/protractor/built/runner.js:277:30
at _fulfilled (/home/tamer/.npm-global/lib/node_modules/protractor/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/home/tamer/.npm-global/lib/node_modules/protractor/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/home/tamer/.npm-global/lib/node_modules/protractor/node_modules/q/q.js:796:13)
at /home/tamer/.npm-global/lib/node_modules/protractor/node_modules/q/q.js:556:49
at runSingle (/home/tamer/.npm-global/lib/node_modules/protractor/node_modules/q/q.js:137:13)
at flush (/home/tamer/.npm-global/lib/node_modules/protractor/node_modules/q/q.js:125:13)
at nextTickCallbackWith0Args (node.js:420:9)
[15:23:48] E/launcher - Process exited with error code 135
tamer#tamer-Inspiron-N5110:/media/tamer/Work/conFusion/test$ sudo webdriver-manager update
[sudo] password for tamer:
sudo: webdriver-manager: command not found
Root Causes of your issue might Node REPL unable to pick up the installed node_module
Can you try one of below and see
In order to make modules available to the Node.js REPL, it might be useful to add <</usr/lib>>/node_modules folder to the $NODE_PATH environment variable.
Refer here for more info
Goto .\node_modules\protractor\bin and execute the webdriver-manager trigger script directly.
node webdriver-manager update
I'm bringing this into discussion here, since I had started this conversation over GithubIssue 2630, Basically I'm having problems with the integration of Protractor and Cucumber, I had even tried to downgrade to a older versions for both but the same thing happens, here's an explanation of what I did so far:
I had uninstalled everything and started from scratch. I started by installing Protractor, Cucumber and Webdriver globally and I can see this error, same as before, when I run the protractor command.
$ protractor conf.js
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://192.168.0.104:64737/wd/hub
[launcher] Error: TypeError: undefined is not a function
at /usr/local/lib/node_modules/protractor/lib/frameworks/cucumber.js:150:36
at Function.promise (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:650:9)
at /usr/local/lib/node_modules/protractor/lib/frameworks/cucumber.js:147:14
at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:797:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:826:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:759:13)
at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:525:49
at flush (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:355:11)
[launcher] Process exited with error code 100
```
Then I've installed all locally, running npm install, and I got this error
[launcher] Process exited with error code 1
/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/node_modules/q/q.js:126
throw e;
^
Error: No selenium server jar found at the specified location (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/selenium/selenium-server-standalone-2.47.1.jar). Check that the version number is up to date.
at LocalDriverProvider.addDefaultBinaryLocs_ (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/lib/driverProviders/local.js:37:11)
at LocalDriverProvider.setupEnv (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/lib/driverProviders/local.js:71:8)
at Runner.run (/Users/brunosoko/Documents/Dev/Personal/olapic-test2/node_modules/protractor/lib/runner.js:261:31)
at TaskRunner.run (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/lib/taskRunner.js:123:19)
at createNextTaskRunner (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/lib/launcher.js:223:20)
at /Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/lib/launcher.js:246:7
at _fulfilled (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/node_modules/q/q.js:797:54)
at self.promiseDispatch.done (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/node_modules/q/q.js:826:30)
at Promise.promise.promiseDispatch (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/node_modules/q/q.js:759:13)
at /Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/node_modules/q/q.js:573:44
Which I resolved by installing locally webdriver ./node_modules/.bin/webdriver-manager update
Then I ran ./node_modules/.bin/protractor conf.js and I'm getting the same error as above, for cucumber.js:150:36
Later, I tried to uninstall globally framework, npm uninstall -g protractor and npm uninstall -g cucumber
But the same error happens! I'm not sure what am I doing wrong!
I'm not sure what is wrong with your specific situation, but I have created a bare minimum example of cucumber 0.8.1 working with the yet to be released version of protractor here - https://github.com/darrinholst/protractor-cucumber-example. Hope this helps.
git clone https://github.com/darrinholst/protractor-cucumber-example
cd protractor-cucumber-example
npm install
npm test
Attempted Project: https://github.com/yearofmoo/angularjs-seed-repo
Environment:
Windows 7 64-bit
NodeJS v 0.10.24
Protractor v 0.16.1
grunt v0.4.2
grunt-cli v0.1.11
Notes:
For selenium, install_selenium_standalone has been replaced by webdriver-manager binary around 12/2/13 according to [Julie's post][1]. This seems to be related to the issue.
Also, git must be installed in the project directory and npm install must be run using Git Bash in Windows.
Error in Git Bash:
$ grunt test:e2e --debug
Running "connect:testserver" (connect) task
[D] Task source: c:\nodejs-0.10.24\node_modules\grunt-contrib-connect\tasks\conn
ect.js
Started connect web server on 127.0.0.1:9999.
Running "protractor:singlerun" (protractor) task
[D] Task source: c:\nodejs-0.10.24\node_modules\grunt-protractor-runner\tasks\pr
otractor_runner.js
Starting selenium standalone server...
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
>
Fatal error: protractor exited with code: 8
Java is required to run selenium, so it seems You don't have any.