How to set proxy in config for protector - protractor

I am using protector with angular 4, when i run e2e test it failed to download some dependency from network as it blocked within my org proxy.
I tried to set proxy in protractor.conf.js, but it did not work for me.
capabilities: {
'browserName': 'chrome',
'proxy': {
'proxyType': 'manual',
'httpProxy': 'http://ptx.proxy.corp.sopra:8080'
}
below error I'm getting when run ng e2e
webpack: Compiled successfully.
events.js:183
throw er; // Unhandled 'error' event
^
Error: connect ETIMEDOUT 216.58.204.144:443
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
Can someone please tell me how to use the proxy within in.

I did find a way around to set the proxy, I set up proxy in system environment variable with key http_proxy and ng e2e ran fine for me.

Related

Error: Failed to start debug session! in vscode-ros with ROS Melodic

I am trying to debug a ROS node inside VSCode but it seems that the debugger is not working. Please see below screen recordings:
Attaching a running node
Launching nodes
I noticed that attaching a node is requesting authentication. But after providing the correct password, nothing happens. Similarly, the launching nodes show processes for a second but die/disappear immediately.
Below is the version related information:
Visual Studio Code v1.74.3
VSCode-ROS Extension v0.8.4
ROS Melodic
GCC v7.5.0
Python v2.7.17
Ubuntu OS v18.04.6 LTS
Ubuntu OS Kenel v5.4.0-137-generic
The developer tools are showing following following error:
[Extension Host] rejected promise not handled within 1 second: Error: Failed to start debug session!
[Extension Host] stack trace: Error: Failed to start debug session!
at LaunchResolver.<anonymous> (/home/ravi/.vscode/extensions/ms-iot.vscode-ros-0.8.4/out/src/debugger/configuration/resolvers/ros1/launch.js:310:32)
at Generator.next (<anonymous>)
at fulfilled (/home/ravi/.vscode/extensions/ms-iot.vscode-ros-0.8.4/out/src/debugger/configuration/resolvers/ros1/launch.js:7:58)
at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
Please see a screenshot below:

webdriver-manager start: Error: connect ETIMEDOUT

I am configurating protractor environment by the http://www.protractortest.org/#/ website.When execute
webdriver-manager start
webdriver-manager: using global installed version 12.0.6
events.js:183
throw er; // Unhandled 'error' event
^
Error: connect ETIMEDOUT 192.30.255.116:443
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
But sometimes,it will execute success.
The environment is:
Protractor –version:5.2.0
Java –version:1.8.0_131
Node –v:v8.9.0
Npm –v:5.5.1
Can someone please telling me what is happening here. Your assistance is appreciated.
If you are behind a VPN, you may need to add a proxy.
> set HTTP_PROXY=http://proxy.host.blah:80
> set HTTPS_PROXY=http://proxy.host.blah:80
> webdriver-manager start
This worked for me anyway.

Error starting ionic project

I have installed Node.js to start with an ionic project.
I have also installed ionic and cordova using the commands below:
npm install ionic -g
npm install cordova -g
I am using the command below to create an ionic project:
ionic start myApp blank
And i m getting the following error:
D:\IonicWork>ionic start myApp blank
Creating Ionic app in folder D:\IonicWork\myApp based on blank project
Downloading: https://github.com/driftyco/ionic-app-base/archive/master.zip
Error with start Error: connect ETIMEDOUT 192.30.253.121:443
at Object.exports._errnoException (util.js:1036:11)
at exports._exceptionWithHostPort (util.js:1059:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1080:14)
Error Initializing app: Error: connect ETIMEDOUT 192.30.253.121:443
Error: connect ETIMEDOUT 192.30.253.121:443
at Object.exports._errnoException (util.js:1036:11)
at exports._exceptionWithHostPort (util.js:1059:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1080:14)
Caught exception:
Error: connect ETIMEDOUT 192.30.253.121:443
at Object.exports._errnoException (util.js:1036:11)
at exports._exceptionWithHostPort (util.js:1059:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1080:14)
Mind letting us know? https://github.com/driftyco/ionic-cli/issues
Please suggest.
Thanks,
Malini
If you are on a company network, you are most probably behind a corporate web proxy. There are plenty of solution out there.
For a headstart, you need to add http_proxy and https_proxy environment variables based on the proxy you got from your company IT department.
Open your node command prompt in administrator mode and run following command. After that, close and restart your node command prompt and try to run ionic start again.
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
Better to start in ionic creator.and its the better place for design also

Protractor tests run instable ( ETIMEDOUT )

We are working to make our Protractor E2E tests stable, so our development and deployment flow can depend on it.
However, until now we are not able to have a fully stable run of E2E tests.
Sometimes, inconsistent which, some test somewhere is failing due a ETIMEDOUT in ClientRequest in selenium-webdriver.
Failed: ETIMEDOUT connect ETIMEDOUT 5.255.93.10:80
Stack:
Error: ETIMEDOUT connect ETIMEDOUT 5.255.93.10:80
at ClientRequest.<anonymous> (/var/lib/jenkins/workspace/HPS UI E2E Tests/node_modules/grunt-protractor-runner/node_modules/selenium-webdriver/http/index.js:365:15)
at emitOne (events.js:90:13)
at ClientRequest.emit (events.js:182:7)
at Socket.socketErrorListener (_http_client.js:306:9)
at emitOne (events.js:90:13)
at Socket.emit (events.js:182:7)
at emitErrorNT (net.js:1265:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
From: Task: WebDriver.findElements(By(css selector, *[id="chart_doubleSlider_brush"]))
at WebDriver.schedule (/var/lib/jenkins/workspace/HPS UI E2E Tests/node_modules/grunt-protractor-runner/node_modules/selenium-webdriver/lib/webdriver.js:344:17)
at WebDriver.findElements (/var/lib/jenkins/workspace/HPS UI E2E Tests/node_modules/grunt-protractor-runner/node_modules/selenium-webdriver/lib/webdriver.js:897:22)
at /var/lib/jenkins/workspace/HPS UI E2E Tests/node_modules/grunt-protractor-runner/node_modules/protractor/built/element.js:141:44
at Promise.invokeCallback_ (/var/lib/jenkins/workspace/HPS UI E2E Tests/node_modules/grunt-protractor-runner/node_modules/selenium-webdriver/lib/promise.js:1329:14)
at TaskQueue.execute_ (/var/lib/jenkins/workspace/HPS UI E2E Tests/node_modules/grunt-protractor-runner/node_modules/selenium-webdriver/lib/promise.js:2790:14)
at TaskQueue.executeNext_ (/var/lib/jenkins/workspace/HPS UI E2E Tests/node_modules/grunt-protractor-runner/node_modules/selenium-webdriver/lib/promise.js:2773:21)
at /var/lib/jenkins/workspace/HPS UI E2E Tests/node_modules/grunt-protractor-runner/node_modules/selenium-webdriver/lib/promise.js:2652:27
at /var/lib/jenkins/workspace/HPS UI E2E Tests/node_modules/grunt-protractor-runner/node_modules/selenium-webdriver/lib/promise.js:639:7
at process._tickCallback (internal/process/next_tick.js:103:7)
We would like to have a way to stabilise this test, for example to have some kind of retry mechanism in the Protractor run or on low level a retry mechanism of the failed http request. Right now, we have not found any solution for it.
More information about our setup:
Our test-scripts are executed by a Jenkins machine.
We use grunt-protractor-runner to start our protractor tests.
The tests are executed on BrowserStack.
We set up a BrowserStack tunnel between BrowserStack and our Jenkins machine before the test start up. Since the application we test is on a private environment. ( we use https://www.npmjs.com/package/browserstacktunnel-wrapper )
We test on IE11, Chrome ( latest ), FireFox ( latest, 38, 31 ). However there is no relation between timeouts and the browser where testing on.
The execution time of our tests runs are 30 minutes for each browser.
We have set options.agent to http.Agent({keepAlive: true,keepAliveMsecs: 30 * 1000, timeout: 10 * 30 * 1000} of our http request, to keep the sockets open.
In the capabilities of Protactor we set 'browserstack.local': true and 'browserstack.debug': true.
We would like to hear your advice on how to stabilise our Protractor tests.

Derby app created using 'derby new test' not working

I've installed derbyjs using npm install -g derby and then created a test app using derby new test.
Then i started the app using node server.js and I got the following output:
info - socket.io started
Starting cluster with 1 workers in undefined mode
`kill -s SIGUSR2 7161` to force cluster reload
Go to: http://localhost:3000/
info - socket.io started
So I tried to request http://localhost:3000/, but the site does not finish loading and I get the following exception:
TEMPLATE ERROR
Error: Model mutation performed after bundling for clientId: 79f4a9f3-25fc-438d-b9f4-a450dccf9566
at Model.errorOnCommit [as _commit] (/web/derby/test/node_modules/derby/node_modules/racer/lib/bundle/bundle.Model.js:64:9)
at /web/derby/test/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:120:15
at next (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
at /web/derby/test/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:107:16
at next (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
at /web/derby/test/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:101:16
at next (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
at /web/derby/test/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:92:16
at next (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
at Object.run (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:10:12)
events.js:68
throw arguments[1]; // Unhandled 'error' event
^
Error: Cannot write after end
at Gzip.write (zlib.js:311:31)
at ServerResponse.res.write (/web/derby/test/node_modules/express/node_modules/connect/lib/middleware/compress.js:82:18)
at Object.View._render (/web/derby/test/node_modules/derby/lib/View.server.js:337:9)
at /web/derby/test/node_modules/derby/lib/View.server.js:276:10
at Array.2 (/web/derby/test/node_modules/derby/lib/View.server.js:300:5)
at Object.Promise.resolve (/web/derby/test/node_modules/derby/node_modules/racer/lib/util/Promise.js:21:19)
at /web/derby/test/node_modules/derby/lib/View.server.js:136:17
at /web/derby/test/node_modules/derby/lib/files.js:224:7
at Object.oncomplete (fs.js:308:15)
at process._makeCallback (node.js:248:20)
I have absolutely no idea how I can get it running... Is it a bug, or am I doing something wrong?
Update
I've created a bug report on the derby repository: https://github.com/codeparty/derby/issues/170