[development] Drupal Test Suite

Nimish Pachapurkar npac at spikesource.com
Wed May 3 00:36:05 UTC 2006


Nimish Pachapurkar wrote:
> Hello All,
> 
> Sorry for disappearing for a couple of days. I was out of office.
> 
> For the lack of a better idea, I have created an issue task at 
> Drupal.org and attached the test suite tarball to it. The tarball is 
> only about 78 KB, so I hope this approach is not too wild.
> 
> http://drupal.org/node/61533
> 
> Please take a look and try out if needed.
> 
> Thomas,
> 
> I agree with your point about TestGen4Web test generation. I wrote the 
> SimpleTest generator for TestGen4Web and in my experience, there is some 
> manual tweaking of the test code still needed to make it pretty and 
> tidy. There are some constraints to make it all automated - some of them 
> because the way SimpleTest differs from tools like HttpUnit.
> 
> Anyway, about your 3rd point, that is already supported. When recording 
> test cases with TestGen4Web, you can select any text on the page, right 
> click and add an assertion. This will then be converted to assertText() 
> call during SimpleTest test cases generation.
> 
> 

Sorry, please read that as "about your 4th point" (about additional 
assertions).

> Thanks,
> Nimish
> 
> Thomas Ilsche wrote:
>> Hello Nimish,
>>
>> thanks for your input. I am really interested in this testsuite.
>> I have tried TestGen4Web myself and it looks promising. However I
>> think there are still alot of additional tasks to do with the
>> autogenerated test.
>>
>> For example a simple registration test looks like:
>>
>>    $this->get("http://localhost/projekte/drupal_head/");
>>    $this->assertTitle("drupal");
>>    $this->clickLink("Create new account");
>>    $this->assertTitle("user account | drupal");
>>    $this->setFieldById("edit-name", "testacc1");
>>    $this->setFieldById("edit-mail", "testacc1 at example.com");
>>    $this->click("Create new account");
>>    $this->assertTitle("drupal");
>>
>> - The get url has to be replaced by url() usage to work also on
>>   different setups
>> - The edit fields should be replaced by random names.
>> - clickLink should be wrapped by t(), this might be done by
>>   DrupalTestCase
>> - Imho there should be more assertations, especially for wanted
>>   Drupal messages (account created) and unwanted ones (access denied)
>> - Some generated assertations will be based on setup, e.g. sitename.
>>
>> How much manual work have you done with the autogenerated tests?
>>

There definitely was some manual work required. I am not how much 'cause 
I did not really work on that part. I think that updating the test suite 
going forward will be hopefully much easier than getting it work 
completely initially.

Thanks,
- Nimish


More information about the development mailing list