/[openfoncier]/trunk/tests/testInstruction.php
ViewVC logotype

Contents of /trunk/tests/testInstruction.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1719 - (show annotations)
Thu Apr 18 10:45:27 2013 UTC (11 years, 9 months ago) by fmichon
File size: 5429 byte(s)
Remplacement de la méthode verifyNoDatabaseError par la méthode verifiyNoErrors qui vérifier également qu'il n'y a pas de Fatal Error, de Notice ou de Parse Error affichés dans la page.

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->verifyTextPresent("DI");
44 $this->verifyNoErrors();
45 //
46 $this->clickAndWait("link=tous les encours");
47 $this->verifyTextPresent("DI");
48 $this->verifyNoErrors();
49 //
50 $this->clickAndWait("link=mes clôturés");
51 $this->verifyTextPresent("DI");
52 $this->verifyNoErrors();
53 //
54 $this->clickAndWait("link=tous les clôturés");
55 $this->verifyTextPresent("DI");
56 $this->verifyNoErrors();
57 //
58 $this->clickAndWait("link=recherche");
59 $this->verifyTextPresent("DI");
60 $this->verifyNoErrors();
61 //
62 $this->clickAndWait("link=dossiers à qualifier");
63 $this->verifyTextPresent("dossier");
64 $this->verifyNoErrors();
65 //
66 $this->clickAndWait("link=Mes retours");
67 $this->verifyTextPresent("dossier");
68 $this->verifyNoErrors();
69 //
70 $this->clickAndWait("link=Tous les retours");
71 $this->verifyTextPresent("dossier");
72 $this->verifyNoErrors();
73 //
74 $this->clickAndWait("link=Mes messages");
75 $this->verifyTextPresent("dossier");
76 $this->verifyNoErrors();
77 //
78 $this->clickAndWait("link=Tous les messages");
79 $this->verifyTextPresent("dossier");
80 $this->verifyNoErrors();
81 //
82 $this->clickAndWait("css=a.commission_mes_retours-16");
83 $this->verifyTextPresent("dossier");
84 $this->verifyNoErrors();
85 //
86 $this->clickAndWait("css=a.commission_tous_retours-16");
87 $this->verifyTextPresent("dossier");
88 $this->verifyNoErrors();
89
90 //
91 $this->logout();
92 }
93
94 /**
95 *
96 */
97 public function testConsultationDeServices() {
98 //
99 $this->login();
100
101 $this->clickAndWait("link=mes encours");
102 // Accès au dossier en visualisation
103 $this->clickAndWait("link=AZ0130551200001P0");
104 $this->verifyNoErrors();
105 // Accès à l'onglet des consultations
106 $this->click("id=consultation");
107 $this->setSpeed('120');
108 $this->verifyNoErrors();
109
110 //// Ajout de deux consultation
111 // On clique sur le bouton ajout
112 $this->click("//div[@id='sousform-consultation']/table/thead/tr/th/a/span");
113 $this->verifyNoErrors();
114 // On sélectionne le service
115 $this->select("id=service", "label=1ER Maire 1er Secteur");
116 // On valide le formulaire
117 $this->click("//input[@value='Ajouter']");
118 $this->verifyNoErrors();
119 //
120 $this->verifyTextPresent("Vos modifications ont bien été enregistrées.");
121 // On clique sur le bouton retour
122 $this->click("css=form[name=\"f2\"] > div.formControls > a.retour");
123 //// Ajout d'une simple consultation
124 // On clique sur le bouton ajout
125 $this->click("//div[@id='sousform-consultation']/table/thead/tr/th/a/span");
126 $this->verifyNoErrors();
127 // On sélectionne le service
128 $this->select("id=service", "label=59.01 Direction de l'Eau et de l'Assainissement");
129 // On valide le formulaire
130 $this->click("//input[@value='Ajouter']");
131 $this->verifyNoErrors();
132 //
133 $this->verifyTextPresent("Vos modifications ont bien été enregistrées.");
134 // On clique sur le bouton retour
135 $this->click("css=form[name=\"f2\"] > div.formControls > a.retour");
136
137 //// Ajout de plusieurs consultations
138 // On clique sur le bouton ajout multiple
139 $this->click("//div[@id='sousform-consultation']/table/thead/tr/th/a[2]/span");
140 $this->verifyNoErrors();
141 // On sélectionne trois servcies
142 $this->click("id=t10_572_0_");
143 $this->click("id=t10_575_0_");
144 $this->click("id=t10_584_0_");
145 // On les ajoute à la sélection
146 $this->click("id=add-ser-them");
147 // On valide le formulaire
148 $this->click("id=button_val");
149 $this->verifyNoErrors();
150 //
151 $this->verifyTextPresent("3 service(s) sélectionné(s) dont 0 consultation(s) papier.");
152
153 // On vérifie que nous avons bien 5 consultations affichées
154 $this->verifyTextPresent("1 - 5 enregistrement(s) sur 5");
155
156 //
157 $this->logout();
158 }
159
160 }
161
162 ?>

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26