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

Contents of /trunk/tests/testGuichetUnique.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1726 - (show annotations)
Thu Apr 18 17:12:27 2013 UTC (11 years, 9 months ago) by fmichon
File size: 7355 byte(s)
Ajout de la vérification de la présence du nom du demandeur dans le test du récépissé de demande

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 GuichetUnique extends BaseTestCase {
16
17 private function login() {
18 // on commence par se connecter
19 $this->connect("guichet", "guichet");
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 doit être réalisé juste après la réinitialisation de la base
35 * de données.
36 */
37 public function testAffichageReglementaire() {
38 //
39 $this->login();
40
41 //
42 $this->clickAndWait("link=attestation");
43 $this->verifyNoErrors();
44 $this->verifyTextPresent("imprimer l'attestation d'affichage réglementaire");
45 //
46 $this->type("id=dossier", "PC0130551200002P0");
47 $this->clickAndWait("//input[@value='Valider']");
48 $this->verifyNoErrors();
49 $this->verifyTextPresent("Ce dossier n'a jamais été affiché.");
50
51 //
52 $this->clickAndWait("link=registre");
53 $this->verifyNoErrors();
54 $this->verifyTextPresent("imprimer le registre d'affichage réglementaire");
55 //
56 $this->click("//input[@value='Valider']");
57 $this->assertTrue((bool)preg_match('/^Etes-vous sur de vouloir confirmer cette action [\s\S]$/',$this->getConfirmation()));
58 //
59 $this->waitForPopUp("", "30000");
60 $this->selectPopUp();
61 sleep(5);
62 $this->verifyNoErrors();
63 $this->verifyTextPresent("Registre des dossiers en cours");
64 $this->close();
65 //
66 $this->selectWindow();
67 $this->verifyNoErrors();
68 $this->verifyTextPresent("Traitement terminé. Le registre a été téléchargé.");
69
70 //
71 $this->clickAndWait("link=attestation");
72 $this->verifyNoErrors();
73 $this->verifyTextPresent("imprimer l'attestation d'affichage réglementaire");
74 //
75 $this->clickAndWait("//input[@value='Valider']");
76 $this->verifyNoErrors();
77 $this->verifyTextPresent("Veuiller saisir un N° de dossier.");
78 //
79 $this->type("id=dossier", "123");
80 $this->clickAndWait("//input[@value='Valider']");
81 $this->verifyNoErrors();
82 $this->verifyTextPresent("Ce dossier n'existe pas.");
83 //
84 $this->type("id=dossier", "PC0130551200002P0");
85 $this->clickAndWait("//input[@value='Valider']");
86 $this->verifyNoErrors();
87 $this->verifyTextPresent("Cliquez sur le lien ci-dessous pour télécharger votre attestation d'affichage : \n\nAttestation d'affichage");
88 //
89 $this->click("link=Attestation d'affichage");
90 $this->waitForPopUp("", "30000");
91 $this->selectPopUp();
92 sleep(5);
93 $this->verifyNoErrors();
94 $this->verifyTextPresent("ATTESTATION D'AFFICHAGE REGLEMENTAIRE");
95 $this->close();
96 //
97 $this->selectWindow();
98
99 //
100 $this->logout();
101 }
102
103 /**
104 *
105 */
106 public function testRecepisse() {
107 //
108 $this->setSleep(1);
109 //
110 $this->login();
111
112 //
113 $this->clickAndWait("link=récépissé");
114 $this->verifyNoErrors();
115 $this->verifyTextPresent("demande");
116 //
117 $this->clickAndWait("link=DAT0130551200001P0");
118 $this->verifyNoErrors();
119 $this->verifyTextPresent("Demande d'autorisation de construire, d'aménager ou de modifier un ERP");
120 // Le nom du pétitionnaire doit apparaître
121 $this->verifyTextPresent("BERNARD LILIANE");
122 //
123 $this->click("link=Éditer le récépissé PDF");
124 $this->waitForPopUp("", "30000");
125 $this->selectPopUp();
126 sleep(5);
127 $this->verifyNoErrors();
128 $this->verifyTextPresent("RECEPISSE DE DEPOT");
129 $this->close();
130 //
131 $this->selectWindow();
132 //
133 $this->clickAndWait("link=Retour");
134 $this->verifyNoErrors();
135 $this->verifyTextPresent("demande");
136
137 //
138 $this->logout();
139 }
140
141 /**
142 *
143 */
144 public function testPetitionnaireFrequent() {
145 //
146 $this->login();
147
148 //
149 $this->clickAndWait("link=nouveau dossier");
150 $this->verifyNoErrors();
151 $this->verifyTextPresent("demande");
152 //
153 $this->select("id=dossier_autorisation_type_detaille", "label=Permis de construire pour une maison individuelle et / ou ses annexes");
154 $this->select("id=demande_type", "label=Dépôt Initial");
155 $this->click("id=add_petitionnaire_principal");
156 $this->type("id=particulier_nom", "DURAND");
157 $this->type("id=particulier_prenom", "MICKAEL");
158 $this->type("id=particulier_date_naissance", "03/01/1956");
159 $this->type("id=particulier_commune_naissance", "LILLE");
160 $this->type("id=particulier_departement_naissance", "NORD");
161 $this->type("id=numero", "12");
162 $this->type("id=voie", "RUE DE LA LOI");
163 $this->type("document.f2.complement", "APPT 12");
164 $this->type("id=localite", "MARSEILLE");
165 $this->type("id=code_postal", "13012");
166 $this->type("id=telephone_fixe", "0404040404");
167 $this->click("id=frequent");
168
169 $this->click("//input[@value=\"Ajouter l'enregistrement de la table : 'demandeur'\"]");
170 sleep(1);
171 $this->verifyNoErrors();
172 $this->verifyTextPresent("Vos modifications ont bien été enregistrées.");
173 $this->click("css=form[name=\"f2\"] > div.formControls > a.retour");
174 sleep(1);
175 //
176 $this->verifyTextPresent("DURAND MICKAEL\n 12 RUE DE LA LOI APPT 12 \n 13012 MARSEILLE \n 0404040404");
177 $this->clickAndWait("//input[@value='Ajouter']");
178 $this->verifyNoErrors();
179 $this->verifyTextPresent("Création du dossier d'autorisation n°PC0130551300003");
180 //
181 //$this->click("link= Télécharger le récépissé de la demande");
182 $this->click("css=a.lien");
183 $this->waitForPopUp("", "30000");
184 $this->selectPopUp();
185 sleep(5);
186 $this->verifyNoErrors();
187 $this->verifyTextPresent("RECEPISSE DE DEPOT");
188 $this->close();
189 //
190 $this->selectWindow();
191 //
192 $this->clickAndWait("link=Retour");
193 $this->verifyNoErrors();
194 //
195 $this->clickAndWait("link=pétitionnaire fréquent");
196 $this->verifyNoErrors();
197 $this->verifyTextPresent("pétitionnaire fréquent");
198 $this->verifyTextPresent("DURAND MICKAEL");
199 //
200 $this->clickAndWait("link=DURAND MICKAEL");
201 $this->verifyNoErrors();
202 $this->verifyTextPresent("RUE DE LA LOI ");
203 //
204 $this->clickAndWait("link=Retour");
205 $this->verifyNoErrors();
206 $this->verifyTextPresent("pétitionnaire fréquent");
207 //
208 $this->logout();
209 }
210
211 }
212
213 ?>

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26