Page History
...
- Test execution is done from the IDE, i.e. also on the host
Instructions
...
1a. VM Setup manually
- Setup your VM and install Ubuntu for example
- mount iso image in optical drive
- In VirtualBox preferences > Network > Host-only Networks, click the add icon
- creates a new virtual network interface e.g.
vboxnet0
- creates a new virtual network interface e.g.
- 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)
- 1st slot: select "Host-only Adapter", then choose the one you just created — that
- Install guest additions
- When VirtualBox VM is running
- Devices > Insert Guest Additions CD image...
1b. VM Setup with Vagrant
- Download and install vagrant from https://www.vagrantup.com or use the vagrant manager http://vagrantmanager.com
- Clone the repro https://git.magnolia-cms.com/users/mmuehlebach/repos/uitestmachine
- Go to the cloned directory and run vagrant up
- Start selenium server with
./selenium-server.sh
2. Selenium server setup
- In the VM, download Selenium Server (formerly the Selenium RC Server)
- http://docs.seleniumhq.org/download/
- should be something like
selenium-server-standalone-2.42.2.jar
- and then run it, e.g.
java -jar selenium-server-standalone-2.42.2.jar
On your host
, adjustAbstractMagnoliaUITest
(keep it local)- Adjust the
SELENIUM_SERVER_HOST_NAME
system property to your VM's host-name- so that UI tests launched from your IDE know where to point selenium's
RemoteWebDriver
to.
Adjust the - so that UI tests launched from your IDE know where to point selenium's
- so that your VM's Firefox can access your running instance on your host machine. mind that the port number may be different, depending on what branch/edition your bundle is currently running
- Launch a UI test from your IDE to validate the setup Profit
DOMAIN_PROPERTY
system property to your host machine's host-namerun 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 | |
---|---|
|
@BeforeClass
public static void setUpOnce() {
System.setProperty(SELENIUM_SERVER_HOST_NAME, "<your-vm-hostname>.local");
System.setProperty(DOMAIN_PROPERTY, "http://<your-hostname>.local:8399/");
}
| |
$ mvn -U clean install -Pjetty6-standalone,ui-tests -DseleniumServerHostName=192.168.56.101 -DcontainerHostName=192.168.56.1 |
If necessary replace the IP addresses.
3. Fancy shell script + desktop launcher for the Selenium server
...
Overview
Content Tools