| 194 | david | 1 | # Scenario nominal : saisie observation avec completion commune et espece, tous champs renseignes
 | 
        
           |  |  | 2 |   | 
        
           |  |  | 3 | # Necessite xdotool >= 20090815 (commande delay)
 | 
        
           |  |  | 4 |   | 
        
           |  |  | 5 | # Todo : en faire une brique pour inclusion dans autres scenario
 | 
        
           |  |  | 6 |   | 
        
           |  |  | 7 | # Lancement Cel
 | 
        
           |  |  | 8 | firefox http://localhost/cel/www/org.tela_botanica.cel2/cel2.html
 | 
        
           |  |  | 9 | sleep 4
 | 
        
           |  |  | 10 |   | 
        
           |  |  | 11 | # Timestamps
 | 
        
           |  |  | 12 |   | 
        
           |  |  | 13 | obsid=`date +%s`
 | 
        
           |  |  | 14 |   | 
        
           |  |  | 15 | # Init
 | 
        
           |  |  | 16 | CWID=`xdotool getwindowfocus`
 | 
        
           |  |  | 17 | WID=`xdotool search "Mozilla Firefox" | head -1`
 | 
        
           |  |  | 18 | xdotool windowfocus $WID
 | 
        
           |  |  | 19 | sleep 1
 | 
        
           |  |  | 20 |   | 
        
           |  |  | 21 | # Saisie Commune : Montpellier + completion
 | 
        
           |  |  | 22 | xdotool key "shift+alt+1"
 | 
        
           |  |  | 23 | xdotool type --delay 100 "montpell"
 | 
        
           |  |  | 24 | sleep 1
 | 
        
           |  |  | 25 | xdotool key "Return"
 | 
        
           |  |  | 26 |   | 
        
           |  |  | 27 | # Saisie Lieu dit
 | 
        
           |  |  | 28 | xdotool key "Tab"
 | 
        
           |  |  | 29 | xdotool type --delay 100 "Jardin des plantes " $obsid
 | 
        
           |  |  | 30 |   | 
        
           |  |  | 31 | # Saisie Station
 | 
        
           |  |  | 32 | xdotool key "Tab"
 | 
        
           |  |  | 33 | xdotool type --delay 100 "Bord de la mare"
 | 
        
           |  |  | 34 |   | 
        
           |  |  | 35 | # Saisie Milieu
 | 
        
           |  |  | 36 | xdotool key "Tab"
 | 
        
           |  |  | 37 | xdotool type --delay 100 "Pelouse"
 | 
        
           |  |  | 38 |   | 
        
           |  |  | 39 | # Saisie Date
 | 
        
           |  |  | 40 | xdotool key "Tab"
 | 
        
           |  |  | 41 | xdotool type --delay 100 "10/10/2009"
 | 
        
           |  |  | 42 |   | 
        
           |  |  | 43 | # Saisie Espece : Acer monspessulanum
 | 
        
           |  |  | 44 | xdotool key "Tab"
 | 
        
           |  |  | 45 | xdotool type --delay 100 "Acer monspes"
 | 
        
           |  |  | 46 | sleep 1
 | 
        
           |  |  | 47 | xdotool key "Return"
 | 
        
           |  |  | 48 |   | 
        
           |  |  | 49 | # Saisie note
 | 
        
           |  |  | 50 | xdotool key "Tab"
 | 
        
           |  |  | 51 | xdotool type --delay 100 "Test"
 | 
        
           |  |  | 52 |   | 
        
           |  |  | 53 | # Validation
 | 
        
           |  |  | 54 |   | 
        
           |  |  | 55 | xdotool key "Tab"
 | 
        
           |  |  | 56 | xdotool key "Return"
 | 
        
           |  |  | 57 |   | 
        
           |  |  | 58 |   | 
        
           |  |  | 59 | # Controle insertion
 | 
        
           |  |  | 60 |   | 
        
           |  |  | 61 | xdotool windowfocus $CWID
 | 
        
           |  |  | 62 | sleep 1
 | 
        
           |  |  | 63 |   | 
        
           |  |  | 64 | /opt/lampp/bin/mysql -u root cel --execute="select * from cel_inventory  where lieudit like '%$obsid%' ;"
 | 
        
           |  |  | 65 |   |