1
1
mirror of https://github.com/aelve/guide.git synced 2024-11-25 07:52:52 +03:00

Updated Selenium tests (markdown)

Aaron Friel 2017-02-01 19:42:13 -06:00
parent 070882372a
commit 858f6331ce

@ -1,48 +1,51 @@
## Running tests
## Setting up Selenium with the Chromium webdriver:
### Setting up Selenium with the Chromium webdriver:
Instructions assume Ubuntu 16.04/16.10, but package managers for your distribution should have working distributions.
Instructions assume Ubuntu 16.04/16.10, but package managers for your distribution should have working distributions.
1. Java runtime (`java`). 
The Oracle JVM can be installed with:
1. Java runtime (`java`).
The Oracle JVM can be installed with:
Note: These instructions are incomplete if using OpenJDK.
```
apt install oracle-java8-installer
```
```
apt install oracle-java8-installer
```
2. Selenium stand-alone server.
Obtain the standalone server from the [Selenium downloads page](http://docs.seleniumhq.org/download/).
  Note: These instructions are incomplete if using OpenJDK.
Using the current download link (as of Feb 2. 2017) to download it to your home directory:
2. Selenium stand-alone server.
```
wget https://goo.gl/Lyo36k -o ~/selenium-server-standalone.jar
```
Obtain the standalone server from the [Selenium downloads page](http://docs.seleniumhq.org/download/).
3. Chromium webdriver.
Using the current download link (as of Feb 2. 2017) to download it to your home directory:
```
wget https://goo.gl/Lyo36k -o ~/selenium-server-standalone.jar
```
This will install the `chromedriver` binary to `/usr/lib/chromium-browser/chromedriver` on Ubuntu. Take note of the location of the binary if your package manager uses.
3. Chromium webdriver.
This will install the `chromedriver` binary to `/usr/lib/chromium-browser/chromedriver` on Ubuntu. Take note of the location of the binary if your package manager uses.
```
apt install chromium-chromedriver
```
```
apt install chromium-chromedriver
```
4. (Optional) For headless operation, xvfb.
4. (Optional) For headless operation, xvfb.
The X virtual framebuffer will allow Chromium to run for tests on a server, this is not necessary if using a desktop with X or X forwarding.
The X virtual framebuffer will allow Chromium to run for tests on a server, this is not necessary if using a desktop with X or X forwarding.
```
apt install xvfb
```
```
apt install xvfb
```
5. Launching Selenium.
The path to the `chromedriver` binary needs to be given when launching the server, as follows:
The path to the `chromedriver` binary needs to be given when launching the server, as follows:
```
java -Dwebdriver.chrome.driver=/usr/lib/chromium-browser/chromedriver -jar ~/selenium-server-standalone.jar
@ -50,7 +53,7 @@ Instructions assume Ubuntu 16.04/16.10, but package managers for your distrib
### With Stack
Before running the test suite, you will need to launch Selenium and the server will run during tests.
Before running the test suite, you will need to launch Selenium and the server will run during tests.
To run the full testsuite, do `stack test`. You'll need Selenium server running.