Hinzufügen der globalen Testscripte, welche die einzelnene Test koordienieren und...
authorThomas Kasulke <t.kasulke@linet-services.de>
Wed, 5 Sep 2007 11:49:17 +0000 (11:49 +0000)
committerThomas Kasulke <t.kasulke@linet-services.de>
Wed, 5 Sep 2007 11:49:17 +0000 (11:49 +0000)
15 files changed:
t/lx-office.t
t/selenium/AllTests.t
t/selenium/TestAccounting.t [new file with mode: 0644]
t/selenium/TestAdmin.t [new file with mode: 0644]
t/selenium/TestAllTests.t [new file with mode: 0644]
t/selenium/TestCreateTestbed.t [new file with mode: 0644]
t/selenium/TestMasterData.t [new file with mode: 0644]
t/selenium/TestPayments.t [new file with mode: 0644]
t/selenium/TestPrinting.t [new file with mode: 0644]
t/selenium/TestProgramm.t [new file with mode: 0644]
t/selenium/TestPurchase.t [new file with mode: 0644]
t/selenium/TestSelling.t [new file with mode: 0644]
t/selenium/TestSystem.t [new file with mode: 0644]
t/selenium/testscripts/base/000Login.t
t/selenium/testscripts/base/999Logout.t

index 0b583e1..ee52ab5 100644 (file)
@@ -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',
     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
index 8a1a13e..c5ebf1d 100644 (file)
@@ -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;
       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 (file)
index 0000000..ea1ebd3
--- /dev/null
@@ -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 (file)
index 0000000..130f6cc
--- /dev/null
@@ -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 (file)
index 0000000..4425638
--- /dev/null
@@ -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 (file)
index 0000000..012ce9b
--- /dev/null
@@ -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 (file)
index 0000000..86c43a8
--- /dev/null
@@ -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 (file)
index 0000000..2e2a8d5
--- /dev/null
@@ -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 (file)
index 0000000..75b9851
--- /dev/null
@@ -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 (file)
index 0000000..dffb6a3
--- /dev/null
@@ -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 (file)
index 0000000..19cdf56
--- /dev/null
@@ -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 (file)
index 0000000..ca31ecc
--- /dev/null
@@ -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 (file)
index 0000000..6dee18c
--- /dev/null
@@ -0,0 +1,5 @@
+require "t/selenium/AllTests.t";
+
+init_server("system/begin", "system/end");
+
+1;
\ No newline at end of file
index 5dc1137..864ebd1 100644 (file)
@@ -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
index 03c90d7..247d61e 100644 (file)
@@ -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