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

Contents of /trunk/tests/testServiceConsulte.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1720 - (show annotations)
Thu Apr 18 10:55:38 2013 UTC (11 years, 9 months ago) by fmichon
File size: 4089 byte(s)
Ajout de verifyNoErrors là ou il le fallait

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 ServiceConsulte extends BaseTestCase {
16
17 private function login() {
18 // on commence par se connecter
19 $this->connect("consu", "consu");
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 /**
35 *
36 */
37 public function testSaisieDemandeAvis() {
38 //
39 $this->login();
40 $this->setSpeed('120');
41
42 $this->clickAndWait("link=Demandes en cours");
43 // Accès au dossier en visualisation
44 $this->clickAndWait("link=AZ0130551200001P0");
45 $this->verifyNoErrors();
46 $this->verifyTextPresent("Demandes d'avis > en cours");
47 // Accès à l'onglet des consultations
48 $this->click("//div[@id='portlet-actions']/ul/li/a/span");
49 $this->verifyTextPresent("consultations 2");
50 $this->verifyNoErrors();
51 // Validation sans retour d'avis
52 $this->click("//input[@value='Modifier']");
53 $this->verifyNoErrors();
54 // Retour à la liste des demandes
55 $this->click("css=form[name=\"f2\"] > div.formControls > a.retour");
56
57 // Accès au dossier en visualisation
58 $this->clickAndWait("link=AZ0130551200001P0");
59 $this->verifyNoErrors();
60 $this->verifyTextPresent("Demandes d'avis > en cours");
61 // Accès à l'onglet des consultations
62 $this->click("//div[@id='portlet-actions']/ul/li/a/span");
63 $this->verifyTextPresent("consultations 2");
64 $this->verifyNoErrors();
65 // Saisie de valeurs
66 $this->select("id=avis_consultation", "label=Defavorable");
67 $this->type("id=motivation", "Pas motivé");
68 // Upload de fichier
69 $this->click("css=span.ui-icon.ui-icon-arrowthickstop-1-s");
70 // Validation sans saisie de fichier
71 $this->click("name=submit");
72 $this->verifyNoErrors();
73 $this->verifyTextPresent("Vous devez sélectionner un fichier.");
74 // Saisie de fichier
75 $this->type("name=userfile[]", dirname(__FILE__)."/binaire/lettre_rar16042013124515.pdf");
76 $this->click("name=submit");
77 $this->verifyNoErrors();
78 // Validation de la modification de la demande d'avis
79 $this->click("//input[@value='Modifier']");
80 $this->verifyNoErrors();
81 $this->verifyTextPresent("Vos modifications ont bien été enregistrées.");
82
83 // Retour à la liste des demandes
84 $this->click("css=form[name=\"f2\"] > div.formControls > a.retour");
85 $this->verifyNoErrors();
86 // Vérification que la demande d'avis n'est plus presente
87 $this->assertTextNotPresent("link=AZ0130551200001P0");
88
89 //
90 $this->logout();
91 }
92
93 /**
94 *
95 */
96 public function testDemandesAvisPassees() {
97 //
98 $this->login();
99
100 //
101 $this->clickAndWait("link=Demandes passées");
102 $this->verifyNoErrors();
103
104 //
105 $this->clickAndWait("link=AZ0130551200001P0");
106 $this->verifyNoErrors();
107 $this->verifyTextPresent("Demandes d'avis > passées");
108 // $this->click("//div[@id='portlet-actions']/ul/li/a/span");
109 // $this->waitForPopUp("", "30000");
110 // $this->selectPopUp();
111 // sleep(5);
112 // $this->verifyNoErrors();
113 // $this->verifyTextPresent("Avis solicité pour conformité");
114 // $this->verifyTextPresent("Direction de l'Eau et de l'Assainissement");
115 // $this->close();
116 // $this->selectWindow();
117 //
118 $this->logout();
119 }
120
121 }
122 ?>

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26