update protractor chrome driver to 74 - protractor

How do I update to 74 version of chromedriver
normally I would do:
webdriver-manager update --versions.chrome 2.46
however the following is not working:
webdriver-manager update --versions.chrome 74.0.3729.6
I am on Protractor Version 5.4.2
Dont want to upgrade to 6 as API is not yet completed
Log:
[16:21:43] E/downloader - undefined
[16:21:43] I/update - chromedriver: file exists /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_74.0.3729.6.zip
[16:21:43] I/update - chromedriver: unzipping chromedriver_74.0.3729.6.zip
(node:35565) UnhandledPromiseRejectionWarning: Invalid filename
(node:35565) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:35565) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[16:21:44] I/update - selenium standalone: file exists /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-4.0.0-alpha-1.zip.jar
[16:21:44] I/update - selenium standalone: selenium-server-standalone-4.0.0-alpha-1.zip.jar up to date
[16:21:44] I/update - geckodriver: file exists /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.24.0.tar.gz
[16:21:44] I/update - geckodriver: unzipping geckodriver-v0.24.0.tar.gz
[16:21:44] I/update - geckodriver: setting permissions to 0755 for /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.24.0
[16:21:44] I/update - geckodriver: geckodriver-v0.24.0 up to date
[UPDATE - SOLUTION]
npm install -g webdriver-manager#12.1.4
webdriver-manager version
webdriver-manager update

I found a working solution for protractor 5.4.2. You need to install webdriver-manager v12.1.3 and run npm dedupe. Then run webdriver-manager update --versions.chrome=2.46. In my case it didn't work because of webdriver-manager 12.1.1 installed selenium-server-standalone-4.0.0-alpha-1.zip.jar (this version only works with protractor 6.0.0) instead of selenium-server-standalone-3.141.59.jar.
Old answer
Only way I found to start it now (30.04.2019) is to start webdriver-manager separately and connect to its instance. It works with protractor v6.0.0 and webdriver-manager v12.1.3.
add this to protractor.conf.js:
exports.config = {
// ...
seleniumAddress: 'http://localhost:4444/wd/hub',
// ...
}
then run webdriver-manager start and in another tab protractor protractor.conf.js

Related

Webdriver-manager update unable to download geckodriver

I am trying to setup protractor for my angular app automation. I am on Node version 12 , I installed protractor version 5.4.3. when I use webdriver-manger update --proxy=blahblahproxy.com , I see the below error.
[13:37:06] I/config_source - curl -oC:\Users\******\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\gecko-response.json '**corpproxy**/repos/mozilla/geckodriver/releases' -H 'host:api.github.com'
(node:15904) UnhandledPromiseRejectionWarning: Error: response status code is not 200. It was 407
at Request.<anonymous> (C:\Users\*****\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\built\lib\binaries\config_source.js:181:28)
at Request.emit (events.js:311:20)
at Request.onRequestResponse (C:\Users\*****\AppData\Roaming\npm\node_modules\protractor\node_modules\request\request.js:1059:10)
at ClientRequest.emit (events.js:311:20)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:603:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:119:17)
at Socket.socketOnData (_http_client.js:476:22)
at Socket.emit (events.js:311:20)
at addChunk (_stream_readable.js:294:12)
at readableAddChunk (_stream_readable.js:275:11)
(node:15904) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:15904) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Chrome and selenium standlaone server are updated/downlaoded just fine
when i do webdriver-manager status
[13:39:39] I/status - selenium standalone version available: 3.141.59
[13:39:39] I/status - chromedriver version available: 80.0.3987.106
[13:39:39] I/status - geckodriver is not present
[13:39:39] I/status - IEDriverServer is not present
[13:39:39] I/status - android-sdk is not present
[13:39:39] I/status - appium is not present
Under corporate proxies we will face issues like this.
The 407 Proxy Authentication Required is an HTTP response status code indicating that the server is unable to complete the request because the client lacks proper authentication credentials for a proxy server that is intercepting the request between the client and server.
Option 1 : Try using selenium-standalone npm package. This is similar to webdriver-manager.
https://www.npmjs.com/package/selenium-standalone
Install this package globally
npm i -g selenium-standalone
Then to download/install the drivers
selenium-standalone install
Then to start the server
selenium-standalone start
(Or)
Option 2: https://stackoverflow.com/a/53358685/8903949

