![]() Selenium will now use Firefox for the testing. Comment out all the tags you can find inside the.Open the file protected/tests/phpunit.xml in your Yii project.Open the same file as in the previous step, the protected/tests/WebTestCase.php in your Yii projectĪdd $this->setBrowser('*firefox') as the last thing in the setUp() method.There will most likely be a fix for this on the future, but for now we work around the problem like suggested in the aforementioned forum thread. In this example my URL is so I changed the constant like this: define( 'TEST_BASE_URL', ' Work around a PHP Warning issue with PHPUnit and Selenium ¶Ī summary of this problem is in the Yii Forum thread at. Open the file protected/tests/WebTestCase.php in your Yii projec and edit the TEST_BASE_URL constant so that it points to the URL of the index-test.php file in your Yii project We need to make an initial configuration of the class that is used for functional testing, so that it knows which URL to open using Selenium. *Note: Both of the filesystem paths above might very well be different on your system - you'll have to figure out where PHPUnit was installed and where you have the Yii Framework files (the folder named framework). The path to the PHPUnit folder, for example /usr/pkg/lib/php/PHPUnit.The path to the Yii framework folder, for example ~/Sites/yii/yii/framework (this can of course be skipped if you already did this or you have added the Yii framework files as a Content Root in a module). ![]() Open -> Project Settings -> PHP -> Include path and click the + button to add the following two items to the Include path list: The purpose of this is to make IDEA/PhpStorm aware of methods and properties on the various classes from Yii and PHPUnit, so that it can provide code completion and inspection for you. Note: These instructions might differ slightly if you are using PhpStorm, but in general it's the same.Īssuming that your project in IDEA/PhpStorm only knows about the Yii application's files, we need to add the Yii Framework files and PHPUnit's files to the so called "include path". servlet 13f6ba0f 14 :58 :19.593 INFO - Started HttpContext 14 :58 :19.601 INFO - Started SocketListener on 0. GridLauncher main INFO: Launching a standalone server 14 :58 :19.373 INFO - Java: Apple Inc. The output should look like the following: % java -jar selenium-server-standalone-2. Selenium should now start and run in this Terminal window. % java -jar selenium-server-standalone-2.25.0.jar Note: For the sake of example, we assume that the file's name is selenium-server-standalone-2.25.0.jar and that it was saved in the folder ~/jar – change these details as appropriate. Once the file is downloaded, start the Selenium Server by running the following commands in your terminal: Save the file wherever it makes sense to you It is an application file that you will run directly. selenium-server-standalone-2.25.0.jar, from the Selenium download page. Next we need to install the actual Selenium Server. Run the following commands in your Terminal (use Spotlight to find the Terminal application in case you haven't used it before): % sudo pear upgrade PEAR This part will first upgrade PEAR so that it has the latest resources, then configure it so that the PEAR channels are discovered automatically, and finally install PHPUnit and its Selenium support. Have created a project for that Yii application in your IDE, be it IntelliJ IDEA or PhpStorm.Note: In the examples below this app is in the folder /Users/rawtaz/Sites/yii/test in the filesystem, and the URL to it is Created a Yii application (normally using the command yiic webapp.Java installed, which is used to run the.PEAR installed, which is used to install PHPUnit.It should at most be a matter of slightly different menu items and stuff. The article will most likely also be applicable for PhpStorm, since these two products share the same foundation (IDEA uses the same code for PHP support as PhpStorm has in its core). This article intends to summarize the steps taken to set up PHPUnit and Selenium for a Yii project, with IntelliJ IDEA Ultimate (the IDE). Work around a PHP Warning issue with PHPUnit and Selenium.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |