1 |
<?php |
2 |
/** |
3 |
* |
4 |
* |
5 |
* @package openfoncier |
6 |
* @version SVN : $Id$ |
7 |
*/ |
8 |
|
9 |
// |
10 |
require_once "base.php"; |
11 |
|
12 |
/** |
13 |
* |
14 |
*/ |
15 |
class Instruction extends BaseTestCase { |
16 |
|
17 |
private function login() { |
18 |
// on commence par se connecter |
19 |
$this->connect("instr", "instr"); |
20 |
// On doit être connecté |
21 |
$this->assertTrue($this->isTextPresent("Votre session est maintenant ouverte.")); |
22 |
} |
23 |
|
24 |
private function logout() { |
25 |
// puis on se déconnecte |
26 |
$this->deconnect(); |
27 |
// on doit avoir un message nous indiquant que la session est finie |
28 |
$this->assertTrue($this->isTextPresent("Votre session est maintenant terminée.")); |
29 |
// on ne doit plus avoir de lien de déconnexion |
30 |
$this->assertFalse($this->isElementPresent("link=Déconnexion")); |
31 |
} |
32 |
|
33 |
/** |
34 |
* Ce test vise uniquement à vérifier que les écrans correspondant à chaque |
35 |
* entrée de menu ne génère pas une erreur de base de données |
36 |
*/ |
37 |
public function testGeneral() { |
38 |
// |
39 |
$this->login(); |
40 |
|
41 |
// |
42 |
$this->clickAndWait("link=mes encours"); |
43 |
$this->verifyNoErrors(); |
44 |
$this->verifyTextPresent("DI"); |
45 |
// |
46 |
$this->clickAndWait("link=tous les encours"); |
47 |
$this->verifyNoErrors(); |
48 |
$this->verifyTextPresent("DI"); |
49 |
// |
50 |
$this->clickAndWait("link=mes clôturés"); |
51 |
$this->verifyNoErrors(); |
52 |
$this->verifyTextPresent("DI"); |
53 |
// |
54 |
$this->clickAndWait("link=tous les clôturés"); |
55 |
$this->verifyNoErrors(); |
56 |
$this->verifyTextPresent("DI"); |
57 |
// |
58 |
$this->clickAndWait("link=recherche"); |
59 |
$this->verifyNoErrors(); |
60 |
$this->verifyTextPresent("DI"); |
61 |
// |
62 |
$this->clickAndWait("link=dossiers à qualifier"); |
63 |
$this->verifyNoErrors(); |
64 |
$this->verifyTextPresent("dossier"); |
65 |
// |
66 |
$this->clickAndWait("link=Mes retours"); |
67 |
$this->verifyNoErrors(); |
68 |
$this->verifyTextPresent("dossier"); |
69 |
// |
70 |
$this->clickAndWait("link=Tous les retours"); |
71 |
$this->verifyNoErrors(); |
72 |
$this->verifyTextPresent("dossier"); |
73 |
// |
74 |
$this->clickAndWait("link=Mes messages"); |
75 |
$this->verifyNoErrors(); |
76 |
$this->verifyTextPresent("dossier"); |
77 |
// |
78 |
$this->clickAndWait("link=Tous les messages"); |
79 |
$this->verifyNoErrors(); |
80 |
$this->verifyTextPresent("dossier"); |
81 |
// |
82 |
$this->clickAndWait("css=a.commission_mes_retours-16"); |
83 |
$this->verifyNoErrors(); |
84 |
$this->verifyTextPresent("dossier"); |
85 |
// |
86 |
$this->clickAndWait("css=a.commission_tous_retours-16"); |
87 |
$this->verifyNoErrors(); |
88 |
$this->verifyTextPresent("dossier"); |
89 |
|
90 |
// |
91 |
$this->logout(); |
92 |
} |
93 |
|
94 |
/** |
95 |
* |
96 |
*/ |
97 |
public function testConsultationDeServices() { |
98 |
// |
99 |
$this->login(); |
100 |
|
101 |
// |
102 |
$this->clickAndWait("link=mes encours"); |
103 |
$this->verifyNoErrors(); |
104 |
|
105 |
// Accès au dossier en visualisation |
106 |
$this->clickAndWait("link=AZ0130551200001P0"); |
107 |
$this->verifyNoErrors(); |
108 |
|
109 |
// Accès à l'onglet des consultations |
110 |
$this->click("id=consultation"); |
111 |
$this->setSpeed('120'); |
112 |
$this->verifyNoErrors(); |
113 |
|
114 |
//// Ajout de deux consultation |
115 |
// On clique sur le bouton ajout |
116 |
$this->click("//div[@id='sousform-consultation']/table/thead/tr/th/a/span"); |
117 |
$this->verifyNoErrors(); |
118 |
// On sélectionne le service |
119 |
$this->select("id=service", "label=1ER Maire 1er Secteur"); |
120 |
// On valide le formulaire |
121 |
$this->click("//input[@value='Ajouter']"); |
122 |
$this->verifyNoErrors(); |
123 |
// |
124 |
$this->verifyTextPresent("Vos modifications ont bien été enregistrées."); |
125 |
// On clique sur le bouton retour |
126 |
$this->click("css=form[name=\"f2\"] > div.formControls > a.retour"); |
127 |
//// Ajout d'une simple consultation |
128 |
// On clique sur le bouton ajout |
129 |
$this->click("//div[@id='sousform-consultation']/table/thead/tr/th/a/span"); |
130 |
$this->verifyNoErrors(); |
131 |
// On sélectionne le service |
132 |
$this->select("id=service", "label=59.01 Direction de l'Eau et de l'Assainissement"); |
133 |
// On valide le formulaire |
134 |
$this->click("//input[@value='Ajouter']"); |
135 |
$this->verifyNoErrors(); |
136 |
// |
137 |
$this->verifyTextPresent("Vos modifications ont bien été enregistrées."); |
138 |
// On clique sur le bouton retour |
139 |
$this->click("css=form[name=\"f2\"] > div.formControls > a.retour"); |
140 |
|
141 |
//// Ajout de plusieurs consultations |
142 |
// On clique sur le bouton ajout multiple |
143 |
$this->click("//div[@id='sousform-consultation']/table/thead/tr/th/a[2]/span"); |
144 |
$this->verifyNoErrors(); |
145 |
// On sélectionne trois servcies |
146 |
$this->click("id=t10_572_0_"); |
147 |
$this->click("id=t10_575_0_"); |
148 |
$this->click("id=t10_584_0_"); |
149 |
// On les ajoute à la sélection |
150 |
$this->click("id=add-ser-them"); |
151 |
// On valide le formulaire |
152 |
$this->click("id=button_val"); |
153 |
$this->verifyNoErrors(); |
154 |
// |
155 |
$this->verifyTextPresent("3 service(s) sélectionné(s) dont 0 consultation(s) papier."); |
156 |
|
157 |
// On vérifie que nous avons bien 5 consultations affichées |
158 |
$this->verifyTextPresent("1 - 5 enregistrement(s) sur 5"); |
159 |
|
160 |
// |
161 |
$this->logout(); |
162 |
} |
163 |
|
164 |
} |
165 |
|
166 |
?> |