Created
May 15, 2012 08:59
-
-
Save gzankevich/2700199 to your computer and use it in GitHub Desktop.
Basic Symfony2/Selenium2 Setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// src/Acme/DemoBundle/Tests/Selenium/DemoTest.php | |
namespace Acme\DemoBundle\Tests\Selenium; | |
use Acme\DemoBundle\Tests\SeleniumTestCase; | |
class DemoTest extends SeleniumTestCase | |
{ | |
public function testTitle() | |
{ | |
$this->url('http://www.example.com/app_dev.php'); | |
$this->assertEquals('Test', $this->title()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- app/selenium.xml.dist --> | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html --> | |
<phpunit | |
backupGlobals = "false" | |
backupStaticAttributes = "false" | |
colors = "true" | |
convertErrorsToExceptions = "true" | |
convertNoticesToExceptions = "true" | |
convertWarningsToExceptions = "true" | |
processIsolation = "false" | |
stopOnFailure = "false" | |
syntaxCheck = "false" | |
bootstrap = "bootstrap.php.cache" > | |
<testsuites> | |
<testsuite name="Project Test Suite"> | |
<directory>../src/*/*Bundle/Tests/Selenium</directory> | |
<directory>../src/*/Bundle/*Bundle/Tests/Selenium</directory> | |
</testsuite> | |
</testsuites> | |
<!-- | |
<php> | |
<server name="KERNEL_DIR" value="/path/to/your/app/" /> | |
</php> | |
--> | |
<filter> | |
<whitelist> | |
<directory>../src</directory> | |
<exclude> | |
<directory>../src/*/*Bundle/Resources</directory> | |
<directory>../src/*/*Bundle/Tests</directory> | |
<directory>../src/*/Bundle/*Bundle/Resources</directory> | |
<directory>../src/*/Bundle/*Bundle/Tests</directory> | |
</exclude> | |
</whitelist> | |
</filter> | |
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// src/Acme/DemoBundle/Tests/SeleniumTestCase.php | |
namespace Acme\DemoBundle\Tests; | |
abstract class SeleniumTestCase extends \PHPUnit_Extensions_Selenium2TestCase | |
{ | |
protected function setUp() | |
{ | |
$this->setBrowser('firefox'); | |
$this->setBrowserUrl('http://www.example.com/app_dev.php'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment