ServidorCategoriaNivelWebTest.class.php
1.56 KB
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
<?php
/**
* ServidorCategoriaNivelWebTest class.
*
* Testa as ações de atualizar um nível de categoria, como verificação
* da correção do bug #21.
*
* Esse teste precisa ser executado com o banco de dados distribuído na
* versão 1.0.0.
*
* @author Eriksen Costa <eriksen.paixao_bs@cobra.com.br>
* @since 1.0.1
* @version SVN: $Id$
*/
require_once realpath(dirname(__FILE__) . '/../') . '/FunctionalBaseTest.class.php';
class ServidorCategoriaNivelWebTest extends FunctionalBaseTest {
private $slStringTest = 'Selenese Nivel Teste';
protected function tearDown() {
require_once 'include/pmieducar/clsPmieducarCategoriaNivel.inc.php';
$db = new clsBanco();
$categoriaNivel = new clsPmieducarCategoriaNivel();
$sql = sprintf('DELETE FROM %s WHERE %s = \'%s\'',
$categoriaNivel->_tabela, 'nm_categoria_nivel', $this->slStringTest);
$db->Consulta($sql);
}
private function createNewEntry() {
$this->open("/intranet/educar_categoria_nivel_lst.php");
$this->clickAndWait("//input[@value=' Novo ']");
$this->type("nm_categoria_nivel", $this->slStringTest);
$this->clickAndWait("btn_enviar");
}
public function testCategoriaNivelDelete() {
$this->doLogin();
$this->createNewEntry();
$this->clickAndWait("link=" . $this->slStringTest);
$this->clickAndWait("//input[@value=' Editar ']");
$this->clickAndWait("//input[@value=' Excluir ']");
$this->assertTrue((bool) preg_match('/^Excluir registro[\s\S]$/', $this->getConfirmation()));
$this->assertTrue(!$this->isTextPresent($this->slStringTest));
}
}