View source | Discuss this page | Page history | Printable version   

Release Management/Run smoke tests locally

Contents

Previous steps

Prerequisites

This guide assumes that Eclipse IDE is set up and that an Openbravo installation has been made. If not, please refer to How to setup Eclipse IDE page.

Firefox

The Firefox version required to run the tests depends on the release version of the ERP. Please check it in the System Requirements page. Older versions will not work properly with the Selenium library for a given release.

Branch clone

Make a GIT clone of the following branch to obtain the code of the tests: https://gitlab.com/openbravo/ci/backoffice-test/-/tree/master

Go to 'pi-smoke/config/' and execute 'setupPiSmoke.sh' script with the following order: 'sh setupPiSmoke.sh'. It will create the following files:

Now, go to 'pi-smoke/config/OpenbravoERPTest.properties' and set your configuration.


NOTE: 'selenium.browserPath' attribute is not used and the selenium test will open the Firefox just by running 'firefox' in bash, so you must ensure that once the process do this call, it opens the recommended firefox. You can do it, for example, in Linux by modifying the path like

export PATH="the_recommended_firefox_location/firefox:$PATH"

Extra files

Although they can be not necessary at the beginning, later you can need the following two files located inside the "pi-smoke/testfiles" directory to guarantee the correct behaviour of some tests (e.g. to activate the professional instance):

Previous ant commands


Warning.png

This document has been deprecated. It is going to be removed from this Wiki shortly.


These commands are useful to start with a clean environment if tests are to be run with ant:

ant compile
ant scenario.clean
ant registration.disable
ant clean

Run tests using ant

You can also run tests using Eclipse instead of this other 'ant' way. It is explained later, you can check it here: [[1]].


Warning.png

This document has been deprecated. It is going to be removed from this Wiki shortly.


To know which are the available tests and their 'ant' command you can go to http://ci.openbravo.com/ and select any test. Then, in the 'Steps' section you will see the ant command/commands of this particular test


RSTL AntTest.png


NOTE: If Selenium server is hanged due to a bad execution of any test, you can force the process to stop by executing the following command:

ps xu | grep selenium | grep -v grep | awk '{ print $2 }' | xargs kill -9

Run tests using Eclipse

Configure the pi-smoke project in eclipse:


RSTL Eclipse1.png



Both tests and suites can be executed by selecting the desired java file in the "Project Explorer" section and clicking on "Run" (or right mouse click) -> "Run As" (or "Debug As" if you plan to debug code) -> "JUnit Test".

Be aware that most of the automated tests will use "QAAdmin" user (deactivated by default). To have that user activated in your context, you can easily do it running "ActivateQAAdminUserWithClosure.java" test, which will have that user activated.


RSTL Eclipse2.png

In case you are having problems with test.registry, remember it is required to have test.environment=true inside Openbravo.properties file from your Openbravo context.


It is no longer required, but, in case you want to run the Selenium server manually in a terminal, go to "pi-smoke/lib" directory and execute:

java -jar selenium-server-standalone-X.XX.X.jar

where X.XX.X is the version of the current existing Selenium server library. (Run the Selenium server manually is not mandatory, it will be launched when a test is run through Eclipse)


Retrieved from "http://wiki.openbravo.com/wiki/Release_Management/Run_smoke_tests_locally"

This page has been accessed 3,800 times. This page was last modified on 10 May 2023, at 14:05. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.