Probot version 7.2 is not starting my app

With probot 7.2, if I create a simple index.js like
module.exports = app => {
app.log('YYYYYYYEEEEEEEEEEEAAAAAAAAAAAHHHHHHHHH it is working!!!!')
}
This export is not working, as when I run the application, I never see my log message. The npm run dev give those log:
> test#1.0.0 dev /tmp/test
> nodemon
[nodemon] 1.18.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: .env *.*
[nodemon] starting `npm start`
> test#1.0.0 start /tmp/test
> probot run ./index.js
08:46:15.243Z INFO probot: Listening on http://localhost:3000
08:46:15.817Z INFO probot:
Welcome to Probot! Go to http://localhost:3000 to get started.
If I downgrade the version to 7.1 it is fine.
Is someone know if there is some (and which) change to do with 7.2 version ?
Just found out why, so I answer myself:
On 7.1 version, there is error when your start probot without the needed env variable.
On 7.2 those errors are not showing. You need to have env variable correctly set else it will simply start but silently fail to load your setup.
The env (or .env file) must define:
APP_ID=...
WEBHOOK_PROXY_URL=...
LOG_LEVEL=...
WEBHOOK_SECRET=...
PRIVATE_KEY=...
The complete possible env variables are defined in the documentation

gatsby new [site] failing: Cannot find module 'gatsby/dist/commands/develop'

