Is it possible to override node_modules/protracor/config.json from the project package.json? - json

I have edited my protractor config.json file to update the default version that it installs. When I run this, the desired latest version is downloaded into my project folder.
I want to extend this solution to other project users, but editing their local config.json may not be an option (the protractor files are only generated on npm install). Is there a way to specify the updated version within the project (package.json) that will override the specified version?
Snippet from the protractor/config.json
"webdriverVersions": {
"chromedriver": "xx",
}
I'm also changing a value in the protractor/bin/webdriver-manager to point to a 64.zip version of the chromedriver, rather than the default 32.zip (this one does not exist) Any ideas on how to override that too would be greatly appreciated.
Thank you in advance!

The latest version of Protractor (4.0.10) has a fix for the chromedriver download issue. This should download the latest chromedriver (2.25). Please update to the latest.

Related

How can I download Appropriate Chromedriver in Protractor using Webdriver-Manager

I have designed a cucumber-protractor based automation framework where everything is working fine except for the Webdriver-manager. I need to update the binaries manually each time the IT Department updates google chrome version.
When i use command "webdriver-manager update --proxy=http://someproxy.com:PORT#", webdriver-manager always downloads the latest chromdriver binaries instead of a compatible version as per the current Chrome Version.
Please help me if there is a way to determine the chrome version automatically and download the corresponding Chrome binaries.
I have tried to search for similar behavior and forums elsewhere but none of the commands work. Instead it always downloads the latest version of chromedriver binaries instead of a compatible one.
Please help with some sample code in-case you come through a solution to this.
You could run a sh prior to starting your tests that will determine wether the chromedriver needs to be updated:
#!/bin/bash
# get existing chromedriver version
EXISTING_CD_VERSION=$(node_modules/.bin/chromedriver -version | egrep -o '(\d+)\.(\d+)\.(\d+)')
# get installed Google Chrome version
CHROME_VERSION=$(/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version | egrep -o '(\d+)\.(\d+)\.(\d+)')
if [ "$EXISTING_CD_VERSION" = "$CHROME_VERSION" ]; then
echo "ChromeDriver version matches the Google Chrome version"
else
NEW_CD_VERSION=$(curl https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_VERSION)
node_modules/.bin/webdriver-manager update --versions.chrome $NEW_CD_VERSION
fi
NOTE: The script above is getting the Google Chrome version from a MacOS system. If you're on Linux, you need to change that to google-chrome --version
https://github.com/angular/webdriver-manager/blob/legacy/docs/versions.md
webdriver-manager start --versions.chrome 87.0.4280.88
you can use --versions.chrome to specify the driver version
what you actually need to do is to match a version of your local chrome to the version of chromedriver. So
First, find out what your version of chrome is. From example it is 86.0.4240.111
Then, find out what chromedriver version can be used. Take the major version of the browser (first 3 numbers, 86.0.4240 in our case) and find the corresponding version of the driver by going to this url https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION} (put the major browser version instead of ${CHROME_VERSION}). You'll see the chromedriver you're looking for is 86.0.4240.22
then just update webdriver specifying the desired version of chromedriver
webdriver-manager update --gecko=false --versions.chrome $VERSION
Make sure to put 86.0.4240.22 instead of $VERSION
But it maybe tricky here because there are 2 installation of protractor usually:
local
global
and each has it's own webdriver-manager. So make sure you're updating the right one
Thus you may need to go to it's folder and from that folder run npm i webdriver-manager#latest and then node ./bin/webdriver-manager update --gecko=false
when you updated the right webdriver, install the right chromedriver like so
node ./bin/webdriver-manager update --gecko=false --versions.chrome $VERSION

How to update the upper_constraints.txt in devstack

I'm hitting a problem with the upper_constraints file that devstack uses when installing (on CentOS).
This file is built at runtime? Does anyone know how I can edit this file?
My problem is that the upper_constraints.txt sets libvirt-python===3.10.0. I've installed the latest version of libvirt-python which is 4.10.0.
When I try to install 3.10.0, I'm hitting a wheel error.
If I can change the upper_constraints to go with the later version, I may be able to get around this issue but don't see where I can edit it (no point editing the file as it's dynamically built).
Any help appreciated.
Found two upper_constraints files. One is in the python site-packages. Updated both and that has fixed it (or at least moved me on to the next install error!)

How do I use electron-compile?

I'm having trouble with electron-compile.
The docs state
How does it work? (Easiest Way)
Change your reference to electron-prebuilt to electron-prebuilt-compile. Tada! You did it.
What reference, where? You can't be talking about package.json?
I've always run electron using supervisor -x "electron" -i "./" .
What am I completely missing / what should be the contents of my pull request to make this clearer?
I've installed electron-compile with npm i electron-compile --save-dev
I'd like to have es2015/jsx precompiled to es5, so that I can run a react application in electron. electron-compile appears to solve this problem.
You should install Electron as a dev reference in package.json, yes:
npm install --save-dev electron-prebuilt-compile
Don't install Electron as a global because then other people have to set stuff up to run your app (i.e. they now have to micromanage which version of Electron they have installed globally)
With the recent versions (electron 1.3.5), I was unable to get electron-prebuilt-compile working, well it works for development but packaging for production has no real working examples.
It seems the compiling and packaging needs to be done manually, so in case anyone needs a working example, it's here. Hope to save someone some time and pain.

