magento/taf — pull request #3 by marianosimone (2012-03-08 20:25:34+00:00)
Title: Showing more info when a assertMessagePresent happens

Right now, when assertMessagePresent fails, you'll get something like this:

```
1) AdminUser_CreateTest::withUserEmailThatAlreadyExists
Current URL: http://localhost/magento/index.php/admin/permissions_user/edit/key/*
Screenshot: /***/tmp/screenshot/AdminUser_CreateTest_withUserEmailThatAlreadyExists_0cef2e915cf99d6a0700a5a7c2bd6997.png

Email already exists.
Failed asserting that false is true.

/***/taf/lib/Mage/Selenium/TestCase.php:391
/***/taf/lib/Mage/Selenium/TestCase.php:2937
/usr/bin/phpunit:46
```

As it wasn't very helpful on telling me what really failed (and why) I did some hacking to get more info displayed and get something like this instead:

```
1) AdminUser_CreateTest::withUserEmailThatAlreadyExists
Current URL: http://localhost/magento/index.php/admin/permissions_user/edit/key/*
Screenshot: /***/tmp/screenshot/AdminUser_CreateTest_withUserEmailThatAlreadyExists_a51154478e521a161c4bf11b9d72b56a.png

Failed searching for '//li[normalize-space(@class)='error-msg' and contains(.,'A user with the same user name or email aleady exists.')]', found 'Email already exists.'

/***/taf/lib/Mage/Selenium/TestCase.php:391
/***/taf/lib/Mage/Selenium/TestCase.php:2952
/usr/bin/phpunit:46
```

I don't know if it's the best way to do it, nor if it's the most meaningful info you can get... But I think it's a pretty good improvement. Even if this particular patch is not applied, I'd like to see something along this lines implemented in TAF ;)