I'm pretty green here. I've run gatsby on this (macosx) before. It has stopped working - presumably due to an install or environment variable somewhere?
First noticed with Module build failed: Error: Couldn't find preset "flow" relative to directory "/Users/3Legs"
Then after installing babel presets:
npm install --global --save-dev babel-preset-flow
I get the above message:
gatsby develop
... Cannot find module 'gatsby/dist/commands/develop'
FULL TRAIL BELOW + babelrc
Michaels-MacBook-Air:mggatsby 3Legs$
gatsby new test
-bash: /usr/local/bin/gatsby: No such file or directory
Michaels-MacBook-Air:mggatsby 3Legs$
npm install --global gatsby-cli
WARN registry Unexpected warning for registry.npmjs.org: Miscellaneous Warning EINTEGRITY: sha1-xRn2KfhrOlvtuliojTETCe7Al/k= integrity checksum failed when using sha1: wanted sha1-xRn2KfhrOlvtuliojTETCe7Al/k= but got sha512-vE2hT1D0HLZCLLclfBSfkfTTedhVj0fubHpJBHKwwUWX0nSbhPAfk+SG9rTX95BYNmau8rGFfCeaT6T5OW1C2A==. (455516 bytes)
WARN registry Using stale package data from registry.npmjs.org/ due to a request error during revalidation.
WARN registry Unexpected warning for registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha1-buxr+wdCHiFIx1xrunJCH4UwqCY= integrity checksum failed when using sha1: wanted sha1-buxr+wdCHiFIx1xrunJCH4UwqCY= but got sha512-+ktMAh1Jwas+TnGodfCfjUbJKoANqPaJFN0z0iqh41eqD8dvguNzcitVSBSVK1pidz0AqGbLKcoVuVLRVZ/aVg==. (42903 bytes)
WARN registry Using stale package data from registry.npmjs.org/ due to a request error during revalidation.
/usr/local/bin/gatsby -> /usr/local/lib/node_modules/gatsby-cli/lib/index.js
+ gatsby-cli#1.1.1
added 153 packages, removed 5 packages and updated 1 package in 10.573s
Michaels-MacBook-Air:mggatsby 3Legs$
gatsby new test
info Creating new site from git: git://github.com/gatsbyjs/gatsby-starter-default.git
Cloning into 'test'...
remote: Counting objects: 566, done.
remote: Total 566 (delta 0), reused 0 (delta 0), pack-reused 566
Receiving objects: 100% (566/566), 358.35 KiB | 187.00 KiB/s, done.
Resolving deltas: 100% (316/316), done.
success Created starter directory layout
info Installing packages...
yarn install v0.27.5
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "eslint-config-fbjs#1.1.1" has unmet peer dependency "babel-eslint#^6.1.2".
warning "eslint-config-fbjs#1.1.1" has unmet peer dependency "eslint#^3.0.0".
warning "eslint-config-fbjs#1.1.1" has unmet peer dependency "eslint-plugin-babel#^3.3.0".
warning "eslint-config-fbjs#1.1.1" has unmet peer dependency "eslint-plugin-flowtype#^2.15.0".
warning "eslint-config-fbjs#1.1.1" has unmet peer dependency "eslint-plugin-react#^5.2.2".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 47.94s.
Michaels-MacBook-Air:mggatsby 3Legs$
cd test
Michaels-MacBook-Air:test 3Legs$
gatsby develop
success delete html files from previous builds — 0.010 s
success open and validate gatsby-config.js — 0.006 s
success copy gatsby files — 0.028 s
success source and transform nodes — 0.045 s
success building schema — 0.134 s
success createLayouts — 0.039 s
success createPages — 0.016 s
success createPagesStatefully — 0.016 s
success extract queries from components — 0.118 s
success run graphql queries — 0.030 s
success write out page data — 0.006 s
success update schema — 0.094 s
info bootstrap finished - 3.856 s
error There was an error compiling the html.js component for the development server.
See our docs page on debugging HTML builds for help ...
Error: Module build failed: Error: Couldn't find preset "flow" relative to directory "/Users/3Legs"
Michaels-MacBook-Air:test 3Legs$
npm install --save-dev babel-preset-flow
npm WARN gentlyRm not removing /Users/3Legs/react/mggatsby/test/node_modules/.bin/gatsby as it wasn't installed by /Users/3Legs/react/mggatsby/test/node_modules/gatsby
npm WARN gentlyRm not removing /Users/3Legs/react/mggatsby/test/node_modules/.bin/semver as it wasn't installed by /Users/3Legs/react/mggatsby/test/node_modules/semver
npm WARN gentlyRm not removing /Users/3Legs/react/mggatsby/test/node_modules/jspm-registry/node_modules/.bin/semver as it wasn't installed by /Users/3Legs/react/mggatsby/test/node_modules/jspm-registry/node_modules/semver
npm WARN gentlyRm not removing /Users/3Legs/react/mggatsby/test/node_modules/.bin/browserslist as it wasn't installed by /Users/3Legs/react/mggatsby/test/node_modules/browserslist
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN gatsby-starter-default#1.0.0 No repository field.
+ babel-preset-flow#6.23.0
removed 1375 packages and updated 6 packages in 17.729s
Michaels-MacBook-Air:test 3Legs$
gatsby develop
/usr/local/bin/gatsby develop
Options:
-h, --help Show help [boolean]
-H, --host Set host. Defaults to localhost [string]
-p, --port Set port. Defaults to 8000 [string] [default: "8000"]
-o, --open Open the site in your browser for you. [boolean]
-v, --version Show version number [boolean]
error There was a problem loading the local develop command. Gatsby may not be installed.
Error: Cannot find module 'gatsby/dist/commands/develop'
- index.js:17 resolveFileName
[lib]/[gatsby-cli]/[resolve-from]/index.js:17:39
- index.js:31 resolveFrom
[lib]/[gatsby-cli]/[resolve-from]/index.js:31:9
- index.js:34 module.exports
[lib]/[gatsby-cli]/[resolve-from]/index.js:34:41
- index.js:4 module.exports.moduleId
[lib]/[gatsby-cli]/[resolve-cwd]/index.js:4:30
- create-cli.js:35 resolveLocalCommand
[lib]/[gatsby-cli]/lib/create-cli.js:35:22
- create-cli.js:66 Object.handler
[lib]/[gatsby-cli]/lib/create-cli.js:66:7
- command.js:233 Object.self.runCommand
[lib]/[gatsby-cli]/[yargs]/lib/command.js:233:22
- yargs.js:990 Object.Yargs.self._parseArgs
[lib]/[gatsby-cli]/[yargs]/yargs.js:990:30
- yargs.js:532 Object.Yargs.self.parse
[lib]/[gatsby-cli]/[yargs]/yargs.js:532:23
- create-cli.js:163 module.exports
[lib]/[gatsby-cli]/lib/create-cli.js:163:154
- index.js:122 Object.<anonymous>
[lib]/[gatsby-cli]/lib/index.js:122:1
Michaels-MacBook-Air:~ 3Legs$
cat .babelrc
{
"presets": ["flow"]
}
NPM seems to be removing modules because there isn't a package-lock.json. Not sure if this is new behavior but it's been hitting a lot of people in past few days.
All you need to do is delete node_modules and any lock file there and run npm install.

