Skip to content
Snippets Groups Projects
Commit d7c4eaf7 authored by Rajab Natshah's avatar Rajab Natshah
Browse files

Issue #3278730: Switch to use Selenium Server Standalone 3.141.59 to follow...

Issue #3278730: Switch to use Selenium Server Standalone 3.141.59 to follow with Latest Chrome Browser and Chrome Driver options
parent 8bdd7c7f
No related branches found
No related tags found
1 merge request!24Issue #3301451: Composer is fixed to docroot folder Primary tabs View(active tab)
Showing
with 47 additions and 329 deletions
...@@ -68,9 +68,9 @@ commands: ...@@ -68,9 +68,9 @@ commands:
done done
echo Failed waiting for MySQL && exit 1 echo Failed waiting for MySQL && exit 1
## Install composer ~2.1 ## Install Composer
- run: - run:
name: Install composer ~2.1 name: Install Composer
command: | command: |
sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin/ --filename=composer --2; sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin/ --filename=composer --2;
composer config -g github-oauth.github.com $GITHUB_TOKEN composer config -g github-oauth.github.com $GITHUB_TOKEN
...@@ -207,13 +207,13 @@ commands: ...@@ -207,13 +207,13 @@ commands:
../bin/drush config:set system.logging error_level all --yes ../bin/drush config:set system.logging error_level all --yes
../bin/drush cr ../bin/drush cr
## Run selenium standalone server. ## Run Selenium Standalone server.
- run: - run:
name: Run selenium standalone server name: Run Selenium Standalone server
command: | command: |
if [[ ! -f /home/circleci/selenium-server-standalone-2.53.1.jar ]]; then wget -O /home/circleci/selenium-server-standalone-2.53.1.jar http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar; fi if [[ ! -f /home/circleci/selenium-server-standalone-3.141.59.jar ]]; then wget -O /home/circleci/selenium-server-standalone-3.141.59.jar https://github.com/SeleniumHQ/selenium/releases/download/selenium-3.141.59/selenium-server-standalone-3.141.59.jar; fi
cd /home/circleci/ cd /home/circleci/
java -jar selenium-server-standalone-2.53.1.jar -port 4445 java -jar selenium-server-standalone-3.141.59.jar -port 4445
background: true background: true
## Add testing users. ## Add testing users.
......
...@@ -63,33 +63,30 @@ default: ...@@ -63,33 +63,30 @@ default:
browserName: chrome browserName: chrome
version: "*" version: "*"
extra_capabilities: extra_capabilities:
loggingPrefs:
performance: ALL
browser: ALL
chromeOptions: chromeOptions:
w3c: false
args: args:
- "--headless"
- "--start-maximized"
- "--disable-gpu" - "--disable-gpu"
- "--window-size=1600,1200" - "--window-size=1600,1200"
- "--no-sandbox" - "--no-sandbox"
- "--disable-dev-shm-usage" - "--disable-dev-shm-usage"
- "--disable-setuid-sandbox" - "--disable-setuid-sandbox"
w3c: false - "--disable-web-security"
chrome: - "--DNS-prefetch-disable"
switches: - "--disable-translate"
- "--headless" - "--ignore-certificate-errors"
- "--start-maximized" - "--test-type"
- "--disable-gpu" - "--disable-extensions"
- "--window-size=1600,1200" - "--incognito"
- "--no-sandbox" - "--disable-infobars"
- "--disable-dev-shm-usage" - "--remote-debugging-port=9222"
- "--disable-setuid-sandbox" - "--allowed-ips=*"
- "--disable-web-security" - "--whitelisted-ips=*"
- "--DNS-prefetch-disable"
- "--whitelisted-ips"
- "--disable-translate"
- "--ignore-certificate-errors"
- "--test-type"
- "--disable-extensions"
- "--incognito"
- "--ignore-certificate-errors"
- "--disable-infobars"
base_url: 'http://varbase.test' base_url: 'http://varbase.test'
# browser_name: 'firefox' # browser_name: 'firefox'
browser_name: 'chrome' browser_name: 'chrome'
......
...@@ -148,12 +148,12 @@ sudo mv -f chromedriver /usr/bin/ ...@@ -148,12 +148,12 @@ sudo mv -f chromedriver /usr/bin/
rm chromedriver_linux64.zip rm chromedriver_linux64.zip
``` ```
### Get selenium standalone server. ### Get Selenium Standalone server.
``` ```
wget http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar wget https://github.com/SeleniumHQ/selenium/releases/download/selenium-3.141.59/selenium-server-standalone-3.141.59.jar
``` ```
## Run selenium standalone server. ## Run Selenium Standalone server.
``` ```
$ java -jar selenium-*.jar -port 4445 $ java -jar selenium-*.jar -port 4445
...@@ -180,32 +180,30 @@ To run the automated testing with behat you will need to change the [ wd_host an ...@@ -180,32 +180,30 @@ To run the automated testing with behat you will need to change the [ wd_host an
browserName: chrome browserName: chrome
version: "*" version: "*"
extra_capabilities: extra_capabilities:
loggingPrefs:
performance: ALL
browser: ALL
chromeOptions: chromeOptions:
w3c: false
args: args:
- "--headless"
- "--start-maximized"
- "--disable-gpu" - "--disable-gpu"
- "--window-size=1920,1080" - "--window-size=1600,1200"
w3c: false - "--no-sandbox"
chrome: - "--disable-dev-shm-usage"
switches: - "--disable-setuid-sandbox"
- "--headless" - "--disable-web-security"
- "no-sandbox" - "--DNS-prefetch-disable"
- "--no-sandbox" - "--disable-translate"
- "--disable-web-security" - "--ignore-certificate-errors"
- "--DNS-prefetch-disable" - "--test-type"
- "--whitelisted-ips" - "--disable-extensions"
- "--start-maximized" - "--incognito"
- "--disable-translate" - "--disable-infobars"
- "--ignore-certificate-errors" - "--remote-debugging-port=9222"
- "--test-type" - "--allowed-ips=*"
- "--disable-dev-shm-usage" - "--whitelisted-ips=*"
- "--disable-extensions"
- "incognito"
- "enable-precise-memory-info"
- "ignore-certificate-errors"
- "disable-infobars"
- "js-flags=--expose-gc"
- "--profile-directory=Default"
- "--user-data-dir=~/.config/google-chrome"
base_url: 'http://varbase.test' base_url: 'http://varbase.test'
# browser_name: 'firefox' # browser_name: 'firefox'
browser_name: 'chrome' browser_name: 'chrome'
......
A list of Gherkin features, which help in testing drush commands.
and helps in setting the development and production environment.
If you want to test the any of the tools features, you will need to use the
varbase tools config file, as you can see in the following command.
$ bin/behat --config=behat.varbase-tools.yml tools/drush/clear-flood.feature
$ bin/behat --config=behat.varbase-tools.yml tools/drush/drush-dis-ds_ui.feature
$ bin/behat --config=behat.varbase-tools.yml tools/drush/drush-en-ds_ui.feature
$ bin/behat --config=behat.varbase-tools.yml tools/drush/on-development.feature
$ bin/behat --config=behat.varbase-tools.yml tools/drush/on-production.feature
Feature: Clear flood.
As a Developer
I want to be able to clear the flood table when I see the following message
"Sorry, there have been more than 5 failed login attempts for this account.
It is temporarily blocked. Try again later or request a new password."
So that will be able to let the blocked user login to the site
@api @tools @local @development
Scenario: Delete all recourds in the flood table.
Given I run drush "sqlq 'DELETE FROM flood'"
Then print last drush output
Feature: Disable ds_ui module.
@api @tools @local @development
Scenario: Disable ds_ui module.
Given I run drush "dis" "ds_ui -y"
Then print last drush output
Feature: Enable Display suite ui module.
@api @tools @local @development
Scenario: Enable ds_ui.
Given I run drush "en" "ds_ui -y"
Then print last drush output
A list of Gherkin features to test Google!!! sites.
A list of Gherkin features, which help in testing drush commands.
and helps in setting the development and production environment.
If you want to test the any of the tools features, you will need to use the
varbase tools config file, as you can see in the following command.
$ bin/behat --config=behat.varbase-tools.yml tools/google/gmail.feature
$ bin/behat --config=behat.varbase-tools.yml tools/google/search.feature
Feature: Check the inbox for emails using the testing@vardot.com email
@javascript @tools @google
Scenario: Login to the testing@vardot.com email.
Given I go to "https://accounts.google.com" website
When I fill in "testing@vardot.com" for "Email"
And I press "Next"
Then I should see "Sign in with your Google Account "
When I fill in "The Password for the testing Email" for "Passwd"
And I press "Sign in"
And wait
And I go to "https://mail.google.com/mail/u/0/#inbox"
And wait
Then I should see "Inbox"
And I wait for 1m
Feature: Search google
@javascript @tools @google
Scenario: To search in Google about Varbase.
Given I go to "http://google.com" website
And wait
Then I should see "Google"
When I fill in "Varbase" for "q"
And I press "Search"
And wait for 10s
Then I should see "results"
And I wait 20s
# Selenium Server
# Installing and configuring selenium server to work for each automated testing session #
Some time I do test using some internal or external selenium server, but they
do not have the option of restarting every thing from the beginning .
I just want a very fast and basic solution, if the test finish I want the
selenium server to restart, and gave me a fresh start for the next automated
testing session.
I made this list of script with a basic installer which:
- Have Selenium standalone server will downloaded and installed on your localhost or server.
- Then selenium will start working after reboots.
- This selenium server will start at the 4445 port number.
You will need to have Java first.
================================================================================
$ sudo apt-get install openjdk-8-jdk
$ sudo apt-get install openjdk-8-jre
================================================================================
Run the following command to install selenium server 2.53.1:
================================================================================
$ sh ./install-selenium-server-2.53.1.sh
================================================================================
Run the following command to install selenium server 3.0.1:
================================================================================
$ sh ./install-selenium-server-3.0.1.sh
================================================================================
We could use the following commands to control the server
================================================================================
sudo /etc/init.d/selenium start
sudo /etc/init.d/selenium stop
sudo /etc/init.d/selenium restart
================================================================================
If you want to Uninstall :
================================================================================
$ sh ./uninstall-selenium-server.sh
================================================================================
Then Reboot.
The only thing we do need is a reset Button to restart the selenium server to
work in a new automated testing session.
#!/bin/bash
echo "Getting selenium server standalone 2.53.1\n"
wget http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar
java -jar selenium-server-standalone-2.31.0.jar -port 4445 > /dev/null &
echo "[ OK ] Starting Selenium on the 4445 port ..."
#!/bin/bash
echo "Getting selenium server standalone 3.0.1\n"
wget http://selenium-release.storage.googleapis.com/3.0-beta3/selenium-server-standalone-3.0.1.jar
java -jar selenium-server-standalone-3.0.1 -port 4445 > /dev/null &
echo "[ OK ] Starting Selenium on the 4445 port ..."
#!/bin/bash
if [ ! -d "/usr/lib/selenium" ]; then
sudo mkdir /usr/lib/selenium
echo "Created selenium directory in /usr/lib.\n"
echo "Getting selenium server standalone 2.53.1\n"
sudo wget http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar
sudo mv selenium-server-standalone-2.53.1.jar /usr/lib/selenium/selenium-server-standalone-2.53.1.jar
sudo ln -s /usr/lib/selenium/selenium-server-standalone-2.53.1.jar /usr/lib/selenium/selenium-server-standalone.jar
echo "The selenium server standalone is ready in the server.\n"
sudo mkdir -p /var/log/selenium
sudo chmod a+w /var/log/selenium
echo "Created the logs for selenium.\n"
sudo cp selenium.sh /etc/init.d/selenium
sudo chmod 755 /etc/init.d/selenium
sudo update-rc.d selenium defaults 4445
echo "Installed selenium server.\n"
sudo /etc/init.d/selenium start
else
echo "Selenium is installed.\nIf you want to update or install you will need:\n to run ./uninstall-selenium-server.sh first"
fi
#!/bin/bash
if [ ! -d "/usr/lib/selenium" ]; then
sudo mkdir /usr/lib/selenium
echo "Created selenium directory in /usr/lib.\n"
echo "Getting selenium server standalone 3.0.1\n"
sudo wget http://selenium-release.storage.googleapis.com/3.0-beta3/selenium-server-standalone-3.0.1.jar
sudo mv selenium-server-standalone-3.0.1.jar /usr/lib/selenium/selenium-server-standalone-3.0.1.jar
sudo ln -s /usr/lib/selenium/selenium-server-standalone-3.0.1.jar /usr/lib/selenium/selenium-server-standalone.jar
echo "The selenium server standalone is ready in the server.\n"
sudo mkdir -p /var/log/selenium
sudo chmod a+w /var/log/selenium
echo "Created the logs for selenium.\n"
sudo cp selenium.sh /etc/init.d/selenium
sudo chmod 755 /etc/init.d/selenium
sudo update-rc.d selenium defaults 4445
echo "Installed selenium server.\n"
sudo /etc/init.d/selenium start
else
echo "Selenium is installed.\nIf you want to update or install you will need:\n to run ./uninstall-selenium-server.sh first"
fi
#!/bin/bash
case "${1:-''}" in
'start')
if test -f /tmp/selenium.pid
then
echo "Selenium is already running."
else
java -jar /usr/lib/selenium/selenium-server-standalone.jar -port 4445 > /var/log/selenium/output.log 2> /var/log/selenium/error.log & echo $! > /tmp/selenium.pid
echo "[ OK ] Starting Selenium on the 4445 port ..."
error=$?
if test $error -gt 0
then
echo "[ Error ] ${bon}Error $error! Could not start Selenium!${boff}"
fi
fi
;;
'stop')
if test -f /tmp/selenium.pid
then
echo "Stopping Selenium..."
PID=`cat /tmp/selenium.pid`
kill -3 $PID
if kill -9 $PID ;
then
sleep 2
test -f /tmp/selenium.pid && rm -f /tmp/selenium.pid
else
echo "[ Error ] Selenium could not be stopped ..."
fi
else
echo "[ Error ] Selenium is not running."
fi
;;
'restart')
if test -f /tmp/selenium.pid
then
kill -HUP `cat /tmp/selenium.pid`
test -f /tmp/selenium.pid && rm -f /tmp/selenium.pid
sleep 1
java -jar /usr/lib/selenium/selenium-server-standalone.jar -port 4445 > /var/log/selenium/output.log 2> /var/log/selenium/error.log & echo $! > /tmp/selenium.pid
echo "[ OK ] Reload Selenium on the 4445 port ..."
else
echo "[ Error ] Selenium isn't running..."
fi
;;
*) # no parameter specified
echo "Usage: $SELF start|stop|restart"
exit 1
;;
esac
#!/bin/bash
if [ -d "/usr/lib/selenium" ]; then
sudo /etc/init.d/selenium stop
sudo rm -rf /usr/lib/selenium
echo "\nDeleted selenium.\n"
sudo rm -rf /var/log/selenium
echo "Deleted logs.\n"
sudo update-rc.d -f selenium remove
echo "Removed selenium server.\n"
else
echo "You can not uninstall Selenium is NOT installed."
fi
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment