1 # this script is intended to be run in a VM
2 # running ubuntu 20.04 server
3 # from the root directory of this repo
5 echo "This script is intended to be run in a VM."
6 echo "It may do things to your OS that you don't want to be peristent."
7 echo "Please type virtualmachine to continue, or Ctrl-C to quit."
11 if [ "$passage" = "virtualmachine" ]; then
12 echo "Installing dev environment"
14 echo "Did not type virtualmachine, quitting with no changes applied"
18 # set up place for local binaries
20 echo "export PATH=$PATH:$HOME/.bin" >> $HOME/.bashrc
23 # allow python3 to be run with python command
24 ln -s /usr
/bin
/python3
$HOME/.bin
/python
26 # install firefox and other dependencies
27 sudo apt
-get -y install firefox
unzip openjdk
-11-jre-headless xvfb libxi6 libgconf
-2-4
29 curl
-sS -o - https
://dl
-ssl.google.com
/linux
/linux_signing_key.pub
| sudo apt
-key add
30 sudo sh
-c "echo \"deb https://dl.google.com/linux/chrome/deb/ stable main\" >> /etc/apt/sources.list.d/google-chrome.list"
31 sudo apt
-get -y update
32 sudo apt
-get -y install google
-chrome-stable
34 # install nodejs for running tests
35 curl
-o- https
://raw.githubusercontent.com
/nvm
-sh/nvm
/v0.36
.0/install.sh
| bash
38 export NVM_DIR
="$HOME/.nvm"
39 [ -s "$NVM_DIR/nvm.sh" ] && \.
"$NVM_DIR/nvm.sh" # This loads nvm
40 [ -s "$NVM_DIR/bash_completion" ] && \.
"$NVM_DIR/bash_completion" # This loads nvm bash_completion
45 npm
install --global jasmine
46 npm
install selenium
-webdriver
47 # install gecko webdriver for firefox
48 wget https
://github.com
/mozilla
/geckodriver
/releases
/download
/v0.27
.0/geckodriver
-v0.27
.0-linux64.
tar.gz
--output-document=/tmp
/geckodriver.
tar.gz
49 tar -xf /tmp
/geckodriver.
tar.gz
-C $HOME/.bin
50 # install chrome webdriver for chromium
51 wget https
://chromedriver.storage.googleapis.com
/85.0.4183.87/chromedriver_linux64.
zip --output-document=/tmp
/chromedriver.
zip
52 unzip /tmp
/chromedriver.
zip -d $HOME/.bin
56 # Xvfb :1 -screen 1 1024x768x24 & export DISPLAY=:1.1
57 # BROWSER=firefox jasmine spec/tests.js
58 # BROWSER=chrome jasmine spec/tests.js