14 |
*/ |
*/ |
15 |
class Instruction extends BaseTestCase { |
class Instruction extends BaseTestCase { |
16 |
|
|
|
private function login() { |
|
|
// on commence par se connecter |
|
|
$this->connect("instr", "instr"); |
|
|
// 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 vise uniquement à vérifier que les écrans correspondant à chaque |
* Ce test vise uniquement à vérifier que les écrans correspondant à chaque |
19 |
* entrée de menu ne génère pas une erreur de base de données |
* entrée de menu ne génère pas une erreur de base de données |
20 |
*/ |
*/ |
21 |
public function testGeneral() { |
public function testGeneral() { |
22 |
// |
// |
23 |
$this->login(); |
$this->login("instr", "instr"); |
24 |
|
|
25 |
// |
// |
26 |
$this->clickAndWait("link=mes encours"); |
$this->clickAndWait("link=mes encours"); |
27 |
|
$this->verifyNoErrors(); |
28 |
$this->verifyTextPresent("DI"); |
$this->verifyTextPresent("DI"); |
|
$this->verifyNoDatabaseError(); |
|
29 |
// |
// |
30 |
$this->clickAndWait("link=tous les encours"); |
$this->clickAndWait("link=tous les encours"); |
31 |
|
$this->verifyNoErrors(); |
32 |
$this->verifyTextPresent("DI"); |
$this->verifyTextPresent("DI"); |
|
$this->verifyNoDatabaseError(); |
|
33 |
// |
// |
34 |
$this->clickAndWait("link=mes clôturés"); |
$this->clickAndWait("link=mes clôturés"); |
35 |
|
$this->verifyNoErrors(); |
36 |
$this->verifyTextPresent("DI"); |
$this->verifyTextPresent("DI"); |
|
$this->verifyNoDatabaseError(); |
|
37 |
// |
// |
38 |
$this->clickAndWait("link=tous les clôturés"); |
$this->clickAndWait("link=tous les clôturés"); |
39 |
|
$this->verifyNoErrors(); |
40 |
$this->verifyTextPresent("DI"); |
$this->verifyTextPresent("DI"); |
|
$this->verifyNoDatabaseError(); |
|
41 |
// |
// |
42 |
$this->clickAndWait("link=recherche"); |
$this->clickAndWait("link=recherche"); |
43 |
|
$this->verifyNoErrors(); |
44 |
$this->verifyTextPresent("DI"); |
$this->verifyTextPresent("DI"); |
|
$this->verifyNoDatabaseError(); |
|
45 |
// |
// |
46 |
$this->clickAndWait("link=dossiers a qualifier"); |
$this->clickAndWait("link=dossiers à qualifier"); |
47 |
|
$this->verifyNoErrors(); |
48 |
$this->verifyTextPresent("dossier"); |
$this->verifyTextPresent("dossier"); |
|
$this->verifyNoDatabaseError(); |
|
49 |
// |
// |
50 |
$this->clickAndWait("link=Mes retours"); |
$this->clickAndWait("link=Mes retours"); |
51 |
|
$this->verifyNoErrors(); |
52 |
$this->verifyTextPresent("dossier"); |
$this->verifyTextPresent("dossier"); |
|
$this->verifyNoDatabaseError(); |
|
53 |
// |
// |
54 |
$this->clickAndWait("link=Tous les retours"); |
$this->clickAndWait("link=Tous les retours"); |
55 |
|
$this->verifyNoErrors(); |
56 |
$this->verifyTextPresent("dossier"); |
$this->verifyTextPresent("dossier"); |
|
$this->verifyNoDatabaseError(); |
|
57 |
// |
// |
58 |
$this->clickAndWait("link=Mes messages"); |
$this->clickAndWait("link=Mes messages"); |
59 |
|
$this->verifyNoErrors(); |
60 |
$this->verifyTextPresent("dossier"); |
$this->verifyTextPresent("dossier"); |
|
$this->verifyNoDatabaseError(); |
|
61 |
// |
// |
62 |
$this->clickAndWait("link=Tous les messages"); |
$this->clickAndWait("link=Tous les messages"); |
63 |
|
$this->verifyNoErrors(); |
64 |
$this->verifyTextPresent("dossier"); |
$this->verifyTextPresent("dossier"); |
|
$this->verifyNoDatabaseError(); |
|
65 |
// |
// |
66 |
$this->clickAndWait("css=a.commission_mes_retours-16"); |
$this->clickAndWait("css=a.commission_mes_retours-16"); |
67 |
|
$this->verifyNoErrors(); |
68 |
$this->verifyTextPresent("dossier"); |
$this->verifyTextPresent("dossier"); |
|
$this->verifyNoDatabaseError(); |
|
69 |
// |
// |
70 |
$this->clickAndWait("css=a.commission_tous_retours-16"); |
$this->clickAndWait("css=a.commission_tous_retours-16"); |
71 |
|
$this->verifyNoErrors(); |
72 |
$this->verifyTextPresent("dossier"); |
$this->verifyTextPresent("dossier"); |
|
$this->verifyNoDatabaseError(); |
|
|
|
|
|
// |
|
|
$this->logout(); |
|
|
} |
|
|
|
|
|
/** |
|
|
* |
|
|
*/ |
|
|
public function testConsultationDeServices() { |
|
|
// |
|
|
$this->login(); |
|
|
|
|
|
$this->clickAndWait("link=mes encours"); |
|
|
// Accès au dossier en visualisation |
|
|
$this->clickAndWait("link=AZ0130551200001P0"); |
|
|
$this->verifyNoDatabaseError(); |
|
|
// Accès à l'onglet des consultations |
|
|
$this->click("id=consultation"); |
|
|
$this->setSpeed('120'); |
|
|
$this->verifyNoDatabaseError(); |
|
|
//// Ajout d'une simple consultation |
|
|
// On clique sur le bouton ajout |
|
|
$this->click("//div[@id='sousform-consultation']/table/thead/tr/th/a/span"); |
|
|
$this->verifyNoDatabaseError(); |
|
|
// On sélectionne le service |
|
|
$this->select("id=service", "label=1ER Maire 1er Secteur"); |
|
|
// On valide le formulaire |
|
|
$this->click("//input[@value='Ajouter']"); |
|
|
$this->verifyNoDatabaseError(); |
|
|
// |
|
|
$this->verifyTextPresent("Vos modifications ont bien été enregistrées."); |
|
|
// On clique sur le bouton retour |
|
|
$this->click("css=form[name=\"f2\"] > div.formControls > a.retour"); |
|
|
|
|
|
//// Ajout de plusieurs consultations |
|
|
// On clique sur le bouton ajout multiple |
|
|
$this->click("//div[@id='sousform-consultation']/table/thead/tr/th/a[2]/span"); |
|
|
$this->verifyNoDatabaseError(); |
|
|
// On sélectionne trois servcies |
|
|
$this->click("id=t10_572_0_"); |
|
|
$this->click("id=t10_575_0_"); |
|
|
$this->click("id=t10_584_0_"); |
|
|
// On les ajoute à la sélection |
|
|
$this->click("id=add-ser-them"); |
|
|
// On valide le formulaire |
|
|
$this->click("id=button_val"); |
|
|
$this->verifyNoDatabaseError(); |
|
|
// |
|
|
$this->verifyTextPresent("3 service(s) sélectionné(s) dont 0 consultation(s) papier."); |
|
|
|
|
|
// On vérifie que nous avons bien 4 consultations affichées |
|
|
$this->verifyTextPresent("1 - 4 enregistrement(s) sur 4"); |
|
73 |
|
|
74 |
// |
// |
75 |
$this->logout(); |
$this->logout(); |