Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

[BED] Onboarding (Selenium)

Josh Beveridge edited this page Mar 23, 2018 · 5 revisions

Back-end Onboarding - Selenium Setup

This guide will help you set up Selenium on your system. Please ensure you have the initial Back-end Onboarding complete and your development environment set up properly before attempting these steps.

Installation

Selenium setup can be done by following these steps:

  • Checkout the master branch.
  • Install Composer
  • Install Java
  • Inside your dev/selenium_testing folder, make sure you have the following files:
  • Check start.bat to ensure all file paths in the script point to the correct locations (including your Chrome installation).
  • Modify C:/windows/php.ini to ensure that extension=php_curl.dll is uncommented (this enables curl).
  • Inside NetBeans, right click on the TalentCloud project in the Project View and select "Composer" > "Install (Dev)"
  • Inside NetBeans, right click on the TalentCloud project in the Project View and select "Run Selenium Tests"
  • In the resulting pop-up, browse for selenium-server-standalone-3.11.0.jar
  • Inside NetBeans Options pane, under the PHP tab, enter the location for your PHPUnit file (devPHP5.6/phpunit-5.7.27.phar)
  • Inside NetBeans Options pane, under the PHP tab, enter the location for your PHPSkelGen file (devPHP5.6/phpunit-skelgen-2.0.1.phar)
  • Create the following folders inside dev: Selenium/screenshots
    • These folders are case sensitive.
  • Inside dev/selenium_testing, run start.bat and leave the resulting terminal window open.
  • Inside NetBeans, right click on the TalentCloud project in the Project View and select Run Selenium Tests

The result should cause a Chrome window to open, run the tests and then close again. NetBeans should return a Pass or Fail for each test depending on the results.

Running Tests

In order to run tests once the installation is complete, simply run the start.bat file in dev/selenium_testing, leave the window open, and run the tests in NetBeans.

start.bat

Can't find a copy of start.bat? Copy this into a new file inside of dev/selenium_testing:

@ECHO ON
start java -Dwebdriver.chrome.driver=C:\dev\selenium_testing\chromedriver.exe -Dselenium.LOGGER.level=WARNING -Dwebdriver.chrome.whitelistedIps="localhost,talentcloud.localhost,tc.gccollab.ca,netbeans.org" -Dwebdriver.chrome.bin="C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -Dwebdriver.firefox.bin="C:\dev\selenium_testing\geckodriver.exe" -Dwebdriver.edge.driver=C:\dev\selenium_testing\MicrosoftWebDriver.exe -Dscreenshot_dir="C:/dev/Selenium/screenshots/" -jar C:\dev\selenium_testing\selenium-server-standalone-3.11.0.jar -log log.txt