*** Settings *** Documentation Gestion des consultations. # On inclut les mots-clefs Resource resources/resources.robot # On ouvre/ferme le navigateur au début/à la fin du Test Suite. Suite Setup For Suite Setup Suite Teardown For Suite Teardown *** Test Cases *** Constitution du jeu de données Consultation [Documentation] L'objet de ce 'Test Case' est de constituer le jeu de données Initialisation Variables Consultation Run Keyword If '${CONTEXT_CONSULTATION_1_CREATED}' == 'False' Initialisation du jeu de données Consultation 1er tier Set Global Variable ${CONTEXT_CONSULTATION_1_CREATED} True Run Keyword If '${CONTEXT_CONSULTATION_2_3_CREATED}' == 'False' Initialisation du jeu de données Consultation 2eme et 3eme tier Set Global Variable ${CONTEXT_CONSULTATION_2_3_CREATED} True Depuis la page d'accueil admin admin ${tiers} = Set Variable 1er tiers de Marseille ${args_tiers_1.liste_diffusion} = Set Variable test1@atreal.fr\ntest2@atreal.fr Modifier le tiers consulte ${tiers} ${args_tiers_1} Vérification des habilitations des tiers consultés [Documentation] Lorsque l'utilisateur se rend dans les habilitations de tiers consultés, ... la recherche avancée doit filtrer correctement en ne retournant dans la liste ... uniquement les habilitations qui correspondent aux critères de recherche avancée. # On crée différents types d'habilitations de tiers consultés Depuis la page d'accueil admin admin # Ajout d'une commune et d'un département pour tester l'export des champs # division territoriales d'intervention commune et [...] département &{com_values} = Create Dictionary ... typecom=COM ... com=01010 ... reg=01 ... dep=01 ... arr=010 ... tncc=0 ... ncc=EXPORTCOM ... nccenr=EXPORTCOM ... libelle=EXPORTCOM ... can=01 ... comparent= ... om_validite_debut=01/01/2020 Ajouter commune avec dates validité ${com_values} &{dep_values} = Create Dictionary ... dep=01 ... reg=01 ... cheflieu=01010 ... tncc=0 ... ncc=EXPORTDEP ... nccenr=EXPORTDEP ... libelle=Département test export ... om_validite_debut=01/01/2020 Ajouter département ${dep_values} ## On crée un premier type d'habilitation de tiers consulté Depuis le listing type_habilitation_tiers_consulte Click On Add Button Input Text css=input#code.champFormulaire 123 Input Text css=input#libelle.champFormulaire TypeHTC1 Input Text css=input#om_validite_debut.champFormulaire 01/01/20203 Input Text css=input#om_validite_fin.champFormulaire 01/01/2099 Click On Submit Button ## On procède à la même opération pour crée un second type d'habilitation de tiers consulté Depuis le listing type_habilitation_tiers_consulte Click On Add Button Input Text css=input#code.champFormulaire 456 Input Text css=input#libelle.champFormulaire TypeHTC2 Input Text css=input#om_validite_debut.champFormulaire 02/02/2022 Input Text css=input#om_validite_fin.champFormulaire 02/02/2099 Click On Submit Button # L'ajout de la spécialité de tiers consulté, du dept et de la commune servent au test : # Export des tiers consulté # Ils sont ajoutés ici pour éviter un traitement supplémentaires de modification de l'habilitation # du tiers pour avoir toutes les valeurs voules dans l'export. # On crée une spécialité de tiers consulté &{spe_values} = Create Dictionary ... code=plop ... libelle=plop ${id_spe} = Ajouter la spécialité de tiers consulté ${spe_values} Set Suite Variable ${spe_values} Set Suite Variable ${id_spe} ## On crée une première habilitation de tiers consulté &{dept_values} = Create Dictionary ... dep=35 ... reg=35 ... cheflieu=35535 ... tncc=0 ... ncc=DEP_HTC1 ... nccenr=DEP_HTC1 ... libelle=DEP_HTC1 ... om_validite_debut=01/01/2023 ${id_dep} = Ajouter département ${dept_values} &{com_values} = Create Dictionary ... typecom=COM ... com=35535 ... reg=35 ... dep=35 ... arr=535 ... tncc=0 ... ncc=COM_HTC1 ... nccenr=COM_HTC1 ... libelle=COM_HTC1 ... can=35 ... om_validite_debut=01/01/2023 ${id_com} = Ajouter commune avec dates validité ${com_values} @{dep_HTC1} = Create List ${dept_values.dep} - ${dept_values.libelle} @{com_HTC1} = Create List ${com_values.com} - ${com_values.libelle} @{spe_tc} = Create List ${spe_values.code} - ${spe_values.libelle} ${hab_values} = Create Dictionary ... type_habilitation_tiers_consulte=TypeHTC1 ... texte_agrement=txt agrement ... tiers_consulte=1er tiers de Marseille ... division_territoriales=DivisionHTC1 ... om_validite_debut=01/01/2022 ... om_validite_fin=01/01/2099 ... specialite_tiers_consulte=${spe_tc} ${id_hab} = Ajouter une habilitation de tiers consulté ${hab_values} ${dep_HTC1} ${com_HTC1} # Récupération des valeurs des champs qui serviront à tester l'export des tiers dans un autre test Set Suite Variable ${id_hab} Set Suite Variable ${id_dep} Set Suite Variable ${dept_values} Set Suite Variable ${id_com} Set Suite Variable ${com_values} Set Suite Variable ${hab_values} ## On crée une seconde habilitation de tiers consulté Depuis le listing habilitation_tiers_consulte Click On Add Button Select From List By Label type_habilitation_tiers_consulte TypeHTC2 Select From List By Label tiers_consulte 2ème tiers de Marseille Input Text css=textarea#division_territoriales.champFormulaire DivisionHTC2 Input Text css=input#om_validite_debut.champFormulaire 02/02/2022 Input Text css=input#om_validite_fin.champFormulaire 02/02/2099 Click On Submit Button # On effectue une recherche (en remplissant tous les champs) : Seule # une habilitations doit apparaitre. L'autre ne doit pas apparaitre. Depuis le listing habilitation_tiers_consulte Click Element css=legend#toggle-advanced-display Select From List By Label type_habilitation_tiers_consulte TypeHTC1 Input Text css=input#om_validite_debut_min.champFormulaire 15/01/2020 Input Text css=input#om_validite_debut_max.champFormulaire 15/01/2022 Input Text css=input#om_validite_fin_min.champFormulaire 15/01/2042 Input Text css=input#om_validite_fin_max.champFormulaire 15/01/2099 Input Text css=input#division_territoriales.champFormulaire DivisionHTC1 Click On Search Button Element Should Contain css=table.tab-tab TypeHTC1 # Télécharge le fichier d'export CSV ${link} = Get Element Attribute css=div.tab-export a href ${output_dir} ${output_name} = Télécharger un fichier ${SESSION_COOKIE} ${link} ${EXECDIR}${/}binary_files${/} ${full_path_to_file} = Catenate SEPARATOR= ${output_dir} ${output_name} # On vérifie que le contenu du fichier CSV corresponde au filtre de recherche avancée ${content_file} = Get File ${full_path_to_file} @{hab_field_values} = Create List ${hab_values.type_habilitation_tiers_consulte} ${hab_values.division_territoriales} "${com_values.com} - ${com_values.libelle}" "${dept_values.dep} - ${dept_values.libelle}" "${hab_values.texte_agrement}" "${spe_values.code} - ${spe_values.libelle}" ${hab_values.om_validite_debut} ${hab_values.om_validite_fin} @{tiers_field_values} = Create List "${args_tiers_1.libelle}" "${args_tiers_1.categorie_tiers_consulte}" ${args_tiers_1.abrege} "${args_tiers_1.libelle}" "${args_tiers_1.adresse}" "${args_tiers_1.complement}" ${args_tiers_1.cp} ${args_tiers_1.ville} "${args_tiers_1.liste_diffusion}" Oui ${args_tiers_1.uid_platau_acteur} "consu, instrserv" ${lines_csv_file} = Catenate SEPARATOR=; @{hab_field_values} @{tiers_field_values} Should Contain ${content_file} ${lines_csv_file} Vérification des habilitations des tiers consultés avec division territoriale d’intervention [Documentation] Le formulaire avec le champ de division territoriale d’intervention ... séparé en deux champs (commune et département) doit fonctionner. ${yyyy} = Get Time year ${mm} = Get Time month ${dd} = Get Time day ${date_courante} = Catenate SEPARATOR=/ ${dd} ${mm} ${yyyy} # On crée différents types d'habilitations de tiers consultés Depuis la page d'accueil admin admin ## On crée un premier type d'habilitation de tiers consulté Depuis le listing type_habilitation_tiers_consulte Click On Add Button Input Text css=input#code.champFormulaire 456 Input Text css=input#libelle.champFormulaire TypeHTCZ Input Text css=input#om_validite_debut.champFormulaire ${date_courante} Input Text css=input#om_validite_fin.champFormulaire 01/01/2099 Click On Submit Button ## On ajoute trois communes (ue dans le passé, deux valides) &{expiredcom_values} = Create Dictionary ... typecom=COM ... com=46646 ... reg=46 ... dep=46 ... arr=646 ... tncc=0 ... ncc=EXPIREDCOM6 ... nccenr=Expiredcom6 ... libelle=Expiredcom6 ... can=46 ... comparent= ... om_validite_debut=01/01/2020 ... om_validite_fin=01/02/2020 Ajouter commune avec dates validité ${expiredcom_values} &{validcom1_values} = Create Dictionary ... typecom=COM ... com=41141 ... reg=41 ... dep=41 ... arr=141 ... tncc=0 ... ncc=VALIDCOM1 ... nccenr=Validcom1 ... libelle=Validcom1 ... can=41 ... comparent= ... om_validite_debut=${date_courante} Ajouter commune avec dates validité ${validcom1_values} &{validcom2_values} = Create Dictionary ... typecom=COM ... com=42242 ... reg=42 ... dep=42 ... arr=242 ... tncc=0 ... ncc=VALIDCOM2 ... nccenr=Validcom2 ... libelle=Validcom2 ... can=42 ... comparent= ... om_validite_debut=${date_courante} Ajouter commune avec dates validité ${validcom2_values} ## On ajoute trois départements &{dept1_values} = Create Dictionary ... dep=41 ... reg=41 ... cheflieu=41141 ... tncc=0 ... ncc=DEPT1 ... nccenr=Dept1 ... libelle=Département1 ... om_validite_debut=${date_courante} Ajouter département ${dept1_values} &{dept2_values} = Create Dictionary ... dep=42 ... reg=42 ... cheflieu=42242 ... tncc=0 ... ncc=DEPT2 ... nccenr=Dept2 ... libelle=Département2 ... om_validite_debut=${date_courante} Ajouter département ${dept2_values} &{dept3_values} = Create Dictionary ... dep=46 ... reg=46 ... cheflieu=46646 ... tncc=0 ... ncc=DEPT6 ... nccenr=Dept6 ... libelle=Département6 ... om_validite_debut=01/01/2020 ... om_validite_fin=01/02/2020 Ajouter département ${dept3_values} ## On ajoute un tiers consulté &{tc_values} = Create Dictionary ... categorie_tiers_consulte=Catégorie Marseille ... abrege=TMZ ... libelle=Zieme tiers de Marseille ... ville=MARSEILLE ... liste_diffusion=test1@atreal.fr ... accepte_notification_email=Oui Ajouter le tiers consulte depuis le listing ${tc_values} ## On ajoute une habilitation Depuis le listing habilitation_tiers_consulte Click On Add Button Select From List By Label type_habilitation_tiers_consulte TypeHTCZ Select From List By Label tiers_consulte ${tc_values.libelle} @{communes_a_selectionner} = Create List ... ${validcom1_values.com} - ${validcom1_values.libelle} ... ${expiredcom_values.com} - ${expiredcom_values.libelle} Select From Multiple Chosen List division_territoire_intervention_commune ${communes_a_selectionner} @{departements_a_selectionner} = Create List ... ${dept2_values.dep} - ${dept2_values.libelle} ... ${dept3_values.dep} - ${dept3_values.libelle} Select From Multiple Chosen List division_territoire_intervention_departement ${departements_a_selectionner} Input Text css=textarea#division_territoriales.champFormulaire DivisionHTCZ Input Text css=input#om_validite_debut.champFormulaire 01/01/2022 Input Text css=input#om_validite_fin.champFormulaire 01/01/2099 Click On Submit Button Depuis le listing habilitation_tiers_consulte Click Element css=legend#toggle-advanced-display Select From List By Label type_habilitation_tiers_consulte TypeHTCZ Input Text css=input#division_territoriales.champFormulaire DivisionHTCZ Click On Search Button Click Element css=div#tab-habilitation_tiers_consulte table.tab-tab td.col-0.firstcol a.lienTable Form Static Value Should Be css=#type_habilitation_tiers_consulte TypeHTCZ #Form Static Value Should Be css=#division_territoire_intervention_commune ${validcom1_values.com} - ${validcom1_values.libelle} Page Should Contain Element xpath=//div[contains(@class, "field-type-select_multiple_static")]/div/ul/li[normalize-space(text()) = "${validcom1_values.com} - ${validcom1_values.libelle}"] Page Should Not Contain Element xpath=//div[contains(@class, "field-type-select_multiple_static")]/div/ul/li[normalize-space(text()) = "${validcom2_values.com} - ${validcom2_values.libelle}"] Page Should Not Contain Element xpath=//div[contains(@class, "field-type-select_multiple_static")]/div/ul/li[normalize-space(text()) = "${expiredcom_values.com} - ${expiredcom_values.libelle}"] #Form Static Value Should Be css=#division_territoire_intervention_departement ${dept2_values.dep} - ${dept2_values.libelle} Page Should Contain Element xpath=//div[contains(@class, "field-type-select_multiple_static")]/div/ul/li[normalize-space(text()) = "${dept2_values.dep} - ${dept2_values.libelle}"] Page Should Not Contain Element xpath=//div[contains(@class, "field-type-select_multiple_static")]/div/ul/li[normalize-space(text()) = "${dept1_values.dep} - ${dept1_values.libelle}"] Page Should Not Contain Element xpath=//div[contains(@class, "field-type-select_multiple_static")]/div/ul/li[normalize-space(text()) = "${dept3_values.dep} - ${dept3_values.libelle}"] Form Static Value Should Be css=#division_territoriales DivisionHTCZ Form Static Value Should Be css=#tiers_consulte ${tc_values.libelle} # Vérification filtrage catégorie tiers consulté &{allauch_cat_tiers_consulte} = Create Dictionary ... categorie_tiers_consulte=Catégorie ALLAUCH ... abrege=TMZ ... libelle=toto ... ville=ALLAUCH Ajouter le tiers consulte depuis le listing ${allauch_cat_tiers_consulte} # Catégorie ALLAUCH Depuis le listing categorie_tiers_consulte Click On Link css=tbody > tr > td.col-1 > a.lienTable ${libelle_categorie_tc} = Get Text css=#libelle Log ${libelle_categorie_tc} Click On Link css=#tiers_consulte Element Should Contain css=tbody > tr > td.col-1 > a.lienTable Catégorie ALLAUCH Element Should Not Contain css=tbody > tr > td.col-1 > a.lienTable Catégorie Marseille Element Should Not Contain css=tbody > tr > td.col-1 > a.lienTable Catégorie MA Export des tiers consulté [Documentation] L'export des tiers dois contenir les données suivantes : ... - Information de la table tiers ... - Informations de la table categorie_tiers_consulte ... - Informations de la table habilitation_tiers_consulte ... - La specialite de tiers consulte ... - Les divisions territoriales d'intervention commune et département ... /!\ ce test dépend des deux tests précédents # Ajout des données manquantes pour que les formulaires soient complet @{collectivite} = Create List MARSEILLE ${cat_values} = Create Dictionary ... code=CAT1 ... description=Catégorie des tiers de Marseille ... libelle=Catégorie Marseille ... om_validite_debut=01/01/2023 ... om_validite_fin=30/12/2099 ... om_collectivite=${collectivite} Modifier la categorie de tiers consulte CAT1 ${cat_values} Depuis le listing tiers_consulte # Télécharge le fichier d'export CSV ${link} = Get Element Attribute css=div.tab-export a href ${output_dir} ${output_name} = Télécharger un fichier ${SESSION_COOKIE} ${link} ${EXECDIR}${/}binary_files${/} ${full_path_to_file} = Catenate SEPARATOR= ${output_dir} ${output_name} ${content_file} = Get File ${full_path_to_file} # Test le contenu du fichier CSV @{tiers_field_values} = Create List ${args_tiers_1.abrege} "${args_tiers_1.libelle}" "${args_tiers_1.adresse}" "${args_tiers_1.complement}" ${args_tiers_1.cp} ${args_tiers_1.ville} "${args_tiers_1.liste_diffusion}" Oui ${args_tiers_1.uid_platau_acteur} "consu, instrserv" @{cat_field_values} = Create List 1 "${cat_values.libelle}" ${cat_values.code} "${cat_values.description}" ${cat_values.om_validite_debut} ${cat_values.om_validite_fin} MARSEILLE @{hab_field_values} = Create List ${id_hab} ${hab_values.type_habilitation_tiers_consulte} "${hab_values.texte_agrement}" ${id_com} ${com_values.libelle} ${id_dep} ${dept_values.libelle} ${hab_values.division_territoriales} ${hab_values.om_validite_debut} ${hab_values.om_validite_fin} "${id_spe} - ${spe_values.code} - ${spe_values.libelle}" ${values_to_check} = Catenate SEPARATOR=; @{tiers_field_values} @{cat_field_values} @{hab_field_values} Should Contain ${content_file} ${values_to_check}