Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

UI tests typically require browser/machine focus (especially when entering text in input fields). To avoid being stuck while UI tests proceed, it's handy to run them — the Selenium part — inside a VM.

 


Outlook

  • The Magnolia webapp runs on the host as usual
    • with manual-tests profile
    • e.g.  mvn clean verify -P jetty9-standalone,manual-tests
    • free hint #1: run this build from another location on your machine than the one you typically work at
    • free hint #2: run it in offline mode (mvn -o ...) if you just installed one of the modules you want to put under test 

...

  1. Setup your VM and install Ubuntu for example
    1. mount iso image in optical drive
  2. In VirtualBox preferences File > Network > Host-only NetworksHost Network Manager..., click the add icon
    • creates a new virtual network interface e.g. vboxnet0 
    • (used to be Preferences > Network in former vbox versions, as illustrated below)
       
  3. In VM Settings > Network
    • 1st slot: select "Host-only Adapter", then choose the one you just created — that vboxnet0
    • 2nd slot: select NAT as is usually the default (to access the interwebs through the host)
  4. Install guest additions
    • When VirtualBox VM is running
    • Devices > Insert Guest Additions CD image...

...

  1. In the VM, download Selenium Server (formerly the Selenium RC Server)
  2. On your host run the UI Tests with the variables seleniumServerHostName which is the address of your newly created VM and containerHostName which is the address used of your VM to access your host system (this is probably not equal to your machines address in the magnolia network)

    Code Block
    languagebash
    $ mvn -U clean install -Pjetty9-standalone,ui-tests -DseleniumServerHostName=192.168.56.101 -DcontainerHostName=192.168.56.1

    If necessary replace the IP addresses.

  3. In your run configuration in IntelliJ you have to add these two variables seleniumServerHostName and containerHostName as well.


...



3. Fancy shell script + desktop launcher for the Selenium server

...