summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php
blob: 47e9bb9413a2ca16e543de437e8ab51fc7ec4f7b (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php

class DataList2TestCase extends SeleniumTestCase
{
	function test()
	{
		$this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDataList.Sample2&amp;notheme=true&amp;lang=en", "");

		// verify initial presentation
		$this->verifyTextPresent("Motherboard ", "");
		$this->verifyTextPresent("Monitor ", "");

		// verify selecting an item
		$this->clickAndWait("link=ITN003", "");
		$this->verifyTextPresent("Quantity", "");
		$this->verifyTextPresent("Price", "");
		$this->verifyTextPresent("\$80", "");
		$this->clickAndWait("link=ITN005", "");
		$this->verifyTextPresent("\$150", "");

		// verify editting an item
		$this->clickAndWait("id=ctl0_body_DataList_ctl5_ctl0", "");
		$this->type("ctl0\$body\$DataList\$ctl5\$ProductQuantity", "11");
		$this->type("ctl0\$body\$DataList\$ctl5\$ProductPrice", "140.99");
		$this->click("//input[@name='ctl0\$body\$DataList\$ctl5\$ProductImported']", "");
		$this->clickAndWait("link=Save", "");

		// verify item is saved
		$this->clickAndWait("link=ITN005", "");
		$this->verifyTextPresent("\$140.99", "");
		$this->verifyTextPresent("11", "");

		// verify editting another item
		$this->clickAndWait("id=ctl0_body_DataList_ctl3_ctl1", "");
		$this->type("ctl0\$body\$DataList\$ctl3\$ProductName", "Hard Drive");
		$this->type("ctl0\$body\$DataList\$ctl3\$ProductQuantity", "23");
		$this->click("//input[@name='ctl0\$body\$DataList\$ctl3\$ProductImported']", "");
		$this->clickAndWait("link=Cancel", "");

		// verify item is canceled
		$this->clickAndWait("link=ITN003", "");
		$this->verifyTextPresent("2", "");
		$this->verifyTextPresent("Harddrive 	", "");

		// verify item deletion
		$this->clickAndWait("id=ctl0_body_DataList_ctl3_ctl1", "");
		$this->verifyConfirmation("Are you sure?");
		$this->chooseCancelOnNextConfirmation();
		$this->click("id=ctl0_body_DataList_ctl5_ctl2", "");
		$this->verifyConfirmation("Are you sure?");
		$this->verifyTextPresent("Motherboard ", "");
		$this->verifyTextPresent("CPU ", "");
		$this->verifyTextNotPresent("Harddrive","");
		$this->verifyTextPresent("Sound card", "");
		$this->verifyTextPresent("Video card", "");
		$this->verifyTextPresent("Keyboard","");
		$this->verifyTextPresent("Monitor ", "");
	}
}

?>