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

    and browser-specific WebDriver server.

    Firefox WebDriver (GeckoDriver):

    $ curl -L | tar xz

    Chrome WebDriver (ChromeDriver):

    $ wget
    $ unzip

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

    How to install Chrome:

    $ wget -q -O - | sudo apt-key add -
    $ sudo sh -c 'echo "deb [arch=amd64] 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
    $ sudo dpkg -i firefox-mozilla-build_53.0.3-0ubuntu1_amd64.deb

    There are 5 browsers currently used in the test specs (multiremote mode): Chrome Stable/Dev/Mobile, Firefox Stable/Nightly.

    You will need to install the current dev version of Chrome with the following command (test runner will be able to find it in /opt/google/chrome-unstable/google-chrome-unstable):

    sudo apt-get install google-chrome-unstable

    Nightly build of Firefox is also required (test runner will look for it in /usr/lib/firefox-trunk/firefox-trunk):

    sudo add-apt-repository ppa:ubuntu-mozilla-daily/ppa
    sudo apt-get update
    sudo apt-get install firefox-trunk

    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 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 test -- --suite login

    If you want to run a single spec (test file), --spec option can be used:

    $ npm test -- --spec ./tests/webdriverio/specs/login.spec.js