4d745b87bbbc58282b2d85735247837447223164
[kivitendo-erp.git] / t / selenium / testscripts / system / begin / S003AddLanguage.t
1 if(!defined $sel) {
2   require "t/selenium/AllTests.t";
3   init_server("singlefileonly",$0);
4   exit(0);
5 }
6 diag("Add languages");
7 SKIP: {
8   start_login();
9   
10   $sel->click_ok("link=Sprache hinzufügen");
11   $sel->wait_for_page_to_load($lxtest->{timeout});
12   $sel->select_frame_ok("main_window");
13   $sel->type_ok("description", "elbisch");
14   $sel->type_ok("template_code", "elb");
15   $sel->type_ok("article_code", "elb");
16   $sel->select_ok("output_numberformat", "label=1.000,00");
17   $sel->select_ok("output_dateformat", "label=yyyy-mm-dd");
18   $sel->click_ok("action");
19   $sel->wait_for_page_to_load($lxtest->{timeout});
20   
21   ### Folgende Zeilen sind notwendig , um später herausfinden zu können, welche Sprache gelöscht werden kann.
22   use DBI;
23   $lxtest->{dsn} = 'dbi:Pg:dbname=' . $lxtest->{db} . ';host=' . $lxtest->{dbhost} . ';port=' . $lxtest->{dbport};
24   my $dbh = DBI->connect( $lxtest->{dsn}, $lxtest->{dbuser}, $lxtest->{dbpasswd} ) or die "Cannot connect to database!\n $DBI::errstr";
25   my $sth = $dbh->prepare("SELECT id FROM language WHERE description ILIKE 'elbisch'") or die "Error while preparing sql statement!\n $DBI::errstr\n";
26   $sth->execute() or die "Error while excecuting sql statement!\n $DBI::errstr";
27   $lxtest->{lang_id} = $sth->fetchrow_array() or die "Nothing to fetch!\n$DBI::errstr";
28   $sth->finish();
29   $dbh->disconnect();
30 };
31 1;