add OCR
[os-autoinst:os-autoinst.git] / inst / kde.pm
1 #!/usr/bin/perl -w
2 use strict;
3 use bmwqemu;
4
5 # wait until ready
6 waitinststage "KDE", 1000;
7 waitidle 100;
8 sleep 10;
9
10 my $lastmenu=0;
11 # open KDE menu
12 sub open_menu($;$)
13 { my $n=shift; my $wait=shift;
14         sendkey "alt-f1";
15         waitidle;
16         my $diff=$n-$lastmenu;
17         $lastmenu=$n;
18         if($diff<0) {
19                 for(1..-$diff) {
20                         sendkey "up";
21                 }
22         }
23         if($diff>0) {
24                 for(1..$diff) {
25                         sendkey "down";
26                 }
27         }
28         sleep 1;
29         sendkey "ret";
30         waitidle $wait;
31         sleep 4;
32 }
33
34 my %kdemenu=(firefox=>1, pim=>2, office=>3, audio=>4, fileman=>5, config=>6, help=>7, xterm=>8);
35
36 if($ENV{NETBOOT}) { # has photomanager added on #5
37         for my $x (qw(fileman config help xterm)) {
38                 $kdemenu{$x}++;
39         }
40 }
41
42 open_menu($kdemenu{xterm});
43 sendautotype "sudo /sbin/yast2 lan\n$password\n";
44 sleep 12;
45 sendkey "alt-f4";
46 open_menu($kdemenu{firefox});
47 sendkey "alt-f4"; sleep 2;
48 sendkey "ret"; # confirm "save&quit"
49
50 open_menu($kdemenu{office});
51 sendkey "alt-f4";
52
53 open_menu($kdemenu{help});
54 sendkey "alt-f4";
55
56 open_menu($kdemenu{config});
57 sendkey "alt-f4";
58
59 open_menu($kdemenu{fileman});
60 sendkey "alt-f4";
61
62 open_menu($kdemenu{audio});
63 sendkey "alt-f4"; sleep 3; # mp3 popup
64 sendkey "alt-f4"; sleep 3; # close kwallet popup
65 sendkey "alt-f4"; sleep 9; # close another popup
66 sendkey "ctrl-q"; # really quit. alt-f4 just backgrounds
67
68 open_menu($kdemenu{pim}, 100);
69 sleep 10; waitidle 100; sleep 10; # pim needs extra time for first init
70 sendkey "alt-f4"; sleep 10; # close popup (tips on startup)
71 sendkey "alt-f4";
72
73 sleep 9;
74 sendkey "ctrl-alt-delete"; # reboot
75 sleep 4;
76 sendautotype "\t\t\n";
77
78 waitinststage "grub", 200; # wait until reboot 
79 waitinststage "KDE", 200; # wait until reboot is finished
80 waitidle 100;
81 sleep 19;
82 sendkey "ctrl-alt-delete"; # shutdown
83 sleep 11;
84 sendautotype "\t\n";
85
86 1;