Functional Tests
Generate eclipse .project and .classpath files, similar for idea.
mvn eclipse:clean eclipse:eclipseExecute the tests
mvn clean verify -Dit.test=pt.fccn.arquivo.tests.AllTests -Dtest.url=https://preprod.arquivo.pt -Dremote.saucelabs.user=xxxx -Dremote.saucelabs.key=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -Dtest.resolution=1280x1024To debug tests add the argument:
-Dmaven.failsafe.debugTo run the test collection that don't use saucelabs run:
mvn clean verify -Dit.test=pt.fccn.arquivo.tests.TestCollectionsAdditionaly the maven has a couple of profiles to make it more easilly to run tests directly to a specific browser. For Internet Explorer:
-Dbrowsers=IEFor mobile phones:
-Dbrowsers=mobileFor development purposes you could use:
-Dbrowsers=desktop-linuxUse sauce labs directly for development of this tests could take too much time. Another aproach is to replace sauce labs with a local selenium grid.
On a different shell start selenium grid using:
docker-compose upAnd another run your tests like:
mvn clean verify -Dbrowsers=desktop-linux -Dit.test=pt.fccn.arquivo.tests.imagesearch.ImageSearchTest -Dtest.url=https://arquivo.ptMore information on: https://github.com/SeleniumHQ/docker-selenium
In some cases when the test or tunnel is closed incorrectly a process is pending which makes it impossible to run the test again. So, use the following steps:
ps aux | grep scAnd a process will appear with a name similar to "/root/sc-4.4.12-linux/bin/sc -u ArquivoPT". Then,
kill process_ID