sh CentOS 7 RHEL 7和fedora上的Selenium,Firefox和Behat

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh CentOS 7 RHEL 7和fedora上的Selenium,Firefox和Behat相关的知识,希望对你有一定的参考价值。

#!/usr/bin/env bash

# help from:
#   https://gist.github.com/textarcana/5855427
#   http://tecadmin.net/install-firefox-on-linux/

# install deps
yum install -y java Xvfb firefox

# This version of FF doesn't actually work with latest selenium (for me) so I remove it again
# We initially install firefox with yum so all the deps are included
yum remove -y firefox

# get selenium server
wget http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.0.jar

# move it to a known location
mv selenium-server-standalone-2.53.0.jar /opt/selenium-server-standalone.jar

# install latest extended release FF
wget http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/45.0/linux-x86_64/en-US/firefox-45.0.tar.bz2
tar -xvjf firefox-45.0.tar.bz2
mv firefox /usr/local/firefox
ln -s /usr/local/firefox/firefox /usr/local/bin/firefox

# create a fake monitor
Xvfb :99 -ac -screen 0 1280x1024x24 &> /dev/null &
# export the environment var for Firefox
echo "export DISPLAY=:99" >> ~/.profile

# run the server
java -jar /opt/selenium-server-standalone.jar &> /dev/null &

# Ready to run behat tests

echo "done"

以上是关于sh CentOS 7 RHEL 7和fedora上的Selenium,Firefox和Behat的主要内容,如果未能解决你的问题,请参考以下文章

Install MySQL 5.7 on Fedora 25/24, CentOS/RHEL 7.3/6.8/5.11

如何在RHEL/CentOS 7以及Fedora中配置FirewallD

解决 RHEL 7/ CentOS 7/Fedora 出现Unit iptables.service failed to load

解决 RHEL 7/ CentOS 7/Fedora 出现Unit iptables.service failed to load

Install Adobe Flash Player 11.2 on CentOS/RHEL 7/6/5, Fedora 20/19

Google Chrome 55 Released – Install on RHEL/CentOS 7/6 and Fedora 25-20