14 |
*/ |
*/ |
15 |
class ServiceConsulte extends BaseTestCase { |
class ServiceConsulte extends BaseTestCase { |
16 |
|
|
|
private function login() { |
|
|
// on commence par se connecter |
|
|
$this->connect("consu", "consu"); |
|
|
// 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 |
* |
* |
19 |
*/ |
*/ |
20 |
public function testSaisieDemandeAvis() { |
public function testDemandesAvisPassees() { |
21 |
// |
// |
22 |
$this->login(); |
$this->login("consu", "consu"); |
|
$this->setSpeed('120'); |
|
|
|
|
|
$this->clickAndWait("link=Demandes en cours"); |
|
|
// Accès au dossier en visualisation |
|
|
$this->clickAndWait("link=AZ0130551200001P0"); |
|
|
$this->verifyNoErrors(); |
|
|
$this->verifyTextPresent("Demandes d'avis > en cours"); |
|
|
// Accès à l'onglet des consultations |
|
|
$this->click("//div[@id='portlet-actions']/ul/li/a/span"); |
|
|
$this->verifyTextPresent("consultations 2"); |
|
|
$this->verifyNoErrors(); |
|
|
// Validation sans retour d'avis |
|
|
$this->click("//input[@value='Modifier']"); |
|
|
$this->verifyNoErrors(); |
|
|
// Retour à la liste des demandes |
|
|
$this->click("css=form[name=\"f2\"] > div.formControls > a.retour"); |
|
23 |
|
|
24 |
// Accès au dossier en visualisation |
// |
25 |
$this->clickAndWait("link=AZ0130551200001P0"); |
$this->clickAndWait("link=Demandes passées"); |
|
$this->verifyNoErrors(); |
|
|
$this->verifyTextPresent("Demandes d'avis > en cours"); |
|
|
// Accès à l'onglet des consultations |
|
|
$this->click("//div[@id='portlet-actions']/ul/li/a/span"); |
|
|
$this->verifyTextPresent("consultations 2"); |
|
|
$this->verifyNoErrors(); |
|
|
// Saisie de valeurs |
|
|
$this->select("id=avis_consultation", "label=Defavorable"); |
|
|
$this->type("id=motivation", "Pas motivé"); |
|
|
// Upload de fichier |
|
|
$this->click("css=span.ui-icon.ui-icon-arrowthickstop-1-s"); |
|
|
// Validation sans saisie de fichier |
|
|
$this->click("name=submit"); |
|
|
$this->verifyTextPresent("Vous devez sélectionner un fichier."); |
|
|
// Saisie de fichier |
|
|
$this->type("name=userfile[]", dirname(__FILE__)."/binaire/lettre_rar16042013124515.pdf"); |
|
|
$this->click("name=submit"); |
|
|
// Validation de la modification de la demande d'avis |
|
|
$this->click("//input[@value='Modifier']"); |
|
26 |
$this->verifyNoErrors(); |
$this->verifyNoErrors(); |
|
$this->verifyTextPresent("Vos modifications ont bien été enregistrées."); |
|
27 |
|
|
|
// Retour à la liste des demandes |
|
|
$this->click("css=form[name=\"f2\"] > div.formControls > a.retour"); |
|
|
// Vérification que la demande d'avis n'est plus presente |
|
|
$this->assertTextNotPresent("link=AZ0130551200001P0"); |
|
|
|
|
28 |
// |
// |
|
$this->logout(); |
|
|
} |
|
|
|
|
|
/** |
|
|
* |
|
|
*/ |
|
|
public function testDemandesAvisPassees() { |
|
|
// |
|
|
$this->login(); |
|
|
|
|
|
$this->clickAndWait("link=Demandes passées"); |
|
29 |
$this->clickAndWait("link=AZ0130551200001P0"); |
$this->clickAndWait("link=AZ0130551200001P0"); |
30 |
$this->verifyNoErrors(); |
$this->verifyNoErrors(); |
31 |
$this->verifyTextPresent("Demandes d'avis > passées"); |
$this->verifyTextPresent("Demandes d'avis > passées"); |