14 |
*/ |
*/ |
15 |
class GuichetUnique extends BaseTestCase { |
class GuichetUnique extends BaseTestCase { |
16 |
|
|
|
private function login() { |
|
|
// on commence par se connecter |
|
|
$this->connect("guichet", "guichet"); |
|
|
// On doit être connecté |
|
|
$this->assertTrue($this->isTextPresent("Votre session est maintenant ouverte.")); |
|
|
} |
|
|
|
|
|
private function logout() { |
|
|
// puis on se déconnecte |
|
|
$this->deconnect(); |
|
|
// on doit avoir un message nous indiquant que la session est finie |
|
|
$this->assertTrue($this->isTextPresent("Votre session est maintenant terminée.")); |
|
|
// on ne doit plus avoir de lien de déconnexion |
|
|
$this->assertFalse($this->isElementPresent("link=Déconnexion")); |
|
|
} |
|
|
|
|
17 |
/** |
/** |
18 |
* Ce test doit être réalisé juste après la réinitialisation de la base |
* Ce test doit être réalisé juste après la réinitialisation de la base |
19 |
* de données. |
* de données. |
20 |
*/ |
*/ |
21 |
public function testAffichageReglementaire() { |
public function testAffichageReglementaire() { |
22 |
// |
// |
23 |
$this->login(); |
$this->login("guichet", "guichet"); |
24 |
|
|
25 |
// |
// |
26 |
$this->clickAndWait("link=attestation"); |
$this->clickAndWait("link=attestation"); |
27 |
|
$this->verifyNoErrors(); |
28 |
$this->verifyTextPresent("imprimer l'attestation d'affichage réglementaire"); |
$this->verifyTextPresent("imprimer l'attestation d'affichage réglementaire"); |
29 |
// |
// |
30 |
$this->type("id=dossier", "PC0130551200002P0"); |
$this->type("id=dossier", "PC0130551200002P0"); |
31 |
$this->clickAndWait("//input[@value='Valider']"); |
$this->clickAndWait("//input[@value='Valider']"); |
32 |
|
$this->verifyNoErrors(); |
33 |
$this->verifyTextPresent("Ce dossier n'a jamais été affiché."); |
$this->verifyTextPresent("Ce dossier n'a jamais été affiché."); |
34 |
|
|
35 |
// |
// |
36 |
$this->clickAndWait("link=registre"); |
$this->clickAndWait("link=registre"); |
37 |
|
$this->verifyNoErrors(); |
38 |
$this->verifyTextPresent("imprimer le registre d'affichage réglementaire"); |
$this->verifyTextPresent("imprimer le registre d'affichage réglementaire"); |
39 |
// |
// |
40 |
$this->click("//input[@value='Valider']"); |
$this->click("//input[@value='Valider']"); |
43 |
$this->waitForPopUp("", "30000"); |
$this->waitForPopUp("", "30000"); |
44 |
$this->selectPopUp(); |
$this->selectPopUp(); |
45 |
sleep(5); |
sleep(5); |
46 |
$this->verifyNoDatabaseError(); |
$this->verifyNoErrors(); |
47 |
$this->verifyTextPresent("Registre des dossiers en cours"); |
$this->verifyTextPresent("Registre des dossiers en cours"); |
48 |
$this->close(); |
$this->close(); |
49 |
// |
// |
50 |
$this->selectWindow(); |
$this->selectWindow(); |
51 |
|
$this->verifyNoErrors(); |
52 |
$this->verifyTextPresent("Traitement terminé. Le registre a été téléchargé."); |
$this->verifyTextPresent("Traitement terminé. Le registre a été téléchargé."); |
53 |
|
|
54 |
// |
// |
55 |
$this->clickAndWait("link=attestation"); |
$this->clickAndWait("link=attestation"); |
56 |
|
$this->verifyNoErrors(); |
57 |
$this->verifyTextPresent("imprimer l'attestation d'affichage réglementaire"); |
$this->verifyTextPresent("imprimer l'attestation d'affichage réglementaire"); |
58 |
// |
// |
59 |
$this->clickAndWait("//input[@value='Valider']"); |
$this->clickAndWait("//input[@value='Valider']"); |
60 |
|
$this->verifyNoErrors(); |
61 |
$this->verifyTextPresent("Veuiller saisir un N° de dossier."); |
$this->verifyTextPresent("Veuiller saisir un N° de dossier."); |
62 |
// |
// |
63 |
$this->type("id=dossier", "123"); |
$this->type("id=dossier", "123"); |
64 |
$this->clickAndWait("//input[@value='Valider']"); |
$this->clickAndWait("//input[@value='Valider']"); |
65 |
|
$this->verifyNoErrors(); |
66 |
$this->verifyTextPresent("Ce dossier n'existe pas."); |
$this->verifyTextPresent("Ce dossier n'existe pas."); |
67 |
// |
// |
68 |
$this->type("id=dossier", "PC0130551200002P0"); |
$this->type("id=dossier", "PC0130551200002P0"); |
69 |
$this->clickAndWait("//input[@value='Valider']"); |
$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"); |
$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"); |
$this->click("link=Attestation d'affichage"); |
74 |
$this->waitForPopUp("", "30000"); |
$this->waitForPopUp("", "30000"); |
75 |
$this->selectPopUp(); |
$this->selectPopUp(); |
76 |
sleep(5); |
sleep(5); |
77 |
$this->verifyNoDatabaseError(); |
$this->verifyNoErrors(); |
78 |
$this->verifyTextPresent("ATTESTATION D'AFFICHAGE REGLEMENTAIRE"); |
$this->verifyTextPresent("ATTESTATION D'AFFICHAGE REGLEMENTAIRE"); |
79 |
$this->close(); |
$this->close(); |
80 |
// |
// |
89 |
*/ |
*/ |
90 |
public function testRecepisse() { |
public function testRecepisse() { |
91 |
// |
// |
92 |
$this->login(); |
$this->login("guichet", "guichet"); |
93 |
|
|
94 |
// |
// |
95 |
$this->clickAndWait("link=récépissé"); |
$this->clickAndWait("link=récépissé"); |
96 |
|
$this->verifyNoErrors(); |
97 |
$this->verifyTextPresent("demande"); |
$this->verifyTextPresent("demande"); |
98 |
// |
// |
99 |
$this->clickAndWait("link=DAT0130551200001P0"); |
$this->clickAndWait("link=DAT0130551200001P0"); |
100 |
|
$this->verifyNoErrors(); |
101 |
$this->verifyTextPresent("Demande d'autorisation de construire, d'aménager ou de modifier un ERP"); |
$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"); |
$this->click("link=Éditer le récépissé PDF"); |
106 |
$this->waitForPopUp("", "30000"); |
$this->waitForPopUp("", "30000"); |
107 |
$this->selectPopUp(); |
$this->selectPopUp(); |
108 |
sleep(5); |
sleep(5); |
109 |
$this->verifyNoDatabaseError(); |
$this->verifyNoErrors(); |
110 |
$this->verifyTextPresent("RECEPISSE DE DEPOT"); |
$this->verifyTextPresent("RECEPISSE DE DEPOT"); |
111 |
$this->close(); |
$this->close(); |
112 |
// |
// |
113 |
$this->selectWindow(); |
$this->selectWindow(); |
114 |
// |
// |
115 |
$this->clickAndWait("link=Retour"); |
$this->clickAndWait("link=Retour"); |
116 |
|
$this->verifyNoErrors(); |
117 |
$this->verifyTextPresent("demande"); |
$this->verifyTextPresent("demande"); |
118 |
|
|
119 |
// |
// |
125 |
*/ |
*/ |
126 |
public function testPetitionnaireFrequent() { |
public function testPetitionnaireFrequent() { |
127 |
// |
// |
128 |
$this->login(); |
$this->login("guichet", "guichet"); |
129 |
|
|
130 |
// |
// |
131 |
$this->clickAndWait("link=nouveau dossier"); |
$this->clickAndWait("link=nouveau dossier"); |
132 |
|
$this->verifyNoErrors(); |
133 |
$this->verifyTextPresent("demande"); |
$this->verifyTextPresent("demande"); |
134 |
// |
// |
135 |
$this->select("id=dossier_autorisation_type_detaille", "label=Permis de construire pour une maison individuelle et / ou ses annexes"); |
$this->select("id=dossier_autorisation_type_detaille", "label=Permis de construire pour une maison individuelle et / ou ses annexes"); |
150 |
|
|
151 |
$this->click("//input[@value=\"Ajouter l'enregistrement de la table : 'demandeur'\"]"); |
$this->click("//input[@value=\"Ajouter l'enregistrement de la table : 'demandeur'\"]"); |
152 |
sleep(1); |
sleep(1); |
153 |
|
$this->verifyNoErrors(); |
154 |
$this->verifyTextPresent("Vos modifications ont bien été enregistrées."); |
$this->verifyTextPresent("Vos modifications ont bien été enregistrées."); |
155 |
$this->click("css=form[name=\"f2\"] > div.formControls > a.retour"); |
$this->click("css=form[name=\"f2\"] > div.formControls > a.retour"); |
156 |
sleep(1); |
sleep(1); |
157 |
// |
// |
158 |
$this->verifyTextPresent("DURAND MICKAEL\n 12 RUE DE LA LOI APPT 12 \n 13012 MARSEILLE \n 0404040404"); |
$this->verifyTextPresent("DURAND MICKAEL\n 12 RUE DE LA LOI APPT 12 \n 13012 MARSEILLE \n 0404040404"); |
159 |
$this->clickAndWait("//input[@value='Ajouter']"); |
$this->clickAndWait("//input[@value='Ajouter']"); |
160 |
|
$this->verifyNoErrors(); |
161 |
$this->verifyTextPresent("Création du dossier d'autorisation n°PC0130551300003"); |
$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"); |
//$this->click("link= Télécharger le récépissé de la demande"); |
165 |
$this->waitForPopUp("", "30000"); |
$this->waitForPopUp("", "30000"); |
166 |
$this->selectPopUp(); |
$this->selectPopUp(); |
167 |
sleep(5); |
sleep(5); |
168 |
$this->verifyNoDatabaseError(); |
$this->verifyNoErrors(); |
169 |
$this->verifyTextPresent("RECEPISSE DE DEPOT"); |
$this->verifyTextPresent("RECEPISSE DE DEPOT"); |
170 |
$this->close(); |
$this->close(); |
171 |
// |
// |
172 |
$this->selectWindow(); |
$this->selectWindow(); |
173 |
// |
// |
174 |
$this->clickAndWait("link=Retour"); |
$this->clickAndWait("link=Retour"); |
175 |
|
$this->verifyNoErrors(); |
176 |
// |
// |
177 |
$this->clickAndWait("link=pétitionnaire fréquent"); |
$this->clickAndWait("link=pétitionnaire fréquent"); |
178 |
|
$this->verifyNoErrors(); |
179 |
$this->verifyTextPresent("pétitionnaire fréquent"); |
$this->verifyTextPresent("pétitionnaire fréquent"); |
|
// |
|
180 |
$this->verifyTextPresent("DURAND MICKAEL"); |
$this->verifyTextPresent("DURAND MICKAEL"); |
181 |
// |
// |
182 |
$this->clickAndWait("link=DURAND MICKAEL"); |
$this->clickAndWait("link=DURAND MICKAEL"); |
183 |
|
$this->verifyNoErrors(); |
184 |
$this->verifyTextPresent("RUE DE LA LOI "); |
$this->verifyTextPresent("RUE DE LA LOI "); |
185 |
// |
// |
186 |
$this->clickAndWait("link=Retour"); |
$this->clickAndWait("link=Retour"); |
187 |
|
$this->verifyNoErrors(); |
188 |
$this->verifyTextPresent("pétitionnaire fréquent"); |
$this->verifyTextPresent("pétitionnaire fréquent"); |
189 |
// |
// |
190 |
$this->logout(); |
$this->logout(); |