Skip to content

Commit f67e3b3

Browse files
committed
PARAF-166: Updated robotframework tests to include electronic signature
1 parent b9b53cf commit f67e3b3

2 files changed

Lines changed: 177 additions & 6 deletions

File tree

CHANGES.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Changelog
44
3.1.6 (unreleased)
55
------------------
66

7-
- Nothing changed yet.
8-
7+
- Updated robotframework tests to include electronic signature.
8+
[chris-adam]
99

1010
3.1.5 (2026-06-19)
1111
------------------

imio/dms/mail/tests/robot/doc.robot

Lines changed: 175 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Suite Teardown Close all browsers
1414

1515
#${BROWSER} = GoogleChrome
1616
${SELENIUM_RUN_ON_FAILURE} = Debug
17+
# Delay (seconds) added after each Selenium action. Override to watch a run, e.g. -v SELENIUM_SPEED:1.0
18+
${SELENIUM_SPEED} = 0.2
1719

1820
*** Test Cases ***
1921

@@ -194,6 +196,7 @@ CE numerisation
194196
Select from list by value id=form-widgets-original_mail_date-day 6
195197
Select from list by value id=form-widgets-original_mail_date-month 6
196198
Select from list by value id=form-widgets-original_mail_date-year 2012
199+
Select checkbox id=form-widgets-send_modes-0
197200
Capture and crop page screenshot doc/utilisation/2-2-1-edition-courrier-fini.png id=content
198201
Click button id=form-buttons-save
199202
Sleep 2
@@ -324,6 +327,7 @@ CS en réponse
324327
Set field value ${UID} recipient_groups ['${DF}'] list
325328
Set field value ${UID} assigned_user agent str
326329
Set field value ${UID} external_reference_no 2017/ESB/00123 str
330+
Set field value ${UID} send_modes ['post'] list
327331
Go to ${PLONE_URL}/${im_path}/edit
328332
Click button id=form-buttons-save
329333
Fire transition ${UID} propose_to_n_plus_1
@@ -367,7 +371,7 @@ CS en réponse
367371
Sleep 1
368372
Wait until element is visible css=.DV-pageImage 10
369373
Capture and crop page screenshot doc/utilisation/2-3-1-cs-3-ged-genere.png id=content
370-
${note52} Add pointy note css=#fieldset-versions tr.selected td:nth-child(3) Édition externe position=top color=blue
374+
${note52} Add pointy note css=#fieldset-versions tr.selected a.apButtonAction_form_external_edit Édition externe position=top color=blue
371375
Capture and crop page screenshot doc/utilisation/2-3-1-cs-3-ged-edition-externe.png css=#fieldset-versions table ${note52}
372376
Remove element id=${note52}
373377
Delete content /plone/${om_path}/012999900000001
@@ -392,10 +396,10 @@ CS en réponse
392396
Sleep 1
393397
Wait until element is visible css=.DV-pageImage 10
394398
Capture and crop page screenshot doc/utilisation/2-3-1-cs-4-ged-genere-non-pub.png id=content
395-
${note55} Add pointy note css=#fieldset-versions tr.selected td:nth-child(6) Publipostage position=top color=blue
399+
${note55} Add pointy note css=#fieldset-versions tr.selected a.apButtonAction_form_mailing Publipostage position=top color=blue
396400
Capture and crop page screenshot doc/utilisation/2-3-1-cs-4-ged-publipostage.png css=#fieldset-versions table ${note55}
397401
Remove element id=${note55}
398-
Click element css=#fieldset-versions tr.selected td:nth-child(6)
402+
Click element css=#fieldset-versions tr.selected a.apButtonAction_form_mailing
399403
Sleep 5
400404
Go to ${PLONE_URL}/${om_path}
401405
Sleep 1
@@ -1379,6 +1383,138 @@ Annexes dossiers
13791383
Go to ${PLONE_URL}/folders/
13801384
Click Element css:.pretty_link_content.state-active
13811385

