1

Tigerfish: Drupal 6: Using XPath in your SimpleTest tests

http://tiger-fish.com
SimpleTest provides an assertFieldByXPath() method, but can we do more with XPath?

Sometimes we need to do more than test whether a particular piece of text is on the page. Using XPath, we can examine the DOM (the structure of elements making up the page) and get ourselves a nice extra bit of information that we can use to write more robust tests.

In our example, we have a table of results, and we want to test the number of rows that are in the table. We might be using an API function or a node edit form in order to add some information, and as that information is added, we would expect to see more and more rows in the table.

read more

Read »
Created by aaron 1 year 45 weeks ago – Made popular 1 year 45 weeks ago
Category: News   Tags:

PSD to Drupal Theme

Drupal Development

Module Development

Get an Estimate

Tags for Tigerfish: Drupal 6: Using XPath in your SimpleTest tests

Recent comments