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:
- 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.) - Manual download and installation - download the webdriver for your browser manually
- 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 theGemfile
- Run
bundle update
- Add
require "webdrivers/chromedriver"
orrequire "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.
- Add
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
- 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?)
- 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.
- 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.