1386+
Signature écrite
1387+
# partie 2.13.1 Mise à la signature manuscrite
1388+
[TAGS] RUN2131
1389+
Enable autologin as encodeur
1390+
Show connected user Jean Encodeur (service encodeur) 2-13-1-user-encodeur.png
1391+
${om_path} = Add outgoing mail for signing Décision de voirie à signer manuellement
1392+
${UID} = Path to uid /${PLONE_SITE_ID}/${om_path}
1393+
# Signataires : préremplis par les règles de signature (configuration administrateur) :
1394+
# Directeur Général (utilisateur "dirg") et Bourgmestre, tous deux SANS approbation et SANS
1395+
# signature électronique.
1396+
Wait until element is visible css=#viewlet-below-content-body table.actionspanel-no-style-table 10
1397+
Wait until element is visible id=form-groups-signing 10
1398+
${note1} Add pointy note id=formfield-form-widgets-ISigningBehavior-signers Signataires (sans approbation) position=top color=blue
1399+
Capture and crop page screenshot doc/utilisation/2-13-1-signataires.png id=form-groups-signing ${note1}
1400+
Remove element id=${note1}
1401+
${note2} Add pointy note id=formfield-form-widgets-ISigningBehavior-esign Signature électronique désactivée position=top color=blue
1402+
Capture and crop page screenshot doc/utilisation/2-13-1-signature-electronique-off.png id=form-groups-signing ${note2}
1403+
Remove element id=${note2}
1404+
# Génération d'un fichier ged depuis un modèle
1405+
Capture and crop page screenshot doc/utilisation/2-13-1-generation-modele.png css=#parent-fieldname-title span.pretty_link_content
1406+
${TPL} = Path to uid /${PLONE_SITE_ID}/templates/om/main
1407+
Go to ${PLONE_URL}/${om_path}/persistent-document-generation?template_uid=${TPL}&output_format=odt
1408+
Sleep 2
1409+
Go to ${PLONE_URL}/${om_path}
1410+
Sleep 1
1411+
Wait until element is visible css=.DV-pageImage 10
1412+
Capture and crop page screenshot doc/utilisation/2-13-1-courrier-genere.png id=content
1413+
# Mise à la signature manuscrite (état "to_be_signed").
1414+
# created -> to_be_validated (encodeur) -> to_be_signed (chef)
1415+
Fire transition ${UID} propose_to_n_plus_1
1416+
Enable autologin as chef
1417+
Fire transition ${UID} propose_to_be_signed
1418+
Go to ${PLONE_URL}/${om_path}
1419+
Sleep 0.5
1420+
Wait until element is visible css=.DV-pageImage 10
1421+
Show connected user Michel Chef (responsable de service, n+1) 2-13-1-user-chef.png
1422+
Capture and crop page screenshot doc/utilisation/2-13-1-a-la-signature.png css=div.viewlet_workflowstate css=table.actionspanel-no-style-table
1423+
# Scan step not automatable in RF: auto-transition to sent requires physical scan.
1424+
${note4} Add pointy note css=div.viewlet_workflowstate Numérisation du document signé (scan papier) puis envoi position=bottom color=blue
1425+
Capture and crop page screenshot doc/utilisation/2-13-1-etape-numerisation.png css=div.viewlet_workflowstate ${note4}
1426+
Remove element id=${note4}
1427+
1428+
Signature électronique
1429+
# partie 2.13.2 Mise à l'approbation et signature électronique
1430+
[TAGS] RUN2132
1431+
Enable autologin as encodeur
1432+
Show connected user Jean Encodeur (service encodeur) 2-13-2-user-encodeur.png
1433+
${om_path} = Add outgoing mail for signing Décision de voirie à signer electroniquement
1434+
${UID} = Path to uid /${PLONE_SITE_ID}/${om_path}
1435+
# Édition du panneau de signature. Les signataires (Directeur Général + Bourgmestre) ont été
1436+
# préremplis par la configuration administrateur (règles de signature).
1437+
Wait until element is visible css=#viewlet-below-content-body table.actionspanel-no-style-table 10
1438+
# Clic sur l'icône d'édition présente dans la légende du fieldset "Signature"
1439+
Wait until element is visible css=#form-groups-signing legend a[href*='/edit#fieldsetlegend-signing'] 10
1440+
${note_edit} Add pointy note css=#form-groups-signing legend a[href*='/edit#fieldsetlegend-signing'] Icône d'édition du panneau de signature position=top color=blue
1441+
Capture and crop page screenshot doc/utilisation/2-13-2-icone-edition-signature.png id=form-groups-signing ${note_edit}
1442+
Remove element id=${note_edit}
1443+
Click element css=#form-groups-signing legend a[href*='/edit#fieldsetlegend-signing']
1444+
Sleep 0.5
1445+
Wait until element is visible id=fieldsetlegend-signing 10
1446+
Click element id=fieldsetlegend-signing
1447+
Sleep 0.5
1448+
${note0} Add pointy note id=formfield-form-widgets-ISigningBehavior-signers Signataires préremplis par la configuration position=top color=blue
1449+
Capture and crop page screenshot doc/utilisation/2-13-2-signataires-preremplis.png id=fieldset-signing ${note0}
1450+
Remove element id=${note0}
1451+
# Approbation par lui-même pour chaque signataire (on décoche "Aucune approbation", on coche "Lui-même")
1452+
Unselect checkbox id=form-widgets-ISigningBehavior-signers-0-widgets-approvings-0
1453+
Select checkbox id=form-widgets-ISigningBehavior-signers-0-widgets-approvings-1
1454+
Unselect checkbox id=form-widgets-ISigningBehavior-signers-1-widgets-approvings-0
1455+
Select checkbox id=form-widgets-ISigningBehavior-signers-1-widgets-approvings-1
1456+
${note1} Add pointy note id=formfield-form-widgets-ISigningBehavior-signers Approbation activée pour chaque signataire position=top color=blue
1457+
Capture and crop page screenshot doc/utilisation/2-13-2-approbation.png id=fieldset-signing ${note1}
1458+
Remove element id=${note1}
1459+
Select checkbox id=form-widgets-ISigningBehavior-esign-0
1460+
${note2} Add pointy note id=formfield-form-widgets-ISigningBehavior-esign Signature électronique activée position=top color=blue
1461+
Capture and crop page screenshot doc/utilisation/2-13-2-signature-electronique-on.png id=fieldset-signing ${note2}
1462+
Remove element id=${note2}
1463+
Click button id=form-buttons-save
1464+
Wait until element is visible css=#viewlet-below-content-body table.actionspanel-no-style-table 10
1465+
${TPL} = Path to uid /${PLONE_SITE_ID}/templates/om/main
1466+
Go to ${PLONE_URL}/${om_path}/persistent-document-generation?template_uid=${TPL}&output_format=odt
1467+
Sleep 2
1468+
# Mise à l'approbation : proposition au n+1 (par l'encodeur) puis passage à l'approbation (par le chef, n+1).
1469+
Fire transition ${UID} propose_to_n_plus_1
1470+
Enable autologin as chef
1471+
Fire transition ${UID} propose_to_approve
1472+
Go to ${PLONE_URL}/${om_path}
1473+
Sleep 0.5
1474+
Wait until element is visible css=.DV-pageImage 10
1475+
Show connected user Michel Chef (responsable de service, n+1) 2-13-2-user-chef.png
1476+
Capture and crop page screenshot doc/utilisation/2-13-2-a-approuver.png css=div.viewlet_workflowstate id=fieldset-versions
1477+
# Approbation par le premier approbateur (Directeur Général / dirg)
1478+
Enable autologin as dirg
1479+
Go to ${PLONE_URL}/${om_path}
1480+
Sleep 0.5
1481+
Wait until element is visible css=#fieldset-versions td.iconified-approved a.iconified-action.editable 10
1482+
Show connected user Maxime DG (Directeur Général, 1er approbateur) 2-13-2-user-dirg.png
1483+
${note3} Add pointy note css=#fieldset-versions td.iconified-approved a.iconified-action.editable Icône d'approbation position=top color=blue
1484+
Capture and crop page screenshot doc/utilisation/2-13-2-icone-approbation.png id=fieldset-versions ${note3}
1485+
Remove element id=${note3}
1486+
Click element css=#fieldset-versions td.iconified-approved a.iconified-action.editable
1487+
Sleep 1
1488+
# Approbation par le second approbateur (Bourgmestre)
1489+
Enable autologin as bourgmestre
1490+
Go to ${PLONE_URL}/${om_path}
1491+
Sleep 0.5
1492+
Wait until element is visible css=#fieldset-versions td.iconified-approved a.iconified-action.editable 10
1493+
Show connected user Paul BM (Bourgmestre, 2e approbateur) 2-13-2-user-bourgmestre.png
1494+
Click element css=#fieldset-versions td.iconified-approved a.iconified-action.editable
1495+
Sleep 1
1496+
# Une session eSign a été créée à l'état "En création" ; le courrier passe automatiquement à la signature
1497+
Enable autologin as Manager
1498+
Set autologin username dirg
1499+
Go to ${PLONE_URL}/${om_path}
1500+
Sleep 0.5
1501+
Wait until element is visible css=span.state-title-draft 10
1502+
Show connected user Gestionnaire de signatures 2-13-2-user-gestionnaire.png
1503+
${note4} Add pointy note css=span.state-title-draft Session eSign en cours de création position=bottom color=blue
1504+
Capture and crop page screenshot doc/utilisation/2-13-2-session-en-creation.png id=session-info ${note4}
1505+
Remove element id=${note4}
1506+
# Onglet Paraphéo
1507+
Wait until element is visible id=portaltab-parapheo 10
1508+
${note5} Add pointy note id=portaltab-parapheo Onglet Paraphéo position=bottom color=blue
1509+
Capture and crop page screenshot doc/utilisation/2-13-2-onglet-parapheo.png id=portal-globalnav ${note5}
1510+
Remove element id=${note5}
1511+
Click element id=portaltab-parapheo
1512+
Wait until element is visible css=img[onclick*="external-esign-session-create"] 10
1513+
${note6} Add pointy note css=img[onclick*="external-esign-session-create"] Bouton de création de session externe position=left color=blue
1514+
Capture and crop page screenshot doc/utilisation/2-13-2-creation-session-externe.png id=content ${note6}
1515+
Sleep 0.5
1516+
Remove element id=${note6}
1517+
13821518
Debug
13831519
[TAGS] DBG
13841520
Pass execution Only for debug purpose
@@ -1398,9 +1534,44 @@ Suite Setup
13981534
Set Window Size 1200 1920
13991535
Set Suite Variable ${CROP_MARGIN} 5
14001536
Set Selenium Implicit Wait 2
1401-
Set Selenium Speed 0.2
1537+
Set Selenium Speed ${SELENIUM_SPEED}
14021538
Enable autologin as Manager
14031539
Set autologin username dirg
14041540
Go to ${PLONE_URL}/robot_init
1541+
Apply profile step imio.dms.mail:singles imiodmsmail-activate-esigning
14051542
Disable autologin
14061543
# Pause
1544+
1545+
Show connected user
1546+
[Documentation] Display a top banner naming the currently connected user (so a video viewer
1547+
... always knows who is acting), capture a screenshot, then remove the banner.
1548+
[Arguments] ${name} ${shot}
1549+
${unote} Add main note Connecté en tant que : ${name}
1550+
Capture and crop page screenshot doc/utilisation/${shot} id=portal-top ${unote}
1551+
Remove element id=${unote}
1552+
1553+
Add outgoing mail for signing
1554+
[Documentation] Create an outgoing mail (as the current user) filling every required field
1555+
... (title, recipients, send_modes via UI ; treating_groups and sender).
1556+
... Returns the mail relative path.
1557+
[Arguments] ${title}
1558+
Go to ${PLONE_URL}/outgoing-mail
1559+
Wait until element is visible newOMCreation 10
1560+
Click element newOMCreation
1561+
Wait until element is visible css=.template-dmsoutgoingmail #formfield-form-widgets-sender 10
1562+
Sleep 0.5
1563+
Create content type=person container=/${PLONE_SITE_ID}/contacts firstname=Dale lastname=Cooper zip_code=4000 city=Belleville street=Rue Moyenne number=1991 email=dale.cooper@twinpeaks.com
1564+
Input text name=form.widgets.IDublinCore.title ${title}
1565+
Input text name=form.widgets.recipients.widgets.query cooper
1566+
Wait until element is visible css=.ac_results:not([style*="display: none"]) 10
1567+
Click element css=.ac_results:not([style*="display: none"]) li
1568+
Select checkbox id=form-widgets-send_modes-0
1569+
Click button id=form-buttons-save
1570+
Wait until element is visible css=#viewlet-below-content-body table.actionspanel-no-style-table 10
1571+
${om_path} = Get mail path ptype=dmsoutgoingmail title=${title}
1572+
${UID} = Path to uid /${PLONE_SITE_ID}/${om_path}
1573+
${TG} = Path to uid /${PLONE_SITE_ID}/contacts/plonegroup-organization/direction-generale/grh
1574+
Set field value ${UID} treating_groups ${TG} str
1575+
${SENDER} = Path to uid /${PLONE_SITE_ID}/contacts/personnel-folder/agent/agent-grh
1576+
Set field value ${UID} sender ${SENDER} str
1577+
[Return] ${om_path}

0 commit comments

Comments
 (0)