diff --git a/paheko.side b/paheko.side index ac866ee..c319542 100644 --- a/paheko.side +++ b/paheko.side @@ -7710,14 +7710,14 @@ "value": "" }, { "id": "36208941-ab41-44be-9a9c-ddf241fa818b", - "comment": "Nombre catégories", + "comment": "", "command": "storeXpathCount", "target": "xpath=//nav[@class=\"dropdown\"]//a[contains(@href, \"?cat=\")]", "targets": [], "value": "nb_categories" }, { "id": "1dbf5b56-db31-486e-b46d-d624381663d1", - "comment": "idem", + "comment": "Nombre catégories", "command": "executeScript", "target": "return ${nb_categories} - 2", "targets": [], @@ -7982,25 +7982,46 @@ "target": "var nav = document.querySelector(\".dropdown\"); var li = nav.querySelectorAll(\"li\"); var nb = li.length; for (const l of li) { l.style.display=\"block\"; } return;", "targets": [], "value": "" + }, { + "id": "f6afe9da-372d-45b8-9596-da9ac2490068", + "comment": "Sélectionner tous les membres", + "command": "storeText", + "target": "xpath=//a[contains(., \"Toutes, même cachées\")]//small", + "targets": [], + "value": "membres" + }, { + "id": "b4a29afa-dae4-48a1-b0b6-cbebd87fd10d", + "comment": "Nombre total de membres ", + "command": "executeScript", + "target": "return Number(${membres}.split(/ /)[0])", + "targets": [], + "value": "nb_total_membres" + }, { + "id": "7bf2177d-5bcb-4e55-aee4-f77b61b7cfd3", + "comment": "", + "command": "echo", + "target": "nombre total de membres = ${nb_total_membres}", + "targets": [], + "value": "" }, { "id": "ffa88538-fe57-4796-9619-ea43deae3932", - "comment": "Filtrer : tous même cachés", + "comment": "Filtrer : toutes même cachées", "command": "click", "target": "xpath=//a[contains(., \"Toutes, même cachées\")]", "targets": [], "value": "" }, { "id": "719535c3-c0a3-4c3c-868e-551cf9c7b99f", - "comment": "Nombre de membres", + "comment": "Nombre de membres sur la page", "command": "storeXpathCount", "target": "xpath=//table[@class=\"list\"]/tbody/tr/th//span", "targets": [], - "value": "nb_membres" + "value": "nb_membres_page" }, { "id": "d5978b1b-d519-4973-b89a-658bf4c53584", "comment": "", "command": "echo", - "target": "nombre de membres = ${nb_membres}", + "target": "nombre de membres sur la page = ${nb_membres_page}", "targets": [], "value": "" }, { @@ -8021,7 +8042,49 @@ "id": "6b67c901-3fcd-436a-adbf-c9d95321c0c8", "comment": "Parcourir les membres affichés", "command": "while", - "target": "${num} <= ${nb_membres}", + "target": "${num} <= ${nb_total_membres}", + "targets": [], + "value": "" + }, { + "id": "791c5ccd-c132-4ad8-bf74-5c3e14613d9b", + "comment": "", + "command": "if", + "target": "${num} > ${nb_membres_page}", + "targets": [], + "value": "" + }, { + "id": "ee718f8d-03fe-464f-87fd-417db36dd34e", + "comment": "passer à la page suivante", + "command": "click", + "target": "xpath=//li[@class=\"next\"]", + "targets": [], + "value": "" + }, { + "id": "966f6ca4-836b-4efa-bf53-091c8d51e837", + "comment": "", + "command": "executeScript", + "target": "return ${nb_total_membres} - ${nb_membres_page}", + "targets": [], + "value": "nb_total_membres" + }, { + "id": "ed4b8f75-9e7c-46e2-83ae-f4d43f4d3305", + "comment": "", + "command": "executeScript", + "target": "return 1", + "targets": [], + "value": "num" + }, { + "id": "bd9bdb4d-1272-40c5-8bce-5b4a54fdd2be", + "comment": "Nombre de membres sur la page", + "command": "storeXpathCount", + "target": "xpath=//table[@class=\"list\"]/tbody/tr/th//span", + "targets": [], + "value": "nb_membres_page" + }, { + "id": "c1f7a83d-d1db-45c6-94ac-898a0c39ec5d", + "comment": "", + "command": "end", + "target": "", "targets": [], "value": "" }, { @@ -8052,6 +8115,13 @@ "target": "return ${lesnoms}.at(${i})", "targets": [], "value": "nom" + }, { + "id": "5e629575-fd12-4a40-a1d2-eb982b92c687", + "comment": "Catégorie du membre", + "command": "executeScript", + "target": "return ${lescategories}.at(${i})", + "targets": [], + "value": "categorie" }, { "id": "59bb5518-8ad4-4e7d-ade7-fd959512436b", "comment": "", @@ -8060,10 +8130,10 @@ "targets": [], "value": "" }, { - "id": "f3450d13-d29c-412b-a104-32dfea83af95", + "id": "3f3ae760-b607-44c5-bcc5-e5977b8a34fb", "comment": "", "command": "echo", - "target": "i=${i} ${numero} ${nom}", + "target": "i=${i} ${numero} ${nom} cat=${categorie}", "targets": [], "value": "" }, { @@ -8808,6 +8878,1122 @@ "targets": [], "value": "" }] + }, { + "id": "573e0c0d-763b-4403-9b0a-4685604cabdb", + "name": "4-02 lister membres sauf catégories cachées", + "commands": [{ + "id": "f8c892f4-a03f-421a-8d7c-d0f72cb6fe8d", + "comment": "", + "command": "open", + "target": "http://testpaheko.local.bzh/admin/", + "targets": [], + "value": "" + }, { + "id": "eac4d374-91a2-48a3-803f-e05ddf28b349", + "comment": "Vérifier si déjà connecté", + "command": "storeXpathCount", + "target": "xpath=//button[@name='login']", + "targets": [], + "value": "connecte" + }, { + "id": "2f6ad60d-0fae-4e50-b9e5-705ef672328e", + "comment": "", + "command": "if", + "target": "${connecte} > 0", + "targets": [], + "value": "" + }, { + "id": "1accd95b-b025-4b22-85f5-4ab61437360b", + "comment": "identifiant", + "command": "type", + "target": "id=f_id", + "targets": [], + "value": "jckix@free.fr" + }, { + "id": "c0bdd339-0e81-4603-a20c-77c60c4f8eb3", + "comment": "mot de passe", + "command": "type", + "target": "id=f_password", + "targets": [], + "value": "interpeller noircir colis allumer" + }, { + "id": "90558872-d926-4dd8-a91b-8a7016a4d721", + "comment": "Connexion", + "command": "click", + "target": "name=login", + "targets": [], + "value": "" + }, { + "id": "4e156bda-b170-427e-9071-8a2e05317235", + "comment": "", + "command": "end", + "target": "", + "targets": [], + "value": "" + }, { + "id": "07e01da2-e319-4396-9724-5fd5e25ba649", + "comment": "Menu Membres", + "command": "click", + "target": "xpath=//a[contains(@href, '/admin/users')]", + "targets": [], + "value": "" + }, { + "id": "7d2fe52d-b343-4593-9c6e-204adf81e1eb", + "comment": "", + "command": "storeXpathCount", + "target": "xpath=//nav[@class=\"dropdown\"]//a[contains(@href, \"?cat=\")]", + "targets": [], + "value": "nb_categories" + }, { + "id": "9889bf00-e512-4a3e-9c95-214852edf0c9", + "comment": "Nombre catégories", + "command": "executeScript", + "target": "return ${nb_categories} - 2", + "targets": [], + "value": "nb_categories" + }, { + "id": "d9350003-939f-48a9-8aa0-5572c41db257", + "comment": "", + "command": "echo", + "target": "nb catégories = ${nb_categories}", + "targets": [], + "value": "" + }, { + "id": "99d93dd7-dd3f-4e29-9377-c9726f4e52b3", + "comment": "", + "command": "click", + "target": "xpath=//a[contains(@href, '/admin/users/new.php')]", + "targets": [], + "value": "" + }, { + "id": "e32eeacb-1e33-408c-92a2-0facf4d7c08f", + "comment": "Mémoriser premier numéro disponible", + "command": "storeValue", + "target": "id=f_numero", + "targets": [], + "value": "premier_numero" + }, { + "id": "c1569bd9-e711-49e9-9ec5-895b02e3e1e8", + "comment": "", + "command": "executeScript", + "target": "return Number(${premier_numero})", + "targets": [], + "value": "premierNumero" + }, { + "id": "77358384-2699-40db-a524-761542888efd", + "comment": "", + "command": "echo", + "target": "Premier numéro = ${premierNumero}", + "targets": [], + "value": "" + }, { + "id": "fbff2b7e-b0b9-4cbb-ab21-5cb152b33927", + "comment": "Init liste noms", + "command": "executeScript", + "target": "return []", + "targets": [], + "value": "lesnoms" + }, { + "id": "eb199834-6755-40a0-b56e-f9bb77197e49", + "comment": "Remplir liste des noms", + "command": "executeScript", + "target": "const upper = (str) => { return str.charAt(0).toUpperCase() + str.slice(1);} ; const chaine = (length) => { let chars = 'aàbcdeéèfghijklmnoôpqrstuùvwxyz'; let str = ''; for (let i = 0; i < length; i++) { str += chars.charAt(Math.floor(Math.random() * chars.length));} let debut = upper(str.slice(0, length/2)); let fin = upper(str.slice(length/2)); return debut + ' ' + fin; }; for (let i = 0; i < 7 + Math.floor(Math.random() * 15); ++i) { ${lesnoms} = ${lesnoms}.concat(chaine(12)); } return ${lesnoms};", + "targets": [], + "value": "lesnoms" + }, { + "id": "5d1658e6-c7e4-46ae-8b2d-534edae0f143", + "comment": "Init liste des numéros", + "command": "executeScript", + "target": "return []", + "targets": [], + "value": "lesnumeros" + }, { + "id": "67b0f005-658e-419c-83ad-5f597af23883", + "comment": "Init liste des catégories", + "command": "executeScript", + "target": "return []", + "targets": [], + "value": "lescategories" + }, { + "id": "63d42c55-4d4d-46a4-b259-8078238c7e85", + "comment": "Parcourir liste noms pour ajout dans la base", + "command": "forEach", + "target": "lesnoms", + "targets": [], + "value": "nom" + }, { + "id": "b14e10fc-505c-4a5c-bedd-e5a312c4a518", + "comment": "Menu ajouter", + "command": "click", + "target": "xpath=//a[contains(@href, '/admin/users/new.php')]", + "targets": [ + ["linkText=Ajouter", "linkText"], + ["css=li:nth-child(2) li:nth-child(1) > a", "css:finder"], + ["xpath=//a[contains(text(),'Ajouter')]", "xpath:link"], + ["xpath=//a[contains(@href, '/admin/users/new.php')]", "xpath:href"], + ["xpath=//li/a", "xpath:position"], + ["xpath=//a[contains(.,'Ajouter')]", "xpath:innerText"] + ], + "value": "" + }, { + "id": "173afb60-8aa7-4bf7-a980-66e619be3909", + "comment": "Mémoriser numéro de membre", + "command": "storeValue", + "target": "id=f_numero", + "targets": [], + "value": "numero" + }, { + "id": "5898991c-0294-49dc-a0a5-81c8f2d031e1", + "comment": "Ajouter numéro à la liste", + "command": "executeScript", + "target": "return ${lesnumeros}.concat(${numero})", + "targets": [], + "value": "lesnumeros" + }, { + "id": "f3c177b0-574b-4750-bb5a-daf962fdcb0c", + "comment": "Générer numéro catégorie", + "command": "executeScript", + "target": "return 1 + Math.floor(Math.random() * ${nb_categories})", + "targets": [], + "value": "num_cat" + }, { + "id": "88518dc9-2d13-4f20-b4fd-9557440ab27a", + "comment": "Ajouter catégorie à la liste", + "command": "executeScript", + "target": "return ${lescategories}.concat(${num_cat})", + "targets": [], + "value": "lescategories" + }, { + "id": "de72edb6-a3ad-4c91-9421-227606a91b25", + "comment": "Sélectionner catégorie", + "command": "click", + "target": "xpath=//select[@id=\"f_id_category\"]/option[@value=${num_cat}]", + "targets": [], + "value": "" + }, { + "id": "69459edb-c2dd-4a1c-95a9-bea14d57688c", + "comment": "Saisir le nom", + "command": "type", + "target": "id=f_nom", + "targets": [ + ["id=f_nom", "id"], + ["name=nom", "name"], + ["css=#f_nom", "css:finder"], + ["xpath=//input[@id='f_nom']", "xpath:attributes"], + ["xpath=//dd[3]/input", "xpath:position"] + ], + "value": "${nom}" + }, { + "id": "d660aa7e-8c57-4fe4-81f1-43154ad15c89", + "comment": "Afficher nom catégorie", + "command": "echo", + "target": "Ajout de ${nom}, catégorie = ${num_cat}", + "targets": [], + "value": "" + }, { + "id": "01144e2b-84e0-401f-8328-c71d60fadd6b", + "comment": "Générer courriel", + "command": "executeScript", + "target": "const chaine = (length) => { let chars = 'abcdefghijklmnopqrstuvwxyz0123456789'; let str = ''; for (let i = 0; i < length; i++) { str += chars.charAt(Math.floor(Math.random() * chars.length)); } return str; }; return chaine(8) + \"@ici.fr\"", + "targets": [], + "value": "courriel" + }, { + "id": "90553611-9472-4f7a-bf82-441527af8aee", + "comment": "Saisir courriel", + "command": "type", + "target": "id=f_email", + "targets": [ + ["id=f_email", "id"], + ["name=email", "name"], + ["css=#f_email", "css:finder"], + ["xpath=//input[@id='f_email']", "xpath:attributes"], + ["xpath=//dd[4]/input", "xpath:position"] + ], + "value": "${courriel}" + }, { + "id": "d98fa1ef-445e-4aea-8eda-263440a9b14e", + "comment": "Générer code postal", + "command": "executeScript", + "target": "return Math.random().toString(10).substring(2, 7);", + "targets": [], + "value": "cp" + }, { + "id": "9cabebb6-9ede-48c1-a9bf-3b77ee24695e", + "comment": "Saisir code postal", + "command": "type", + "target": "id=f_code_postal", + "targets": [ + ["id=f_code_postal", "id"], + ["name=code_postal", "name"], + ["css=#f_code_postal", "css:finder"], + ["xpath=//input[@id='f_code_postal']", "xpath:attributes"], + ["xpath=//dd[9]/input", "xpath:position"] + ], + "value": "${cp}" + }, { + "id": "338c874a-a971-445c-81dc-b12e0b5dde7b", + "comment": "Générer numéro de téléphone", + "command": "executeScript", + "target": "return '0' + Math.random().toString(10).substring(2, 11);", + "targets": [], + "value": "tel" + }, { + "id": "f9056eaf-1c12-4949-be6c-1429a9f98487", + "comment": "Saisir numéro de téléphone", + "command": "type", + "target": "id=f_telephone", + "targets": [ + ["id=f_telephone", "id"], + ["name=telephone", "name"], + ["css=#f_telephone", "css:finder"], + ["xpath=//input[@id='f_telephone']", "xpath:attributes"], + ["xpath=//dd[11]/input", "xpath:position"] + ], + "value": "${tel}" + }, { + "id": "baa88081-1c2e-4c6f-9539-c5f573e01e21", + "comment": "Saisir date inscription", + "command": "type", + "target": "id=f_date_inscription", + "targets": [ + ["id=f_date_inscription", "id"], + ["name=date_inscription", "name"], + ["css=#f_date_inscription", "css:finder"], + ["xpath=//input[@id='f_date_inscription']", "xpath:attributes"], + ["xpath=//dd[13]/input", "xpath:position"] + ], + "value": "01/01/2001" + }, { + "id": "a0c78134-eb31-42ad-9705-fd965efa8a3c", + "comment": "essayer de rendre visible le bouton Enregistrer", + "command": "sendKeys", + "target": "id=f_date_inscription", + "targets": [], + "value": "${KEY_TAB}" + }, { + "id": "e3c969ba-7ed9-4db4-bd1a-f53078d989be", + "comment": "essayer de rendre visible le bouton Enregistrer", + "command": "sendKeys", + "target": "xpath=//span[@class=\"datepicker-parent\"]//button", + "targets": [], + "value": "${KEY_TAB}" + }, { + "id": "735fa121-9fad-42c4-86c3-b9601d7c9bf3", + "comment": "Enregistrer les infos", + "command": "click", + "target": "name=save", + "targets": [ + ["name=save", "name"], + ["css=.main", "css:finder"], + ["xpath=//button[@name='save']", "xpath:attributes"], + ["xpath=//p/button", "xpath:position"], + ["xpath=//button[contains(.,'Créer ce membre')]", "xpath:innerText"] + ], + "value": "" + }, { + "id": "e25bc90a-b87b-44ac-b304-9f48520587c0", + "comment": "", + "command": "end", + "target": "", + "targets": [], + "value": "" + }, { + "id": "99a50015-e8fe-4d06-bbd6-8d0392c2bfd6", + "comment": "Menu membres", + "command": "click", + "target": "xpath=//a[contains(@href, '/admin/users')]", + "targets": [], + "value": "" + }, { + "id": "75515b67-31ff-40f6-9256-abe2a2c44cc9", + "comment": "Rendre visibles les options du menu Filtrer", + "command": "executeScript", + "target": "var nav = document.querySelector(\".dropdown\"); var li = nav.querySelectorAll(\"li\"); var nb = li.length; for (const l of li) { l.style.display=\"block\"; } return;", + "targets": [], + "value": "" + }, { + "id": "1ac54b08-91ea-413c-8a05-6fd8d8d3d3e2", + "comment": "Sélectionner les membres non cachés", + "command": "storeText", + "target": "xpath=//a[contains(., \"Toutes, sauf cachées\")]//small", + "targets": [], + "value": "membres_select" + }, { + "id": "be7e6b2c-2f8a-430f-ae31-3eef54680d86", + "comment": "Nombre de membres dans la catégorie", + "command": "executeScript", + "target": "return Number(${membres_select}.split(/ /)[0])", + "targets": [], + "value": "nb_total_membres" + }, { + "id": "28b4800c-582d-434d-812d-23cb396b7686", + "comment": "", + "command": "echo", + "target": "nombre de membres dans la catégorie = ${nb_total_membres}", + "targets": [], + "value": "" + }, { + "id": "3e3d1f19-4588-4ce6-ada4-035a190c9d17", + "comment": "Filtrer : toutes sauf cachées", + "command": "click", + "target": "xpath=//a[contains(., \"Toutes, sauf cachées\")]", + "targets": [], + "value": "" + }, { + "id": "86669cc3-c2db-4ea3-809f-8ea742a784ea", + "comment": "Nombre de membres sur la page", + "command": "storeXpathCount", + "target": "xpath=//table[@class=\"list\"]/tbody/tr/th//span", + "targets": [], + "value": "nb_membres_page" + }, { + "id": "1ee745c6-ce73-4337-b8a5-161c260ef864", + "comment": "", + "command": "echo", + "target": "nombre de membres sur la page = ${nb_membres_page}", + "targets": [], + "value": "" + }, { + "id": "c8a1e837-f163-4b6b-94a4-2944a03924d7", + "comment": "", + "command": "executeScript", + "target": "return 1", + "targets": [], + "value": "num" + }, { + "id": "e866d071-544e-4486-8249-cad011bcfd34", + "comment": "", + "command": "executeScript", + "target": "return 0", + "targets": [], + "value": "i" + }, { + "id": "8a3d42c9-4c65-4865-8550-a8908f540418", + "comment": "Parcourir les membres affichés", + "command": "while", + "target": "${num} <= ${nb_total_membres}", + "targets": [], + "value": "" + }, { + "id": "fbfb1c86-d269-467a-ad24-69599e652464", + "comment": "", + "command": "if", + "target": "${num} > ${nb_membres_page}", + "targets": [], + "value": "" + }, { + "id": "52330878-a1f9-4a52-8038-34fd282b4c29", + "comment": "passer à la page suivante", + "command": "click", + "target": "xpath=//li[@class=\"next\"]", + "targets": [], + "value": "" + }, { + "id": "6138bd34-e8b2-4513-8ffe-57f6b0f72aba", + "comment": "", + "command": "executeScript", + "target": "return ${nb_total_membres} - ${nb_membres_page}", + "targets": [], + "value": "nb_total_membres" + }, { + "id": "5eb9c15f-0b7e-4e60-ac45-7ba260673de7", + "comment": "", + "command": "executeScript", + "target": "return 1", + "targets": [], + "value": "num" + }, { + "id": "02ae1159-56ec-487e-87c4-5167b0948911", + "comment": "Nombre de membres sur la page", + "command": "storeXpathCount", + "target": "xpath=//table[@class=\"list\"]/tbody/tr/th//span", + "targets": [], + "value": "nb_membres_page" + }, { + "id": "d68aba7d-9b37-477b-8dd7-b886759ba60f", + "comment": "", + "command": "end", + "target": "", + "targets": [], + "value": "" + }, { + "id": "67648e53-49cb-4191-b44e-3ec5425bd194", + "comment": "numéro affiché", + "command": "storeText", + "target": "xpath=//table[@class=\"list\"]/tbody/tr[${num}]/td[@class=\"num\"]//span", + "targets": [], + "value": "numeroAffiche" + }, { + "id": "945cda0b-0ea7-4c64-a706-9c4e541176f3", + "comment": "nom affiché", + "command": "storeText", + "target": "xpath=//table[@class=\"list\"]/tbody/tr[${num}]/th//span", + "targets": [], + "value": "nomAffiche" + }, { + "id": "49904774-b9b9-486c-a77e-fe464c9380cb", + "comment": "numéro mémorisé", + "command": "executeScript", + "target": "return ${lesnumeros}.at(${i})", + "targets": [], + "value": "numero" + }, { + "id": "8413395b-f90a-4260-89b7-3936845fd7c4", + "comment": "nom mémorisé", + "command": "executeScript", + "target": "return ${lesnoms}.at(${i})", + "targets": [], + "value": "nom" + }, { + "id": "900ecf1f-95d7-4211-9a0b-ee4821566d1a", + "comment": "Catégorie du membre", + "command": "executeScript", + "target": "return ${lescategories}.at(${i})", + "targets": [], + "value": "categorie" + }, { + "id": "c1cacb08-1d84-4344-a772-f75cfb12b21e", + "comment": "", + "command": "echo", + "target": "n=${num} ${numeroAffiche} ${nomAffiche}", + "targets": [], + "value": "" + }, { + "id": "d3504d02-7f61-4e3d-b182-2aae0ea628ea", + "comment": "", + "command": "echo", + "target": "i=${i} ${numero} ${nom} cat=${categorie}", + "targets": [], + "value": "" + }, { + "id": "1b169576-548a-4f8d-ad64-0873b2579aea", + "comment": "", + "command": "executeScript", + "target": "return Number(${numeroAffiche})", + "targets": [], + "value": "numaff" + }, { + "id": "e40924bc-4efa-4256-972f-98ce9e52faa6", + "comment": "Si c'est un des noms générés", + "command": "if", + "target": "${numaff} >= ${premierNumero}", + "targets": [], + "value": "" + }, { + "id": "44303520-e7d4-459d-bd61-163e7de8801a", + "comment": "Catégorie non cachée ?", + "command": "if", + "target": "${categorie} != 2", + "targets": [], + "value": "" + }, { + "id": "1162c5b9-00bf-4dbc-baaa-6bbd8362cd89", + "comment": "", + "command": "assert", + "target": "numeroAffiche", + "targets": [], + "value": "${numero}" + }, { + "id": "54eef252-fc7e-46f3-9d83-1573dde4c16a", + "comment": "", + "command": "assert", + "target": "nomAffiche", + "targets": [], + "value": "${nom}" + }, { + "id": "2eee5cd9-1219-4d3a-9c47-6a6a647e61a6", + "comment": "", + "command": "executeScript", + "target": "return ${num} + 1", + "targets": [], + "value": "num" + }, { + "id": "34e519d0-02e8-4770-b792-f9e04e74a56f", + "comment": "", + "command": "end", + "target": "", + "targets": [], + "value": "" + }, { + "id": "dc14b87b-4519-45eb-afc8-7e75e9175ef5", + "comment": "", + "command": "executeScript", + "target": "return ${i} +1", + "targets": [], + "value": "i" + }, { + "id": "362f3910-6e80-4f76-9431-21cd2a5c9c0c", + "comment": "", + "command": "else", + "target": "", + "targets": [], + "value": "" + }, { + "id": "e7bb2415-93a8-45c9-bdb4-7aff2f079968", + "comment": "", + "command": "executeScript", + "target": "return ${num} + 1", + "targets": [], + "value": "num" + }, { + "id": "e7af04b9-0d02-4ad6-8c06-8f708fc292b8", + "comment": "", + "command": "end", + "target": "", + "targets": [], + "value": "" + }, { + "id": "361657f6-d4fa-47a0-99ff-7a7ab8f19e95", + "comment": "", + "command": "end", + "target": "", + "targets": [], + "value": "" + }] + }, { + "id": "480c3e63-6791-490d-8867-b46ba24a0751", + "name": "4-01a lister membres plusieurs pages", + "commands": [{ + "id": "484f5367-e267-4e8d-82b0-f20672f193e5", + "comment": "", + "command": "open", + "target": "http://testpaheko.local.bzh/admin/", + "targets": [], + "value": "" + }, { + "id": "20f37b71-dfa1-4f6b-b5da-eddacf4b7287", + "comment": "Vérifier si déjà connecté", + "command": "storeXpathCount", + "target": "xpath=//button[@name='login']", + "targets": [], + "value": "connecte" + }, { + "id": "9bfcefcd-929f-4322-b7c0-2e56e371d7a6", + "comment": "", + "command": "if", + "target": "${connecte} > 0", + "targets": [], + "value": "" + }, { + "id": "4d369259-e799-4be1-803b-8813b4d265f0", + "comment": "identifiant", + "command": "type", + "target": "id=f_id", + "targets": [], + "value": "jckix@free.fr" + }, { + "id": "eae2acac-76f9-478a-bcff-bbf01419b066", + "comment": "mot de passe", + "command": "type", + "target": "id=f_password", + "targets": [], + "value": "interpeller noircir colis allumer" + }, { + "id": "f8f3f0c1-9cb5-4a14-bcb4-a81becfdde6e", + "comment": "Connexion", + "command": "click", + "target": "name=login", + "targets": [], + "value": "" + }, { + "id": "731c2948-f85a-4779-90ff-bb0f7c5e9e9e", + "comment": "", + "command": "end", + "target": "", + "targets": [], + "value": "" + }, { + "id": "6dc6ff4d-18ac-40a8-837a-3157b7895cab", + "comment": "Menu Membres", + "command": "click", + "target": "xpath=//a[contains(@href, '/admin/users')]", + "targets": [], + "value": "" + }, { + "id": "7833f33e-deca-413b-9b1d-ae175c002c62", + "comment": "", + "command": "storeXpathCount", + "target": "xpath=//nav[@class=\"dropdown\"]//a[contains(@href, \"?cat=\")]", + "targets": [], + "value": "nb_categories" + }, { + "id": "65af2eaf-a184-4bd1-9a54-801e405f44a0", + "comment": "Nombre catégories", + "command": "executeScript", + "target": "return ${nb_categories} - 2", + "targets": [], + "value": "nb_categories" + }, { + "id": "32fd07f9-b272-47c5-83ba-63923588da31", + "comment": "", + "command": "echo", + "target": "nb catégories = ${nb_categories}", + "targets": [], + "value": "" + }, { + "id": "724377b5-b3fb-4eaf-b30e-1a3e5e5f3e60", + "comment": "Menu ajouter", + "command": "click", + "target": "xpath=//a[contains(@href, '/admin/users/new.php')]", + "targets": [], + "value": "" + }, { + "id": "f88e95c7-eeca-48b2-984d-040abec1ecd6", + "comment": "Mémoriser premier numéro disponible", + "command": "storeValue", + "target": "id=f_numero", + "targets": [], + "value": "premier_numero" + }, { + "id": "a2ae5fd0-a366-4ba5-8832-919fcbb4b005", + "comment": "", + "command": "executeScript", + "target": "return Number(${premier_numero})", + "targets": [], + "value": "premierNumero" + }, { + "id": "07c1ce65-be6c-4da9-af2e-cbae40c9a842", + "comment": "", + "command": "echo", + "target": "Premier numéro = ${premierNumero}", + "targets": [], + "value": "" + }, { + "id": "b0873587-6c25-41ce-b1b2-6d02180b6bbf", + "comment": "Init liste noms", + "command": "executeScript", + "target": "return []", + "targets": [], + "value": "lesnoms" + }, { + "id": "ce6297ff-d1d1-4acf-a3ff-197191c6b904", + "comment": "Remplir liste des noms", + "command": "executeScript", + "target": "const upper = (str) => { return str.charAt(0).toUpperCase() + str.slice(1);} ; const chaine = (length) => { let chars = 'aàbcdeéèfghijklmnoôpqrstuùvwxyz'; let str = ''; for (let i = 0; i < length; i++) { str += chars.charAt(Math.floor(Math.random() * chars.length));} let debut = upper(str.slice(0, length/2)); let fin = upper(str.slice(length/2)); return debut + ' ' + fin; }; for (let i = 0; i < 200 + Math.floor(Math.random() * 15); ++i) { ${lesnoms} = ${lesnoms}.concat(chaine(12)); } return ${lesnoms};", + "targets": [], + "value": "lesnoms" + }, { + "id": "5b39c0ac-a3a7-4634-93b9-f7c8d9a7e565", + "comment": "Init liste des numéros", + "command": "executeScript", + "target": "return []", + "targets": [], + "value": "lesnumeros" + }, { + "id": "aa13b22a-661b-4bfb-89cd-3c7be92a1b73", + "comment": "Init liste des catégories", + "command": "executeScript", + "target": "return []", + "targets": [], + "value": "lescategories" + }, { + "id": "3ce9bc4a-6756-4151-9e91-d28346129470", + "comment": "Parcourir liste noms pour ajout dans la base", + "command": "forEach", + "target": "lesnoms", + "targets": [], + "value": "nom" + }, { + "id": "79383ca4-7ba0-4aa6-a56b-e27b41324b21", + "comment": "Menu ajouter", + "command": "click", + "target": "xpath=//a[contains(@href, '/admin/users/new.php')]", + "targets": [ + ["linkText=Ajouter", "linkText"], + ["css=li:nth-child(2) li:nth-child(1) > a", "css:finder"], + ["xpath=//a[contains(text(),'Ajouter')]", "xpath:link"], + ["xpath=//a[contains(@href, '/admin/users/new.php')]", "xpath:href"], + ["xpath=//li/a", "xpath:position"], + ["xpath=//a[contains(.,'Ajouter')]", "xpath:innerText"] + ], + "value": "" + }, { + "id": "50d13081-4932-46f0-9a18-8d19bfe841ef", + "comment": "Mémoriser numéro de membre", + "command": "storeValue", + "target": "id=f_numero", + "targets": [], + "value": "numero" + }, { + "id": "afc31b46-bec3-4230-bb60-9950de76026c", + "comment": "Ajouter numéro à la liste", + "command": "executeScript", + "target": "return ${lesnumeros}.concat(${numero})", + "targets": [], + "value": "lesnumeros" + }, { + "id": "31055b79-46c2-4ca8-9afd-c7bfff2070ad", + "comment": "Générer numéro catégorie", + "command": "executeScript", + "target": "return 1 + Math.floor(Math.random() * ${nb_categories})", + "targets": [], + "value": "num_cat" + }, { + "id": "587d762f-11c5-4e32-9e4d-7d2412ebe2af", + "comment": "Ajouter catégorie à la liste", + "command": "executeScript", + "target": "return ${lescategories}.concat(${num_cat})", + "targets": [], + "value": "lescategories" + }, { + "id": "c4ab1d1a-9170-4918-b746-7e4b28a40e04", + "comment": "Sélectionner catégorie", + "command": "click", + "target": "xpath=//select[@id=\"f_id_category\"]/option[@value=${num_cat}]", + "targets": [], + "value": "" + }, { + "id": "20ee3859-d58d-42c5-bb9d-07fca91322a0", + "comment": "Saisir le nom", + "command": "type", + "target": "id=f_nom", + "targets": [ + ["id=f_nom", "id"], + ["name=nom", "name"], + ["css=#f_nom", "css:finder"], + ["xpath=//input[@id='f_nom']", "xpath:attributes"], + ["xpath=//dd[3]/input", "xpath:position"] + ], + "value": "${nom}" + }, { + "id": "8a5e75ee-b0c9-42d7-bc55-321bb17405b1", + "comment": "Afficher nom catégorie", + "command": "echo", + "target": "Ajout de ${nom}, catégorie = ${num_cat}", + "targets": [], + "value": "" + }, { + "id": "cfa0de2f-9bcc-4f94-86c8-83066a02cc77", + "comment": "Générer courriel", + "command": "executeScript", + "target": "const chaine = (length) => { let chars = 'abcdefghijklmnopqrstuvwxyz0123456789'; let str = ''; for (let i = 0; i < length; i++) { str += chars.charAt(Math.floor(Math.random() * chars.length)); } return str; }; return chaine(8) + \"@ici.fr\"", + "targets": [], + "value": "courriel" + }, { + "id": "4b6d4549-121f-4f60-85db-b946b89bb71b", + "comment": "Saisir courriel", + "command": "type", + "target": "id=f_email", + "targets": [ + ["id=f_email", "id"], + ["name=email", "name"], + ["css=#f_email", "css:finder"], + ["xpath=//input[@id='f_email']", "xpath:attributes"], + ["xpath=//dd[4]/input", "xpath:position"] + ], + "value": "${courriel}" + }, { + "id": "e06f4a34-93b9-4d02-99fd-9d9001297acf", + "comment": "Générer code postal", + "command": "executeScript", + "target": "return Math.random().toString(10).substring(2, 7);", + "targets": [], + "value": "cp" + }, { + "id": "1f807df9-f64d-4e99-8ae6-5bae487fd6ad", + "comment": "Saisir code postal", + "command": "type", + "target": "id=f_code_postal", + "targets": [ + ["id=f_code_postal", "id"], + ["name=code_postal", "name"], + ["css=#f_code_postal", "css:finder"], + ["xpath=//input[@id='f_code_postal']", "xpath:attributes"], + ["xpath=//dd[9]/input", "xpath:position"] + ], + "value": "${cp}" + }, { + "id": "186f9188-1f3a-41dc-9513-e4849004c89c", + "comment": "Générer numéro de téléphone", + "command": "executeScript", + "target": "return '0' + Math.random().toString(10).substring(2, 11);", + "targets": [], + "value": "tel" + }, { + "id": "9c9f213c-1d06-442b-acd8-55394bc7f32a", + "comment": "Saisir numéro de téléphone", + "command": "type", + "target": "id=f_telephone", + "targets": [ + ["id=f_telephone", "id"], + ["name=telephone", "name"], + ["css=#f_telephone", "css:finder"], + ["xpath=//input[@id='f_telephone']", "xpath:attributes"], + ["xpath=//dd[11]/input", "xpath:position"] + ], + "value": "${tel}" + }, { + "id": "949414a0-41f7-4e8d-8d46-b619f530db59", + "comment": "Saisir date inscription", + "command": "type", + "target": "id=f_date_inscription", + "targets": [ + ["id=f_date_inscription", "id"], + ["name=date_inscription", "name"], + ["css=#f_date_inscription", "css:finder"], + ["xpath=//input[@id='f_date_inscription']", "xpath:attributes"], + ["xpath=//dd[13]/input", "xpath:position"] + ], + "value": "01/01/2001" + }, { + "id": "743663c1-23eb-4a90-a02e-4e60567b6f55", + "comment": "essayer de rendre visible le bouton Enregistrer", + "command": "sendKeys", + "target": "id=f_date_inscription", + "targets": [], + "value": "${KEY_TAB}" + }, { + "id": "ddbe3f71-239e-46f6-952e-6dfaad9a0edd", + "comment": "essayer de rendre visible le bouton Enregistrer", + "command": "sendKeys", + "target": "xpath=//span[@class=\"datepicker-parent\"]//button", + "targets": [], + "value": "${KEY_TAB}" + }, { + "id": "eb9cc374-781f-446b-988d-c27834c29337", + "comment": "Enregistrer les infos", + "command": "click", + "target": "name=save", + "targets": [ + ["name=save", "name"], + ["css=.main", "css:finder"], + ["xpath=//button[@name='save']", "xpath:attributes"], + ["xpath=//p/button", "xpath:position"], + ["xpath=//button[contains(.,'Créer ce membre')]", "xpath:innerText"] + ], + "value": "" + }, { + "id": "c65aaf26-7956-4644-943f-77af0c3d9a72", + "comment": "", + "command": "end", + "target": "", + "targets": [], + "value": "" + }, { + "id": "9d2d5204-742c-4127-8281-fd1e2e21354e", + "comment": "Menu membres", + "command": "click", + "target": "xpath=//a[contains(@href, '/admin/users')]", + "targets": [], + "value": "" + }, { + "id": "e2309f2f-fd83-4c8f-a9a4-579d07365caf", + "comment": "Rendre visibles les options du menu Filtrer", + "command": "executeScript", + "target": "var nav = document.querySelector(\".dropdown\"); var li = nav.querySelectorAll(\"li\"); var nb = li.length; for (const l of li) { l.style.display=\"block\"; } return;", + "targets": [], + "value": "" + }, { + "id": "3f0f1784-a5b8-4cdd-b4c8-0608b8b533a0", + "comment": "Sélectionner tous les membres", + "command": "storeText", + "target": "xpath=//a[contains(., \"Toutes, même cachées\")]//small", + "targets": [], + "value": "membres_select" + }, { + "id": "c2ce7e39-5e27-4426-b37f-a496ea241f5d", + "comment": "Nombre total de membres", + "command": "executeScript", + "target": "return Number(${membres_select}.split(/ /)[0])", + "targets": [], + "value": "nb_total_membres" + }, { + "id": "b800c180-a85c-48e8-a33e-4a40795a4955", + "comment": "", + "command": "echo", + "target": "nombre total de membres = ${nb_total_membres}", + "targets": [], + "value": "" + }, { + "id": "f5a931f6-9ac2-4a53-9d35-bf1ec2c72c07", + "comment": "Filtrer : toutes même cachées", + "command": "click", + "target": "xpath=//a[contains(., \"Toutes, même cachées\")]", + "targets": [], + "value": "" + }, { + "id": "1fb42d79-11ca-452f-977d-34bb869961ff", + "comment": "Nombre de membres sur la page", + "command": "storeXpathCount", + "target": "xpath=//table[@class=\"list\"]/tbody/tr/th//span", + "targets": [], + "value": "nb_membres_page" + }, { + "id": "de0c8322-63b3-45d5-afcd-02021c60b8f7", + "comment": "", + "command": "echo", + "target": "nombre de membres sur la page = ${nb_membres_page}", + "targets": [], + "value": "" + }, { + "id": "c1ca85d1-dda6-41c2-acbf-3af872b5df09", + "comment": "", + "command": "executeScript", + "target": "return 1", + "targets": [], + "value": "num" + }, { + "id": "f670461b-e46a-48b8-a79f-30a953e8cf43", + "comment": "", + "command": "executeScript", + "target": "return 0", + "targets": [], + "value": "i" + }, { + "id": "10c28ac2-de2b-4e67-b480-01e5557ac6da", + "comment": "Parcourir les membres affichés", + "command": "while", + "target": "${num} <= ${nb_total_membres}", + "targets": [], + "value": "" + }, { + "id": "1dfa5612-f750-4561-bf48-da7b25d651ef", + "comment": "", + "command": "if", + "target": "${num} > ${nb_membres_page}", + "targets": [], + "value": "" + }, { + "id": "32f4da15-2464-4827-8852-57e5e119b247", + "comment": "passer à la page suivante", + "command": "click", + "target": "xpath=//li[@class=\"next\"]", + "targets": [], + "value": "" + }, { + "id": "4a94afe5-62e9-4855-b705-76ead8e5ba99", + "comment": "", + "command": "executeScript", + "target": "return ${nb_total_membres} - ${nb_membres_page}", + "targets": [], + "value": "nb_total_membres" + }, { + "id": "0c6a4b37-1379-43a9-ae3f-8876083239da", + "comment": "", + "command": "executeScript", + "target": "return 1", + "targets": [], + "value": "num" + }, { + "id": "864767ca-99b6-4cc9-bc42-9918e75a27a8", + "comment": "Nombre de membres sur la page", + "command": "storeXpathCount", + "target": "xpath=//table[@class=\"list\"]/tbody/tr/th//span", + "targets": [], + "value": "nb_membres_page" + }, { + "id": "3f96129b-beec-4916-9d45-f285401d4d4b", + "comment": "", + "command": "end", + "target": "", + "targets": [], + "value": "" + }, { + "id": "130d374e-1e70-4e98-b291-8ee7b82de04b", + "comment": "numéro affiché", + "command": "storeText", + "target": "xpath=//table[@class=\"list\"]/tbody/tr[${num}]/td[@class=\"num\"]//span", + "targets": [], + "value": "numeroAffiche" + }, { + "id": "10d4b570-4eae-48e1-bf7b-d076ea15879c", + "comment": "nom affiché", + "command": "storeText", + "target": "xpath=//table[@class=\"list\"]/tbody/tr[${num}]/th//span", + "targets": [], + "value": "nomAffiche" + }, { + "id": "7739c957-333c-4dac-a6b5-2dd8bbe2b9df", + "comment": "numéro mémorisé", + "command": "executeScript", + "target": "return ${lesnumeros}.at(${i})", + "targets": [], + "value": "numero" + }, { + "id": "7571deaa-35be-4023-a287-9443b1d3fb47", + "comment": "nom mémorisé", + "command": "executeScript", + "target": "return ${lesnoms}.at(${i})", + "targets": [], + "value": "nom" + }, { + "id": "0ba0a485-8a25-4e00-8c07-de5d2ad8f7b1", + "comment": "Catégorie du membre", + "command": "executeScript", + "target": "return ${lescategories}.at(${i})", + "targets": [], + "value": "categorie" + }, { + "id": "9ec539d0-90ac-4680-9ce4-bbed5e117d38", + "comment": "", + "command": "echo", + "target": "n=${num} ${numeroAffiche} ${nomAffiche}", + "targets": [], + "value": "" + }, { + "id": "f4694778-6688-4f03-bec6-36eb5263df3f", + "comment": "", + "command": "echo", + "target": "i=${i} ${numero} ${nom} cat=${categorie}", + "targets": [], + "value": "" + }, { + "id": "acae4adc-e716-4433-ac2a-2a8bc0f1f2a5", + "comment": "", + "command": "executeScript", + "target": "return Number(${numeroAffiche})", + "targets": [], + "value": "numaff" + }, { + "id": "bc269120-2512-4af9-a3df-54c93afc762c", + "comment": "Si c'est un des noms générés", + "command": "if", + "target": "${numaff} >= ${premierNumero}", + "targets": [], + "value": "" + }, { + "id": "9269a461-d357-44c9-b408-3a83b4de7364", + "comment": "", + "command": "assert", + "target": "numeroAffiche", + "targets": [], + "value": "${numero}" + }, { + "id": "731178c4-d7db-45cd-9943-90792d51b940", + "comment": "", + "command": "assert", + "target": "nomAffiche", + "targets": [], + "value": "${nom}" + }, { + "id": "fa9438b1-3486-494f-9fcb-ce58ab532796", + "comment": "", + "command": "executeScript", + "target": "return ${i} +1", + "targets": [], + "value": "i" + }, { + "id": "1d8c7503-e229-4cd6-97aa-1a5af0e4feb0", + "comment": "", + "command": "end", + "target": "", + "targets": [], + "value": "" + }, { + "id": "bf9ee5e1-9952-4f95-87ce-ae858db3f870", + "comment": "", + "command": "executeScript", + "target": "return ${num} + 1", + "targets": [], + "value": "num" + }, { + "id": "62870741-be9e-49d6-a1a6-1736b815f281", + "comment": "", + "command": "end", + "target": "", + "targets": [], + "value": "" + }] }], "suites": [{ "id": "6bdd4e16-7197-4388-9a5f-350523eb6c98", @@ -8850,7 +10036,7 @@ "persistSession": false, "parallel": false, "timeout": 300, - "tests": [] + "tests": ["1e422ed1-1291-44bc-beb9-6028a68474e7", "480c3e63-6791-490d-8867-b46ba24a0751", "573e0c0d-763b-4403-9b0a-4685604cabdb"] }, { "id": "f7119734-cb63-4c70-b0d6-6c1ff8281761", "name": "test",