From d4d655d8b94ef454fd2aa54debce2a9ffa19199c Mon Sep 17 00:00:00 2001 From: Thomas Kasulke Date: Wed, 5 Sep 2007 11:49:17 +0000 Subject: [PATCH] =?utf8?q?Hinzuf=C3=BCgen=20der=20globalen=20Testscripte,?= =?utf8?q?=20welche=20die=20einzelnene=20Test=20koordienieren=20und=20aufr?= =?utf8?q?ufen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- t/lx-office.t | 4 +++- t/selenium/AllTests.t | 14 +++++++++++--- t/selenium/TestAccounting.t | 5 +++++ t/selenium/TestAdmin.t | 5 +++++ t/selenium/TestAllTests.t | 8 ++++++++ t/selenium/TestCreateTestbed.t | 8 ++++++++ t/selenium/TestMasterData.t | 5 +++++ t/selenium/TestPayments.t | 5 +++++ t/selenium/TestPrinting.t | 5 +++++ t/selenium/TestProgramm.t | 5 +++++ t/selenium/TestPurchase.t | 5 +++++ t/selenium/TestSelling.t | 5 +++++ t/selenium/TestSystem.t | 5 +++++ t/selenium/testscripts/base/000Login.t | 2 +- t/selenium/testscripts/base/999Logout.t | 1 + 15 files changed, 77 insertions(+), 5 deletions(-) create mode 100644 t/selenium/TestAccounting.t create mode 100644 t/selenium/TestAdmin.t create mode 100644 t/selenium/TestAllTests.t create mode 100644 t/selenium/TestCreateTestbed.t create mode 100644 t/selenium/TestMasterData.t create mode 100644 t/selenium/TestPayments.t create mode 100644 t/selenium/TestPrinting.t create mode 100644 t/selenium/TestProgramm.t create mode 100644 t/selenium/TestPurchase.t create mode 100644 t/selenium/TestSelling.t create mode 100644 t/selenium/TestSystem.t diff --git a/t/lx-office.t b/t/lx-office.t index 0b583e1c3..ee52ab5c0 100644 --- a/t/lx-office.t +++ b/t/lx-office.t @@ -34,7 +34,7 @@ use diagnostics; use Carp; use Test::Harness; - + my %tests = ("all" => 't/selenium/TestAllTests.t', "system" => 't/selenium/TestSystem.t', "selling" => 't/selenium/TestSelling.t', @@ -176,4 +176,6 @@ printf "\n\t\%s\n\t%s\n","Be ensure, that usage is promitted by login and db status!","\xAF" x 58; } unlink("/tmp/lxtest-temp.conf"); + + exit 1; \ No newline at end of file diff --git a/t/selenium/AllTests.t b/t/selenium/AllTests.t index 8a1a13e39..c5ebf1d19 100644 --- a/t/selenium/AllTests.t +++ b/t/selenium/AllTests.t @@ -61,7 +61,7 @@ # plan tests => 200; # Need to be cutomized # } sub init_server { - our $singlefileonly = 0; + my $singlefileonly = 0; if ($_[0] eq "singlefileonly") { $singlefileonly = 1; shift; @@ -117,13 +117,21 @@ foreach my $scriptdir (@_) { opendir(SCRIPTS, 't/selenium/testscripts/' . $scriptdir) or die "Can't open directory!" . $!; foreach (sort readdir(SCRIPTS)) { - require_ok("t/selenium/testscripts/". $scriptdir . "/" . $_) if ( $_ =~ /^\w\d\d\d.*\.t$/); + if ( $_ =~ /^\w\d\d\d.*\.t$|^\d\d\d.*\.t$/ && !$sel->{ran_tests}{"t/selenium/testscripts/". $scriptdir . "/" . $_}) { + require_ok("t/selenium/testscripts/". $scriptdir . "/" . $_); + $sel->{ran_tests}{"t/selenium/testscripts/". $scriptdir . "/" . $_} = 1; + } } closedir(SCRIPTS); } } else { - foreach (@_) { require_ok($_); } + foreach (@_) { + if ( $_ =~ /^.*\/\w\d\d\d.*\.t$|^.*\/\d\d\d.*\.t$/ && !$sel->{ran_tests}{$_}) { + require_ok($_); + $sel->{ran_tests}{$_} = 1; + } + } } if($!) { @! = ("Test fehlgeschlagen!"); diff --git a/t/selenium/TestAccounting.t b/t/selenium/TestAccounting.t new file mode 100644 index 000000000..ea1ebd343 --- /dev/null +++ b/t/selenium/TestAccounting.t @@ -0,0 +1,5 @@ +require "t/selenium/AllTests.t"; + +init_server("accounting/begin", "accounting/end"); + +1; \ No newline at end of file diff --git a/t/selenium/TestAdmin.t b/t/selenium/TestAdmin.t new file mode 100644 index 000000000..130f6cc04 --- /dev/null +++ b/t/selenium/TestAdmin.t @@ -0,0 +1,5 @@ +require "t/selenium/AllTests.t"; + +init_server("administration/begin", "administration/end"); + +1; \ No newline at end of file diff --git a/t/selenium/TestAllTests.t b/t/selenium/TestAllTests.t new file mode 100644 index 000000000..442563820 --- /dev/null +++ b/t/selenium/TestAllTests.t @@ -0,0 +1,8 @@ +require "t/selenium/AllTests.t"; + +init_server("administration/begin", "system/begin", "masterdata/begin", "selling/begin", "purchase/begin", + "accounting/begin", "payments/begin", "reports/begin", "programm/begin", + "programm/end", "reports/end", "payments/end", "accounting/end", "purchase/end", "selling/end", + "masterdata/end", "system/end", "administration/end"); + +1; \ No newline at end of file diff --git a/t/selenium/TestCreateTestbed.t b/t/selenium/TestCreateTestbed.t new file mode 100644 index 000000000..012ce9bdf --- /dev/null +++ b/t/selenium/TestCreateTestbed.t @@ -0,0 +1,8 @@ +require "t/selenium/AllTests.t"; + +init_server("administration/begin", "system/begin", "masterdata/begin"); + +diag("\n\nUsername: " . $lxtest->{testuserlogin} . "\n" . "Password: " . $lxtest->{testuserpasswd} . "\n\n"); + +1; + diff --git a/t/selenium/TestMasterData.t b/t/selenium/TestMasterData.t new file mode 100644 index 000000000..86c43a882 --- /dev/null +++ b/t/selenium/TestMasterData.t @@ -0,0 +1,5 @@ +require "t/selenium/AllTests.t"; + +init_server("masterdata/begin", "masterdata/end"); + +1; \ No newline at end of file diff --git a/t/selenium/TestPayments.t b/t/selenium/TestPayments.t new file mode 100644 index 000000000..2e2a8d5ac --- /dev/null +++ b/t/selenium/TestPayments.t @@ -0,0 +1,5 @@ +require "t/selenium/AllTests.t"; + +init_server("payments/begin", "payments/end"); + +1; \ No newline at end of file diff --git a/t/selenium/TestPrinting.t b/t/selenium/TestPrinting.t new file mode 100644 index 000000000..75b9851d2 --- /dev/null +++ b/t/selenium/TestPrinting.t @@ -0,0 +1,5 @@ +require "t/selenium/AllTests.t"; + +init_server("printing/begin", "printing/end"); + +1; \ No newline at end of file diff --git a/t/selenium/TestProgramm.t b/t/selenium/TestProgramm.t new file mode 100644 index 000000000..dffb6a306 --- /dev/null +++ b/t/selenium/TestProgramm.t @@ -0,0 +1,5 @@ +require "t/selenium/AllTests.t"; + +init_server("programm/begin", "programm/end"); + +1; \ No newline at end of file diff --git a/t/selenium/TestPurchase.t b/t/selenium/TestPurchase.t new file mode 100644 index 000000000..19cdf560a --- /dev/null +++ b/t/selenium/TestPurchase.t @@ -0,0 +1,5 @@ +require "t/selenium/AllTests.t"; + +init_server("purchase/begin", "purchase/end"); + +1; \ No newline at end of file diff --git a/t/selenium/TestSelling.t b/t/selenium/TestSelling.t new file mode 100644 index 000000000..ca31eccec --- /dev/null +++ b/t/selenium/TestSelling.t @@ -0,0 +1,5 @@ +require "t/selenium/AllTests.t"; + +init_server("selling/begin", "selling/end"); + +1; \ No newline at end of file diff --git a/t/selenium/TestSystem.t b/t/selenium/TestSystem.t new file mode 100644 index 000000000..6dee18cf8 --- /dev/null +++ b/t/selenium/TestSystem.t @@ -0,0 +1,5 @@ +require "t/selenium/AllTests.t"; + +init_server("system/begin", "system/end"); + +1; \ No newline at end of file diff --git a/t/selenium/testscripts/base/000Login.t b/t/selenium/testscripts/base/000Login.t index 5dc1137e9..864ebd120 100644 --- a/t/selenium/testscripts/base/000Login.t +++ b/t/selenium/testscripts/base/000Login.t @@ -32,5 +32,5 @@ if($sel->get_title() eq "Datenbankaktualisierung - Lx-Office Version 2.4.3 - -") } $sel->title_is("Lx-Office Version 2.4.3 - Selenium - " . $lxtest->{db}); - +$sel->{ran_tests}{"t/selenium/testscripts/base/999Logout.t"} = 0; 1; \ No newline at end of file diff --git a/t/selenium/testscripts/base/999Logout.t b/t/selenium/testscripts/base/999Logout.t index 03c90d72d..247d61e18 100644 --- a/t/selenium/testscripts/base/999Logout.t +++ b/t/selenium/testscripts/base/999Logout.t @@ -11,4 +11,5 @@ $sel->select_frame_ok("relative=top"); $sel->click_ok("link=abmelden"); $sel->wait_for_page_to_load_ok($lxtest->{timeout}); $sel->title_is("Lx-Office Version ".$lxtest->{version}); +$sel->{ran_tests}{"t/selenium/testscripts/base/000Login.t"} = 0; 1; \ No newline at end of file -- 2.20.1