bigbluebutton-Github/bigbluebutton-html5/tests/webdriverio/INSTALL.md
Maxim Khlobystov b0762b9d84 Update the acceptance testing docs
This commit does the following updates:
- fixes the misprint that prevented Chrome from being installed
- removes the step of creating the `tools` directory (we don't need this anymore, since the directory is commited now)
2017-06-04 23:52:04 +00:00

3.5 KiB

Acceptance Testing in HTML Client. Getting Started

The test suite for HTML5 client is currently under active development. The following instructions will help you install all the necessary tools and libraries to run the exiting specs and start writing your own tests.

Run Selenium Server

Assuming that you have the BigBlueButton repository in /home/firstuser/dev, navigate to the directory containing acceptance tests:

$ cd /home/firstuser/dev/bigbluebutton/bigbluebutton-html5/tests/webdriverio

Now, you should navigate to the tools directory inside webdriverio. This folder will store all the Selenium- and browser-related third-party files that you need to download.

Download Selenium jar file:

$ curl -O http://selenium-release.storage.googleapis.com/3.4/selenium-server-standalone-3.4.0.jar

and browser-specific WebDriver server.

Firefox WebDriver (GeckoDriver):

$ curl -L https://github.com/mozilla/geckodriver/releases/download/v0.16.1/geckodriver-v0.16.1-linux64.tar.gz | tar xz

Chrome WebDriver (ChromeDriver):

$ wget https://chromedriver.storage.googleapis.com/2.29/chromedriver_linux64.zip
$ unzip chromedriver_linux64.zip

Along with the WebDriver, you need to install the browser itself.

How to install Chrome:

$ wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
$ sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
$ sudo apt-get update
$ sudo apt-get install google-chrome-stable

How to install Firefox:

$ wget sourceforge.net/projects/ubuntuzilla/files/mozilla/apt/pool/main/f/firefox-mozilla-build/firefox-mozilla-build_52.0-0ubuntu1_amd64.deb
$ sudo dpkg -i firefox-mozilla-build_52.0-0ubuntu1_amd64.deb

In order to run headless browser, we will use Xvfb display server:

$ sudo apt-get install xvfb

At this point, you can run the Selenium server (replace ./geckodriver with ./chromedriver if you use Chrome):

$ xvfb-run java -jar selenium-server-standalone-3.4.0.jar

If you get an error Xvfb failed to start, run it with an -a option (Xvfb will use another display if the current one is already in use):

$ xvfb-run -a java -jar selenium-server-standalone-3.4.0.jar

Congratulations! You have Selenium server up and running. It is ready to handle your test cases. Now, keep the xvfb-run process running and continue in a new terminal session.

Run the test specs

We use WebdriverIO interface to write the acceptance test cases. In order to execute the existing tests, you need to use wdio test runner. By default, it will look into any *.spec.js file inside the /home/firstuser/dev/bigbluebutton/bigbluebutton-html5/tests/webdriverio/specs directory. You can change the location of the test specs by modifying the wdio config file: wdio.conf.js (inside the webdriverio directory).

Before proceeding any further, make sure HTML5 client is up and running. Node.js installation is also required:

$ sudo apt-get install nodejs-legacy

You can run all of the existing test specs with a single npm command:

$ cd /home/firstuser/dev/bigbluebutton/bigbluebutton-html5
$ npm run test

Test suites

To make it easier to run a single specific set of tests, we group the specs into test suits. All the suits are defined in wdio.conf.js.

To run a single test suite, you need to pass its name to the npm script:

$ npm run test -- --suite login