[Solved] Any clue as to why assertField is failing here:

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

Post Reply
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

[Solved] Any clue as to why assertField is failing here:

Post by nielsene »

I'm having a few failures I don't understand.

Here's a snippet of the test code:

Code: Select all

$this->assertField("Foo+Bar+%28Baz%29");
    $this->assertField("Foo+Bar+%28Baz%29",-1);

    $this->assertTrue($this->setField("Foo+Bar+%28Baz%29",0));
Here's the corresponding HTML

Code: Select all

</td></tr><tr><td>Foo Bar (Baz)</td><td>
<div class="form">
  <div class="formElement">
    <select name="Foo+Bar+%28Baz%29">      
        <option value="-1" selected="selected">Create New Person Record</option>
        <option value="0">Foo Bar (Baz)</option>
    </select>
  </div>
</div>
The first two assertions pass, the third fails. I double-checked the simpletest docs and setField should return True if the field exists. The first two assertions prove that the field exists.....

[Edit: Word from Marcus, it should work, its being treated as a bug, but setting Field to the contents of the field works now, its supposed to also work on the value, but it isn't.)
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Hope it's going well, overall. You seem to be giving SimpleTest a pretty good workout :)
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

Too true... I "cheated" on this one, ended up getting the bugs fixed without refactoring, so its still two massive acceptence tests wrapping it. Unfortunately I can't run those tests too often, its close to 10 minutes to run them...

I'm going to try to finish up three other feature points so I'm a decent roll-out point for the upcoming competition season. The academic year is typically my time for longer duration projects so I'll start some of the refactoring then I think.

(I dislike trying to update the production site when there are open event using it for registration; I get about a four month window from May-August to safely update, etc. I have four features left from my sumemr development plan and one is a real doozy....) I don't regret the time spent trying to get into a test-infected mode, but I still wish I had gotten more done.
Post Reply