webdriver-manager update failed to download chrome driver and update-config.json

When I clean webdriver-manager and update, it is unable to download chrome driver and update-config.json. Later on when I start protractor it is complaining couldn't find update-config.json.
package.json
"scripts": {
"webdrivermanager:update": "node node_modules/protractor/bin/webdriver-manager update --versions.standalone=3.4.0 --ignore_ssl",
"webdrivermanager:clean": "node node_modules/protractor/bin/webdriver-manager clean",
"install": "npm run webdrivermanager:clean && npm run webdrivermanager:update"
}
protractor.conf.js
seleniumServerJar: '../../node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.4.0.jar',
multiCapabilities: [
{browserName: 'chrome'}
//specify if any other browser
],
directConnect: true,
Now when I do npm install, I can not see chrome driver and
update-config.json at
node_modules\protractor\node_modules\webdriver-manager\selenium
location
webdriver-manager update log
> node node_modules/protractor/bin/webdriver-manager update --versions.standalon
e=3.4.0 --ignore_ssl
[09:58:34] I/http_utils - ignoring SSL certificate
(node:10944) UnhandledPromiseRejectionWarning: Unhandled promise rejection (reje
ction id: 1): TypeError: Cannot read property 'ListBucketResult' of undefined
[09:58:34] I/downloader - curl -o C:\..\..\node_mo
dules\protractor\node_modules\webdriver-manager\selenium/selenium-server-standal
one-3.4.0.jar https://selenium-release.storage.googleapis.com/3.4/selenium-serve
r-standalone-3.4.0.jar
[09:58:35] I/downloader - curl -o C:\..\..\node_mo
dules\protractor\node_modules\webdriver-manager\selenium/geckodriver-v0.16.1.zip
https://github.com/mozilla/geckodriver/releases/download/v0.16.1/geckodriver-v0
.16.1-win64.zip
[09:58:36] I/update - geckodriver: unzipping geckodriver-v0.16.1.zip
In my log also chrome driver is not downloading anymore. For this reason I can not start my protractor as update-config.json is not available. Any idea would be great. Thanks
During a previous update call, the xml response was cancelled before the file could be created. There are two options (features to fix this are not complete yet):
delete the chrome-response.xml and then call update again
wait an hour and make an update request again. The last modified time will invalidate that file and it will make a request and will replace the chrome-response.xml.
On my end, if my webdriver-manager instance was closed.
I am required to delete npm and npm-cache folders from roaming and reinstall protractor again.
Right after installing protractor, webdriver-manager update needs to be executed immediately.
If an error appears, make sure to run node.js cmd as an admin.
With these steps, I was able to download drivers properly.
That was very weird. I did everything nothing helped. Actual reason was my organization blocked the chrome driver api site. chrome-response.xml is the main clue that is showing access denied message so, I came to know actual reason.
I requested to #cnishina to thrown an actual error message if chrome driver website is not reached.

