<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/tags/TDD</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Thu, 23 May 2013 16:59:14 GMT</pubDate>
<item>
<title>(Ruby) Watchr config for use with PHPUnit - noah</title>
<link>http://snipplr.com/view/51383/watchr-config-for-use-with-phpunit/</link>
<description><![CDATA[ <p>A simple [Watchr](https://github.com/mynyml/watchr) config for running PHPUnit tests.

This will run a [Pake](https://github.com/indeyets/pake/wiki) task called "test" and ring the system bell if the task fails.  *Ringing the system bell* is especially nice when running inside a GNU Screen session.

*Installation*

To install you need [RubyGems](http://rubyforge.org).  Then type:

        sudo gem install watchr</p> ]]></description>
<pubDate>Thu, 31 Mar 2011 14:28:22 GMT</pubDate>
<guid>http://snipplr.com/view/51383/watchr-config-for-use-with-phpunit/</guid>
</item>
<item>
<title>(JavaScript) jstestdriver - Assertions - ddubyah17</title>
<link>http://snipplr.com/view/48551/jstestdriver--assertions/</link>
<description><![CDATA[ <p>Reminder of the assertions possible with jstestdriver</p> ]]></description>
<pubDate>Tue, 08 Feb 2011 04:39:53 GMT</pubDate>
<guid>http://snipplr.com/view/48551/jstestdriver--assertions/</guid>
</item>
<item>
<title>(ActionScript 3) TDD Question - lordbron</title>
<link>http://snipplr.com/view/30973/tdd-question/</link>
<description><![CDATA[ <p>What is the proper way to test this?  Do I rewrite the method to return true/false so I can test the first if statement? Do I make the primaryAxis and secondaryAxis vars exposable so I can test them?  Or do I just do an assertEqual on the public verticalAxisRenderer array items in the main class?</p> ]]></description>
<pubDate>Tue, 06 Apr 2010 11:25:44 GMT</pubDate>
<guid>http://snipplr.com/view/30973/tdd-question/</guid>
</item>
<item>
<title>(Ruby) Howto set up a Rake task to start and stop the Selenium-RC server - noah</title>
<link>http://snipplr.com/view/27992/howto-set-up-a-rake-task-to-start-and-stop-the-seleniumrc-server/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Mon, 08 Feb 2010 23:01:08 GMT</pubDate>
<guid>http://snipplr.com/view/27992/howto-set-up-a-rake-task-to-start-and-stop-the-seleniumrc-server/</guid>
</item>
<item>
<title>(Ruby) Howto set up a Rake task to run Cucumber features and generate reports - noah</title>
<link>http://snipplr.com/view/27990/howto-set-up-a-rake-task-to-run-cucumber-features-and-generate-reports/</link>
<description><![CDATA[ <p>Note that Rake is slower than just running `cucumber`</p> ]]></description>
<pubDate>Mon, 08 Feb 2010 22:41:45 GMT</pubDate>
<guid>http://snipplr.com/view/27990/howto-set-up-a-rake-task-to-run-cucumber-features-and-generate-reports/</guid>
</item>
<item>
<title>(Ruby) How to call JavaScript in the Application Under Test, from Selenium - noah</title>
<link>http://snipplr.com/view/19872/how-to-call-javascript-in-the-application-under-test-from-selenium/</link>
<description><![CDATA[ <p>When writing functional tests with Selenium, it is often convenient to call JavaScript functions and methods, that are part of the Web application you are testing.  After all, Selenium is a functional testing framework for Web UI and most of the exciting bits of Web UI are JS (sorry, all you CSS hackers, but them's the facts). 

The problem is that it's not immediately obvious how you can access the DOM of the Application Under Test (AUT).  Selenium Core (in which all Selenium tests execute) is a frame set, and if you simply try to call your JavaScript with `getEval`, you'll get an error because `getEval` references Selenium Core's DOM, not the DOM of the AUT.

Fortunately the answer is simple.  Use `this.browserbot.getCurrentWindow()` to get a reference to the `window` object in *your* DOM.  Then you can execute any of the JS that lives in your page, right from Selenium!

This example uses the Ruby driver, but the principle is the same regardless of which language you use.</p> ]]></description>
<pubDate>Thu, 17 Sep 2009 13:14:43 GMT</pubDate>
<guid>http://snipplr.com/view/19872/how-to-call-javascript-in-the-application-under-test-from-selenium/</guid>
</item>
<item>
<title>(Other) How to configure the output format of the W3 CSS Validator - noah</title>
<link>http://snipplr.com/view/19817/how-to-configure-the-output-format-of-the-w3-css-validator/</link>
<description><![CDATA[ <p>The W3 CSS validator is pretty simple to [install locally for use behind the firewall](http://www.emacswiki.org/emacs/FlymakeCSS).

However, by default the validator spits out the whole CSS file after validation, which is inconvenient if your stylesheet is more than a few lines long.

Unfortunately it's not so obvious how to configure the validator to give pretty-printed, human-readable output.  In fact, all there is to it, is to choose a different output format from the several that are supported :)

By default the validator .jar file gives you "text" output, which includes the stylesheet.  To choose a different format, invoke the validator .jar file with an -output argument, like this:

    java -jar css-validator.jar -output  local-file:foo.css

where `` is any of xhtml, xml, text, soap12, json, ucn or gnu

If you just want the errors as (html-escaped) plain text, but without the CSS included, use `gnu`</p> ]]></description>
<pubDate>Wed, 16 Sep 2009 11:53:08 GMT</pubDate>
<guid>http://snipplr.com/view/19817/how-to-configure-the-output-format-of-the-w3-css-validator/</guid>
</item>
<item>
<title>(Ruby) Waiting for events with the Selenium-Client Ruby driver - noah</title>
<link>http://snipplr.com/view/16557/waiting-for-events-with-the-seleniumclient-ruby-driver/</link>
<description><![CDATA[ <p>## List of commonly used `wait_for` commands

For convenience, here are direct links to the documentation of the Selenium-Ruby `wait_for` commands that are most often used.   The [documentation of WaitFor commands in Selenium Core](http://release.seleniumhq.org/selenium-core/1.0.1/reference.html#waitForCondition "WaitForCondition entry in the docs for Selenium Core 1.0.1") may also be of interest.

0. [`wait_for_condition`](http://selenium-client.rubyforge.org/classes/Selenium/Client/Idiomatic.html#M000088)
0. [`wait_for_element`](http://selenium-client.rubyforge.org/classes/Selenium/Client/Extensions.html#M000257)
0. [`wait_for_field_value`](http://selenium-client.rubyforge.org/classes/Selenium/Client/Extensions.html#M000261)
0. [`wait_for_frame_to_load`](http://selenium-client.rubyforge.org/classes/Selenium/Client/GeneratedDriver.html#M000221)
0. [`wait_for_no_element`](http://selenium-client.rubyforge.org/classes/Selenium/Client/Extensions.html#M000258)
0. [`wait_for_no_field_value `](http://selenium-client.rubyforge.org/classes/Selenium/Client/Extensions.html#M000262)
0. [`wait_for_no_text `](http://selenium-client.rubyforge.org/classes/Selenium/Client/Extensions.html#M000260)
0. [`wait_for_page `](http://selenium-client.rubyforge.org/classes/Selenium/Client/Idiomatic.html#M000067)
0. [`wait_for_page_to_load `](http://selenium-client.rubyforge.org/classes/Selenium/Client/Idiomatic.html#M000068)
0. [`wait_for_popup `](http://selenium-client.rubyforge.org/classes/Selenium/Client/Idiomatic.html#M000069)
0. [`wait_for_text `](http://selenium-client.rubyforge.org/classes/Selenium/Client/Extensions.html#M000259)

## Where to find the documentation

More information on`wait_for` with the Ruby client, including a complete list of the `wait_for` commands available in the Ruby client, is to be found in the [documentation for the Selenium-Client Ruby Gem.](http://selenium-client.rubyforge.org/ "selenium-client is the official Ruby driver for Selenium RC")  As Selenium-Client defines many "idiomatic" Ruby aliases for built-in Selenium methods, it will probably be especially helpful to become familiar with the [Selenium Ruby driver command set](http://selenium-client.rubyforge.org/classes/Selenium/Client/GeneratedDriver.html) as well as Selenium-Client's [Idiomatic Ruby command set.](http://selenium-client.rubyforge.org/classes/Selenium/Client/Idiomatic.html)

It may also be helpful to refer to the [documentation for Selenium Core](http://release.seleniumhq.org/selenium-core/1.0.1/reference.html#waitForCondition "WaitForCondition entry in the docs for Selenium Core 1.0.1") with regard to `WaitForCondition` and related commands.  In general the **Selenium Core documentation** tends to provide more insight into how commands work, than does the documentation for any of the drivers.

## Examples

Below are a couple of examples of using Selenium's `wait_for` family of commands with the [Ruby driver (Selenium-Client).](http://rubyforge.org/projects/selenium-client/ "Selenium Client Ruby Gem at RubyForge")

One item of note is that , within `wait_for_condition`, one does *not* need to use `this.browserbot.getCurrentWindow()` to access the DOM of the AUT</p> ]]></description>
<pubDate>Wed, 01 Jul 2009 10:57:06 GMT</pubDate>
<guid>http://snipplr.com/view/16557/waiting-for-events-with-the-seleniumclient-ruby-driver/</guid>
</item>
<item>
<title>(C#) Using Moq to Return a Mock Object from a Factory - rengber</title>
<link>http://snipplr.com/view/15489/using-moq-to-return-a-mock-object-from-a-factory/</link>
<description><![CDATA[ <p>Note that the interface member is mockVar.Object mockVar won't cast to your interface.</p> ]]></description>
<pubDate>Wed, 03 Jun 2009 18:08:00 GMT</pubDate>
<guid>http://snipplr.com/view/15489/using-moq-to-return-a-mock-object-from-a-factory/</guid>
</item>
<item>
<title>(C#) Using NMock to Create an IDataReader for Testing Data Access Methods - rengber</title>
<link>http://snipplr.com/view/9930/using-nmock-to-create-an-idatareader-for-testing-data-access-methods/</link>
<description><![CDATA[ <p>Shows how to mock the Object["CollectionItemName"] syntax.</p> ]]></description>
<pubDate>Wed, 19 Nov 2008 21:32:37 GMT</pubDate>
<guid>http://snipplr.com/view/9930/using-nmock-to-create-an-idatareader-for-testing-data-access-methods/</guid>
</item>
<item>
<title>(C#) Using a Virtual Factory Method with NMock to help NUnit Testing - rengber</title>
<link>http://snipplr.com/view/9724/using-a-virtual-factory-method-with-nmock-to-help-nunit-testing/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 13 Nov 2008 22:38:47 GMT</pubDate>
<guid>http://snipplr.com/view/9724/using-a-virtual-factory-method-with-nmock-to-help-nunit-testing/</guid>
</item>
<item>
<title>(C#) NUnit Forms Code to Dismiss a Modal Form (not a messagebox). - rengber</title>
<link>http://snipplr.com/view/2461/nunit-forms-code-to-dismiss-a-modal-form-not-a-messagebox/</link>
<description><![CDATA[ <p>The trick to this is that you must find the class name of the form.  The caption won't cut it for non-messagebox modals.</p> ]]></description>
<pubDate>Thu, 12 Apr 2007 19:28:39 GMT</pubDate>
<guid>http://snipplr.com/view/2461/nunit-forms-code-to-dismiss-a-modal-form-not-a-messagebox/</guid>
</item>
<item>
<title>(C#) Using NUnitForms - rengber</title>
<link>http://snipplr.com/view/2446/using-nunitforms/</link>
<description><![CDATA[ <p>Note:  The override of UseHidden controls whether or not NUnit will create forms in a hidden desktop/winstation.  It needs to be set before the constructor is called in order to be effective.</p> ]]></description>
<pubDate>Tue, 10 Apr 2007 16:32:24 GMT</pubDate>
<guid>http://snipplr.com/view/2446/using-nunitforms/</guid>
</item>
</channel>
</rss>