Automatisierte Syntaxtests, Framework für spätere Modultests.
[kivitendo-erp.git] / t / old / selenium / testscripts / administration / begin / A003UpdateDatabase.t
1 ### Update Database
2 if(!defined $sel) {
3   require "t/selenium/AllTests.t";
4   init_server("singlefileonly", $0);
5   exit(0);
6 }
7
8 # NOTEST: some preruns for initializing missing parameters
9 $sel->open($lxtest->{lxadmin});
10
11 $sel->click("//input[(\@name=\"action\") and (\@value=\"Datenbankadministration\")]");
12 $sel->wait_for_page_to_load($lxtest->{timeout});
13 $sel->type("dbuser", $lxtest->{dbuser});
14 $sel->type("dbpasswd", $lxtest->{dbpasswd});
15 $sel->type("dbuser", $lxtest->{dbuser});
16 $sel->type("dbhost", $lxtest->{dbhost});
17 $sel->type("dbport", $lxtest->{dbport});
18 $sel->type("dbdefault", $lxtest->{dbdefault});
19 $sel->click("//input[(\@name=\"action\") and (\@value=\"Datenbank aktualisieren\")]");
20 $sel->wait_for_page_to_load($lxtest->{timeoutlong});
21 $sel->title_is("Lx-Office ERP Datenbankadministration / Datenbank aktualisieren -");
22
23 my $count =0;
24
25 while (){ # count the number of radiobuttons
26   eval {  $sel->is_checked("//input[(\@id=\"$count\")]"); };
27     if ( $@ ) { $count--; last; }; 
28   $count++;
29 }
30
31 #TEST: Now run the Tests
32
33 $sel->open_ok($lxtest->{lxadmin});
34 $sel->title_is("Lx-Office ERP Administration -");
35
36 #diag('Lock the system');
37 #$sel->click_ok("//input[(\@name=\"action\") and (\@value=\"System sperren\")]");
38 #$sel->wait_for_page_to_load_ok($lxtest->{timeout});
39
40 diag('Update the database');
41
42 $sel->click_ok("//input[(\@name=\"action\") and (\@value=\"Datenbankadministration\")]");
43 $sel->wait_for_page_to_load_ok($lxtest->{timeout});
44 $sel->title_is("Lx-Office ERP / Datenbankadministration -");
45 $sel->type_ok("dbuser", $lxtest->{dbuser});
46 $sel->type_ok("dbpasswd", $lxtest->{dbpasswd});
47 $sel->type_ok("dbuser", $lxtest->{dbuser});
48 $sel->type_ok("dbhost", $lxtest->{dbhost});
49 $sel->type_ok("dbport", $lxtest->{dbport});
50 $sel->type_ok("dbdefault", $lxtest->{dbdefault});
51 $sel->click_ok("//input[(\@name=\"action\") and (\@value=\"Datenbank aktualisieren\")]");
52 $sel->wait_for_page_to_load_ok($lxtest->{timeoutlong});
53 $sel->title_is("Lx-Office ERP Datenbankadministration / Datenbank aktualisieren -");
54
55 for (my $i=0; $i <= $count; $i++){
56   $sel->uncheck_ok("//input[(\@id=\"$i\")]");
57 }
58
59 #$sel->click_ok("//input[\@value=\"$lxtest->{db}\"]");
60 #$sel->check_ok("//input[\@name=\"db$lxtest->{db}\"]");
61 $sel->click_ok("//input[(\@name=\"action\") and (\@value=\"Weiter\")]");
62 $sel->title_like( qr/Lx-Office ERP Datenbankadministration/ );
63
64 #diag('Unlock the system');
65 #$sel->click_ok("//input[(\@name=\"action\") and (\@value=\"System entsperren\")]");
66 #$sel->wait_for_page_to_load_ok($lxtest->{timeout});
67 #$sel->title_is("Lx-Office ERP Administration -");
68 1;