<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>test driven developement | Nerdpress.org</title>
	<atom:link href="https://nerdpress.org/tag/test-driven-developement/feed/" rel="self" type="application/rss+xml" />
	<link>https://nerdpress.org</link>
	<description>...dev, tech problems and solutions.</description>
	<lastBuildDate>Sun, 14 Nov 2010 15:03:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Selenium functional tests mit PHPUnit</title>
		<link>https://nerdpress.org/2010/11/14/selenium-functional-tests-mit-phpunit/</link>
					<comments>https://nerdpress.org/2010/11/14/selenium-functional-tests-mit-phpunit/#comments</comments>
		
		<dc:creator><![CDATA[Max Girkens]]></dc:creator>
		<pubDate>Sun, 14 Nov 2010 15:03:14 +0000</pubDate>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[PHP 5.3]]></category>
		<category><![CDATA[PHPUnit]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[sfPhpunitPlugin]]></category>
		<category><![CDATA[test driven developement]]></category>
		<category><![CDATA[testing]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1193</guid>

					<description><![CDATA[<p>PHPUnit hat coolerweise eine Extension für Selenium Tests. Dafür braucht man noch den PHP Client für die Selenium Remote Control. Bei mir auf Debian Lenny, bzw. Mac OSX musste ich noch den include_path dafür anpassen, damit phpunit Testing/Selenium.php gefunden hat. Damit kann man mit PHP komfortabel einen Selenium Test Server über die Selenium RC ansprechen, &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2010/11/14/selenium-functional-tests-mit-phpunit/" class="more-link">Continue reading<span class="screen-reader-text"> "Selenium functional tests mit PHPUnit"</span></a></p>
The post <a href="https://nerdpress.org/2010/11/14/selenium-functional-tests-mit-phpunit/">Selenium functional tests mit PHPUnit</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p><a href="http://www.phpunit.de/">PHPUnit</a> hat coolerweise eine <a href="https://github.com/sebastianbergmann/phpunit-selenium">Extension</a> für <a href="http://seleniumhq.org/">Selenium</a> Tests.</p>
<p>Dafür braucht man noch den PHP Client für die Selenium Remote Control.</p>
<pre class="brush: bash; title: ; notranslate">
pear install Testing_Selenium-0.4.3
</pre>
<p>Bei mir auf Debian Lenny, bzw. Mac OSX musste ich noch den include_path dafür anpassen,<br />
damit phpunit Testing/Selenium.php gefunden hat.</p>
<p>Damit kann man mit PHP komfortabel einen Selenium Test Server über die <a href="http://seleniumhq.org/docs/05_selenium_rc.html">Selenium RC</a> ansprechen,<br />
der dann beliebige Browser für functional Tests benutzt.</p>
<p>Der Selenium Server ist auch im Prinzip <a href="http://seleniumhq.org/docs/05_selenium_rc.html#installation">schnell</a> installiert<br />
und lokal ist das ganze einigermaßen unproblematisch, weil man ja schon mal die Browser seines OS zur Verfügung hat.</p>
<p>In einem Continuous Integration Setup möchte man aber vielleicht Selenium lieber auf einem Web Server laufen lassen.</p>
<p>Da sieht es dann erstmal weniger gut aus mit Browser executables.<br />
Was also tun?</p>
<p><span id="more-1193"></span></p>
<p>Eine Möglichkeit ist <a href="http://saucelabs.com/">saucelabs.com</a>.<br />
Die bieten &#8220;Cross browser testing with Selenium in the cloud&#8221; an.<br />
Sogar gratis für Firefox unter Linux.<br />
Für die anderen Browser und OS muss man dann schon auf einen bezahlten Account umsteigen.</p>
<p>Dann einfach den saucelabs Selenium Server mit oben erwähnter Extension aus PHPUnit ansprechen:</p>
<p><em>Das Example.php Script von saucelabs</em></p>
<pre class="brush: php; title: ; notranslate">
require_once 'Testing/Selenium.php';
require_once 'PHPUnit/Framework/TestCase.php';

class Example extends PHPUnit_Framework_TestCase
{
    private $selenium;

    public function setUp()
    {
        $this-&gt;selenium = new Testing_Selenium(
            json_encode(array(
                &quot;username&quot; =&gt; &quot;YOUR_USERNAME&quot;,
                &quot;access-key&quot; =&gt; &quot;YOUR_ACCESS_KEY&quot;,
                &quot;os&quot; =&gt; &quot;Windows 2003&quot;, 
                &quot;browser&quot; =&gt; &quot;firefox&quot;,
                &quot;browser-version&quot; =&gt; &quot;3.6.&quot;,
                &quot;name&quot; =&gt; $this-&gt;getName()
            )),
            &quot;http://saucelabs.com&quot;, 
            &quot;ondemand.saucelabs.com&quot;,
            80,
            90000);
        $this-&gt;selenium-&gt;start();
    }

    public function tearDown()
    {
        $this-&gt;selenium-&gt;stop();
    }

    public function testSauce()
    {
        $this-&gt;selenium-&gt;open(&quot;/&quot;);
        $this-&gt;assertEquals(&quot;Cross browser testing with Selenium - Sauce Labs&quot;,
                            $this-&gt;selenium-&gt;getTitle());
    }

}
</pre>
<p>und PHPUnit macht Selenium Tests:</p>
<pre class="brush: bash; title: ; notranslate">
phpunit Example.php
</pre>
<p>:)</p>The post <a href="https://nerdpress.org/2010/11/14/selenium-functional-tests-mit-phpunit/">Selenium functional tests mit PHPUnit</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2010/11/14/selenium-functional-tests-mit-phpunit/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
