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

Contents of /trunk/tests/testGuichetUnique.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1727 - (show annotations)
Thu Apr 18 18:04:39 2013 UTC (11 years, 9 months ago) by fmichon
File size: 6727 byte(s)
Factorisation des méthodes de login et logout

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26