/d-installer-test-selenium

Experimental integration tests for the D-Installer (using Selenium and Webdriver)

Primary LanguageRubyGNU General Public License v2.0GPL-2.0

D-installer Integration Tests

This is just a proof of concept for the D-Installer integration tests.

Pre-requisities

Webdriver

You need to install a webdriver which can control and inspect a running web browser.

There are several ways:

  1. Installing a native package - the webdriver might be available as a package, in openSUSE just run zypper install chromedriver. This will install the webdriver for the Chromium browser. (This should be the preferred way.)
  2. Manual download and installation - download the webdriver for your browser manually
  3. Automatic download and installation - there are several libraries or scripts which can automate the installation. For example you can use the webdrivers Ruby gem
    • Add gem "webdrivers", "~> 4.6", require: false to the Gemfile
    • Run bundle update
    • Add require "webdrivers/chromedriver" or require "webdrivers/geckodriver" depending which browser you want to use
    • Run the tests (see below), it will download and install the webdriver at the first run. In this case the files are installed into the ~/.webdrivers/ directory.

Libraries

This proof of concept uses selenium-webdriver Ruby gem.

The libraries can be installed by running bundle install --path .vendor/bundle command in the Git checkout.

D-Installer

Download the D-Installer image from the OBS Repository. For purposes of this test prefer the ALP image as it can install only one product (ALP) and does not display the product selection dialog the start.

Then boot the installer image in a virtual machine.

Running the tests

When the D-Installer is running you can run the tests using this command:

bundle exec rake BASE_URL=https://192.168.1.10:9090

You can set some delay between the steps if you want to watch the steps with INSTALLER_DELAY=<seconds> option.

Found Problems

  1. The D-installer by default uses a self-signed certificate. You need to explicitly accept it in the browser. (Or maybe the certificate check can be disabled somehow?)
  2. The D-Installer is basically a single page application, that means you can do not need to start the browser for each separate test. That can speed up testing.
  3. Because the D-Installer uses ReactJS and all changes in the page are done asynchronously using JavaScript you need to wait for the expected objects to appear or change in the page.

Links