simpletest. set radio button value

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
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

simpletest. set radio button value

Post by jmut »

Hi
I have a form...and I am trying to choose radio button.
in the form originally on choosing radio button the form is submitted.
The idea is different drop down...on another part of the page based on the radio button choosed.
The problem is I cannot make this radio button set.
I tried.

Code: Select all

class Test extends WebTestCase {

    function testHomepage() {
        $this->assertTrue($this->get(URI));
        $this->assertField('product_id',true,'Product Id missing');
        $this->assertField('product_id',925);//this is default value for a radio type input
        //$this->assertField('form1',true,'Form1 does not exist');//howto validate the such formname exist?
        //$cookie = $this->getCookie('sid');//howto get the sessoin_id?
        $this->setField('product_id',921);//trying to set radio input field to 921 but does not work.
        $this->assertField('product_id',921);//this failes because the previous statment does not work.
        $this->clickSubmitByName('form1');
        $this->showSource();
    }

}
Edit: BTW I use Simpletest: 1.0.1alpha3
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Post by jmut »

damn...now I saw something int the docu http://www.lastcraft.com/form_testing_documentation.php

Sorry for this post :(
Post Reply