DocPad plugin: odd errors when testing, hangs when including in project

I'm trying to write a DocPad plugin to import MongoDB docs into the DocPad database for use in a static website. The source code is at https://github.com/nfriedly/docpad-plugin-mongodb and it's based on https://github.com/docpad/docpad-plugin-tumblr
When I run cake test, I get this output:
cake compile
cake install
npm install (for app)
npm install (for test)
npm install (for docpad tests)
coffee compile
npm test
> docpad-plugin-mongodb#2.0.0 test c:\Users\IBM_ADMIN\docpad-plugin-mongodb
> npm run prepare_test_db && node ./out/mongodb.test.js
> docpad-plugin-mongodb#2.0.0 prepare_test_db c:\Users\IBM_ADMIN\docpad-plugin-mongodb
> mongo test/prepare_database.mongo.js
MongoDB shell version: 2.6.5
connecting to: test
connecting to: docpad_plugin_mongodb_test
mongodb
mongodb > create
notice: If everyone who saw this message donated $1/week, maintaining DocPad would become sustainable: http://docpad.org/donate
error: An error occured:
Error: Didn't place the skeleton as the desired structure already exists
at c:\Users\IBM_ADMIN\docpad-plugin-mongodb\node_modules\docpad\out\lib\docpad.js:4107:17
at Object.cb [as oncomplete] (fs.js:168:19)
error: To report the above error, follow the guide at: http://docpad.org/bug-report
mongodb > create OK
mongodb > load plugin mongodb
mongodb > load plugin mongodb OK
mongodb > generate
mongodb > generate > action
warning: You have multiple files being written to c:\Users\IBM_ADMIN\docpad-plugin-mongodb\test\out\testData\1.json, they are:
- testData/1.json:c7
- testData/1.json:c5
Rename one of them to avoid an over-write
FAILURE: 2/3 tests ran successfully; 0 failed, 1 incomplete, 0 errors
npm ERR! Test failed. See above for more details.
npm ERR! not ok code 0
c:\Users\IBM_ADMIN\docpad-plugin-mongodb\Cakefile:99
throw err;
^
Error: Process exited with error status code
at ChildProcess.<anonymous> (c:\Users\IBM_ADMIN\docpad-plugin-mongodb\Cakefile:88:15)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
And, when I include the module in my project, it just hangs after this:
$ docpad run
info: Welcome to DocPad v6.69.1 (local installation: c:\Users\IBM_ADMIN\watson-developer-cloud\node_modules\docpad
notice: If everyone who saw this message donated $1/week, maintaining DocPad would become sustainable: http://docp
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: eco, mongodb
info: Environment: development
info: DocPad listening to http://0.0.0.0:9778/ on directory c:\Users\IBM_ADMIN\watson-developer-cloud\out
(And if I visit localhost:9778, it just hangs and never loads a page)
It seems like it only displays logs from plugins after the first pass is complete, so I started adding throw statements to see what it was doing. It seems that it imports things from mongo successfully, and it creates the document, but when the plugin calls document.action 'load', (err) ->, that callback is never fired.
Can anyone provide some guidance on what I'm messing up and how to get things working smoothly?
Fixed it. The TaskGroup library (apparently) once had a .once('complete', callback) event that no longer works. Switching it to .done(callback) (and fixing a couple of other small bugs) got me working now.
It still gives me the "Error: Didn't place the skeleton as the desired structure already exists" but the tests all pass now, so I'll call it a win.