Running Automated Tests for the Joomla CMS
From Joomla! Documentation
Re: Run the System Test Suite[edit]
I am trying to run the system test suite in the normal SVN configuration with the installation folder still present. TestSuite calls doInstall which reruns the Joomla install and then reinstalls the sample data which, by the way, failed due to a bug (http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=21250).
When I rename (or delete) the installation folder, TestSuite skips doInstall and then runs OK.
The first Tip, though, says
- Make sure you run the tests on a clean database that has been installed with sample data. If you have made database changes, you should re-install Joomla! or otherwise put the database back to it's original post-installed state.
This seems to indicate that we shouldn't have the installation folder, as its presence will cause the sample data to be reinstalled anyway.
But then, evry SVN update will reinstate the installation folder anyway.
What is the required configuration is for running TestSuite?
Create a Selenium Configuration File[edit]
Would var $baseURI of in be the same as public $live_site?
It could be, but we don't have access to Joomla! variables when running the tests. We are running them from a browser, outside the Joomla! framework. Mark Dexter 22:01, 6 February 2010 (UTC)
Run the Test Suite[edit]
Where is / how do we create phpunit.bat?
phpunit.bat is created when you install PHPUnit (in Windows). In Linux I would guess that it is just phpunit. Mark Dexter 22:02, 6 February 2010 (UTC)
Failed to start new browser session, shutdown browser and[edit]
clear all session data... Lock file still present!
Hi All,
I installed all, how it is written on Running_Automated_Tests_for_Version_1.6, i see my Firefox(3.6, WinXPSP3)-processes(new) in the taskbar started, but the second browser window was not opened! After that I see another try the FF to start, without success and so on.
Start of Tests:
C:\Dokumente und Einstellungen\fpolyak>cd c:\xampp\htdocs\joomla\tests\system\ C:\xampp\htdocs\joomla\tests\system>c:\xampp\php\phpunit.bat --bootstrap servers \configdef.php suite\TestSuite.php PHPUnit 3.4.10 by Sebastian Bergmann. Starting ControlPanelMenu. E^CBatchvorgang abbrechen (J/N)? j C:\xampp\htdocs\joomla\tests\system>
Selenium messages (with errors messages) :
C:\selenium\selenium-remote-control-1.0.1>c:\Programme\Java\jre1.6.0_07\bin\java .exe -jar selenium-server-1.0.1\selenium-server.jar -browserSessionReuse 11:51:38.614 INFO - Java: Sun Microsystems Inc. 10.0-b23 11:51:38.614 INFO - OS: Windows XP 5.1 x86 11:51:38.614 INFO - v1.0.1 [2696], with Core v@VERSION@ [@REVISION@] 11:51:38.614 INFO - Will recycle browser sessions when possible. 11:51:38.755 INFO - Version Jetty/5.1.x 11:51:38.755 INFO - Started HttpContext[/selenium-server/driver,/selenium-server /driver] 11:51:38.755 INFO - Started HttpContext[/selenium-server,/selenium-server] 11:51:38.755 INFO - Started HttpContext[/,/] 11:51:38.771 INFO - Started SocketListener on 0.0.0.0:4444 11:51:38.771 INFO - Started org.mortbay.jetty.Server@1e0cf70 11:54:55.060 INFO - Checking Resource aliases 11:54:55.075 INFO - Command request: getNewBrowserSession[*chrome, http://joomla ] on session null 11:54:55.075 INFO - grabbing available session... 11:54:55.075 INFO - creating new remote session 11:54:55.544 INFO - Allocated session df59775d37ca4e77bbdb4d0f7b97d63c for http: //joomla, launching... 11:54:55.794 INFO - Preparing Firefox profile... 11:55:19.052 ERROR - Failed to start new browser session, shutdown browser and c lear all session data java.lang.RuntimeException: Firefox refused shutdown while preparing a profile at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.wai tForFullProfileToBeCreated(FirefoxChromeLauncher.java:311) at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.pop ulateCustomProfileDirectory(FirefoxChromeLauncher.java:106) at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.lau nch(FirefoxChromeLauncher.java:83) at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.lau nchRemoteSession(FirefoxChromeLauncher.java:350) at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSessi on(BrowserSessionFactory.java:357) at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession ( BrowserSessionFactory.java:122) at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession (BrowserSessionFactory.java:84) at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowse rSession(SeleniumDriverResourceHandler.java:699) at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(Se leniumDriverResourceHandler.java:393) at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleComman dRequest(SeleniumDriverResourceHandler.java:364) at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(Selen iumDriverResourceHandler.java:125) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:820) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java: 245) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) Caused by: org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher$Fil eLockRemainedException: Lock file still present! C:\DOKUME~1\fpolyak\LOKALE~1\Te mp\customProfileDirdf59775d37ca4e77bbdb4d0f7b97d63c\parent.lock at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.wai tForFileLockToGoAway(FirefoxChromeLauncher.java:269) at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.wai tForFullProfileToBeCreated(FirefoxChromeLauncher.java:309) ... 19 more 11:55:31.806 INFO - Got result: Failed to start new browser session: Unable to d elete file C:\DOKUME~1\fpolyak\LOKALE~1\Temp\customProfileDirdf59775d37ca4e77bbd b4d0f7b97d63c\parent.lock on session null 11:55:31.884 INFO - Command request: getNewBrowserSession[*chrome, http://joomla ] on session null 11:55:31.884 INFO - grabbing available session... 11:55:31.884 INFO - creating new remote session 11:55:31.884 INFO - Allocated session e782589f459f4d9c8c0164e05c1f8cf6 for http: //joomla, launching... 11:55:32.040 INFO - Preparing Firefox profile... 11:55:53.719 ERROR - Failed to start new browser session, shutdown browser and c lear all session data java.lang.RuntimeException: Firefox refused shutdown while preparing a profile at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.wai tForFullProfileToBeCreated(FirefoxChromeLauncher.java:311) at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.pop ulateCustomProfileDirectory(FirefoxChromeLauncher.java:106) at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.lau nch(FirefoxChromeLauncher.java:83) at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.lau nchRemoteSession(FirefoxChromeLauncher.java:350) at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSessi on(BrowserSessionFactory.java:357) at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession (BrowserSessionFactory.java:122) at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession (BrowserSessionFactory.java:84) at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowse rSession(SeleniumDriverResourceHandler.java:699) at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(Se leniumDriverResourceHandler.java:393) at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleComman dRequest(SeleniumDriverResourceHandler.java:364) at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(Selen iumDriverResourceHandler.java:125) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:820) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837) at org.mortbay.http.SocketListener.handleConnection(SocketListener .java: 245) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) Caused by: org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher$Fil eLockRemainedException: Lock file still present! C:\DOKUME~1\fpolyak\LOKALE~1\Te mp\customProfileDire782589f459f4d9c8c0164e05c1f8cf6\parent.lock at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.wai tForFileLockToGoAway(FirefoxChromeLauncher.java:269) at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.wai tForFullProfileToBeCreated(FirefoxChromeLauncher.java:309) ... 19 more 11:56:06.379 INFO - Got result: Failed to start new browser session: Unable to d elete file C:\DOKUME~1\fpolyak\LOKALE~1\Temp\customProfileDire782589f459f4d9c8c0 164e05c1f8cf6\parent.lock on session null
configdef.php:
class SeleniumConfig { var $host = 'http://joomla';
var $path = ;#'/j1513/'; var $username = 'admin'; var $password = 'admin'; var $browser = '*chrome'; var $baseURI = "c:/xampp/htdocs/joomla/";}
Can anybody help me please?
Thanks
This might help: http://clearspace.openqa.org/thread/15596 Mark Dexter