Is there an option to have Bower and NPM automatically update their packages in Visual Studio 2015 when their source-controlled .json files change?

Currently, when you Get Latest from source control, and the bower.json or package.json files have changed, you still need to open and make a minor change to the file and re-save it in order for VS to be aware of the change and execute NPM or bower and pull updates. Ideally, it would detect the change and execute it immediately upon getting the latest .json files. I can understand the case for not wanting this to be the default behavior, but without this, our entire dev team needs to be notified and perform the extra steps whenever a .json file change is checked in (fairly often).
Is there an environment setting in VS that impacts this, or a feasible workaround that anyone is aware of?
No, there is no such setting in VS IDE.
As you figured out that when you save any changes to the package.json or bower.json file, Visual Studio automatically install or restore all packages. However, the auto check is not triggered when you get file from TFS version control.
You can, however, create a licenser to license to the GettingEventHandler event. Once the event is triggered, run the scripts to install the updates:
npm install -g bower-check-updates
npm-check-updates -u
bower-check-updates -u
npm install

PhpStorm is not starting up

I just downloaded PhpStorm 5 on my quite fresh ubuntu.
During the first start I installed a couple of plug-ins.
Now - after the installation of those plug-ins - PhpStorm is not starting up anymore.
No splash screen is showing up. No error gets written on the terminal:
gue#ubuntu:~$ phpstorm
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)
gue#ubuntu:~$
What shall I do with that drunken sailor?
I can't find any logfiles, no configuration file/directory in my home directory.
Since I'm used to Eclipse I've no clue where to look for a trace in this IntelliJ derivate...
If you're on Windows deleting the following directory helped me:
C:\Users\<user>\AppData\Roaming\JetBrains\
Some plug-ins can cause problems and prevent IDE from starting, if it happens, you should delete the directory containing plug-in manually. Location of this directory depends on the system and product, details are available in the FAQ.
For PhpStorm on Linux it would be ~/.WebIde50/config/plugins.
This happend to me too, I had created a custom vmoptions file, and entered incorrect values. I fixed it by deleting it in ~/.WebIde50/phpstorm.vmoptions
i had the same problem , i fixed it just with removing the file C:\Users\.PhpStorm2016.2
In linux, I fixed it by deleting vmoptions file of PhpStorm and then launching it again:
mv ~/.config/JetBrains/PhpStorm*/phpstorm64.vmoptions ~/.config/JetBrains/PhpStorm*/__phpstorm64.vmoptions
It might be possible if openjdk is installed then phpstorm not opened.
So remove first then follow steps that given in below link.
I solve the problem same way.
wiki.jetbrains.net/intellij/Installing_and_running_PHPStorm_on_Ubuntu
Here is how you fix this: Rename C:\Users\USERNAME.PhpStorm2016.3 to something else (anything, like PhpStorm2016.whatever) , it will start the program if you click on the phpStorm icon, then choose to import settings, and you're good to go ;)
I am using PhpStorm2020.2.1. I referred to Configuration directory. I accessed the folder %AppData%\JetBrains\PhpStorm2020.2, renamed it just in case I may need some files in future.
Voila! I can start my PhpStorm2020.2.1 again!
I had this problem yesterday and my OS is windows 10. phpStorm suddenly did not work and when I click on it nothing happened. I just downloaded JDK from this link (https://www.oracle.com/java/technologies/javase-downloads.html) and after installation, I set the environment value in the system setting for my java directory. You can use this link to set the environment (https://javatutorial.net/set-java-home-windows-10)
For me I had to remove all cache for the IDE located in:
~/.cache/JetBrains/
I have changed the VMOptions under the Help menu on MacOS and it just would not start up again. It just silently failed every time. I found the file at /Applications/PhpStorm.app/Contents/MacOS/phpstorm and ran it in the terminal, which gave me an output with the following error:
Invalid ReservedCodeCacheSize=3072M. Must be at most 2048M.
Luckily, it also gave me the path to the VMOptions file in one of the rows of the output, parseVMOptions: /Users/barnabas/Library/Application Support/JetBrains/PhpStorm2022.3/phpstorm.vmoptions in my case, so I could change it back to a valid configuration. Crisis averted.
Simple
Go to your task manager
end any task on php-storm
and restart the ide again
it will work
Open Terminal Linux Ubuntu 20.10
YOU#USER:~$ cd ~/.config
YOU#USER:~/.config$ ls
Obs: Locate the >>> JetBrains <<< folder, after that delete it your default app settings will disappear more it will open again
YOU#USER:~/.config$ sudo rm -rf JetBrains/
Open PHPSTORM