summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php
blob: ffa301261ddeb3eec8153ca7bf28b9325ddceb57 (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
<?php

//New Test
class RegExpValidatorTestCase extends PradoGenericSelenium2Test
{
	function test()
	{
		$base = "ctl0_Content_";
		$this->url("validators/index.php?page=RegularExpressionValidator");
		$this->assertContains("Prado RegularExpressionValidator Tests", $this->source());
		$this->assertNotVisible("{$base}validator1");
		$this->assertNotVisible("{$base}validator2");
		$this->type("{$base}text1", "1");
		$this->type("{$base}text2", "2");
		$this->byXPath("//input[@type='submit' and @value='Test']")->click();
		$this->assertVisible("{$base}validator1");
		$this->assertVisible("{$base}validator2");
		$this->type("{$base}text1", "asdasd");
		$this->byXPath("//input[@type='submit' and @value='Test']")->click();
		$this->assertVisible("{$base}validator1");
		$this->type("{$base}text1", "12345");
		$this->assertNotVisible("{$base}validator1");
		$this->assertVisible("{$base}validator2");
		$this->type("{$base}text2", "wei@gmail.com");
		$this->assertNotVisible("{$base}validator1");
		$this->assertNotVisible("{$base}validator2");
		$this->byXPath("//input[@type='submit' and @value='Test']")->click();
		$this->assertNotVisible("{$base}validator1");
		$this->assertNotVisible("{$base}validator2");

	}
}