blob: 3572a36f431d9e8f5e8dbbfda15a990846af2594 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
<?php
class QuickstartRepeater3TestCase extends PradoGenericSelenium2Test
{
function test()
{
$this->url("../../demos/quickstart/index.php?page=Controls.Samples.TRepeater.Sample3&notheme=true&lang=en");
// verify product name is required
$this->assertNotVisible('ctl0_body_Repeater_ctl0_ctl0');
$this->type("ctl0_body_Repeater_ctl0_ProductName", "");
$this->byXPath("//input[@type='submit' and @value='Save']")->click();
$this->assertVisible('ctl0_body_Repeater_ctl0_ctl0');
// verify product price is of proper format
$this->assertNotVisible('ctl0_body_Repeater_ctl0_ctl1');
$this->type("ctl0_body_Repeater_ctl0_ProductPrice", "abc");
$this->byXPath("//input[@type='submit' and @value='Save']")->click();
$this->assertVisible('ctl0_body_Repeater_ctl0_ctl1');
// perform postback
$this->byId("ctl0_body_Repeater_ctl0_ProductImported",'')->click();
$this->type("ctl0_body_Repeater_ctl0_ProductName", "Mother Board");
$this->type("ctl0_body_Repeater_ctl0_ProductPrice", "99.01");
$this->select("ctl0_body_Repeater_ctl3_ProductCategory", "Accessories");
$this->byXPath("//input[@type='submit' and @value='Save']")->click();
$this->assertNotVisible('ctl0_body_Repeater_ctl0_ctl0');
$this->assertNotVisible('ctl0_body_Repeater_ctl0_ctl1');
// verify postback results
$this->assertElementPresent("//td[text()='Mother Board']",'');
$this->assertElementNotPresent("//td[text()='Input Devices']",'');
$this->assertElementPresent("//td[text()='99.01']",'');
}
}
|