Skip to content

Commit f3b66d3

Browse files
authored
8 Shell scripts
8 Shell scripts for this directory, in SH and SWP formats.
1 parent 210e81e commit f3b66d3

File tree

8 files changed

+95
-0
lines changed

8 files changed

+95
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
os_name=`uname`
3+
chromedriver_dir="chromedriver"
4+
if [ ! -d $chromedriver_dir ]; then
5+
mkdir $chromedriver_dir
6+
fi
7+
8+
echo "downloading chromedriver"
9+
10+
if [[ $os_name == 'Linux' && ! -f $chromedriver_dir/chromedriver ]]; then
11+
cd chromedriver && curl -L https://chromedriver.storage.googleapis.com/2.39/chromedriver_linux64.zip > tmp.zip && unzip -o tmp.zip && rm tmp.zip
12+
# wait until download finish
13+
sleep 5
14+
elif [[ $os_name == 'Darwin' && ! -f $chromedriver_dir/chromedriver ]]; then
15+
cd chromedriver && curl -L https://chromedriver.storage.googleapis.com/2.39/chromedriver_mac64.zip | tar xz
16+
sleep 5
17+
fi
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
os_name=`uname`
3+
4+
if [ -f geckodriver ]; then
5+
exit 0
6+
fi
7+
echo "downloading gechdriver"
8+
9+
if [[ $os_name == 'Linux' ]]; then
10+
cd ../ && curl -L https://github.com/mozilla/geckodriver/releases/download/v0.11.1/geckodriver-v0.11.1-linux64.tar.gz | tar xz
11+
sleep 5
12+
elif [[ $os_name == 'Darwin' ]]; then
13+
cd ../ && curl -L https://github.com/mozilla/geckodriver/releases/download/v0.11.1/geckodriver-v0.11.1-macos.tar.gz | tar xz
14+
sleep 5
15+
fi
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
DIR="../webdriverio-test"
3+
FILE=selenium-server-standalone-3.0.1.jar
4+
5+
if [ ! -d $DIR ]; then
6+
mkdir $DIR
7+
fi
8+
9+
echo "downloading selenium jar"
10+
11+
if [ ! -f $DIR/$FILE ]; then
12+
cd $DIR && curl -O http://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.0.1.jar
13+
sleep 5
14+
fi
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
#check if selenium server is up running
4+
pid=`lsof -ti tcp:4444`
5+
if [ $? -eq 0 ]
6+
then
7+
kill -9 $pid
8+
fi
9+
java -jar -Dwebdriver.gecko.driver=../geckodriver -Dwebdriver.chrome.driver="chromedriver/chromedriver" ../webdriverio-test/selenium-server-standalone-3.0.1.jar &
10+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
if [ "${TRAVIS_OS_NAME}" == "linux" ]
4+
then
5+
export CHROME_BIN="/usr/bin/google-chrome"
6+
export DISPLAY=:99.0
7+
sh -e /etc/init.d/xvfb start &
8+
fi
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
if [ "${TRAVIS_OS_NAME}" == "osx" ]
4+
then
5+
brew cask install google-chrome
6+
sudo Xvfb :99 -ac -screen 0 1024x768x8 &
7+
export CHROME_BIN="/Applications/Google Chrome.app"
8+
fi
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
EXIT_STATUS=0
4+
5+
function check_command {
6+
"$@"
7+
local STATUS=$?
8+
if [ $STATUS -ne 0 ]; then
9+
echo "error with $1 ($STATUS)" >&2
10+
EXIT_STATUS=$STATUS
11+
fi
12+
}
13+
14+
check_command tests/scripts/get_geckdriver.sh
15+
sleep 5
16+
check_command tests/scripts/get_selenium.sh
17+
sleep 5
18+
check_command tests/scripts/get_chromedriver.sh
19+
sleep 10
20+
check_command tests/scripts/selenium_connect.sh
21+
sleep 10
22+
23+
exit $EXIT_STATUS

0 commit comments

Comments
 (0)