[Fusionforge-commits] r12211 - in branches/Branch_5_1/src/plugins/oslc/tests: . func

Olivier Berger olberger at libremir.placard.fr.eu.org
Thu Feb 10 13:56:57 CET 2011


Author: olberger
Date: 2011-02-10 13:56:57 +0100 (Thu, 10 Feb 2011)
New Revision: 12211

Added:
   branches/Branch_5_1/src/plugins/oslc/tests/func/
   branches/Branch_5_1/src/plugins/oslc/tests/func/sureFireReportTest.php
Log:
Add parsing of surefire report's results

Added: branches/Branch_5_1/src/plugins/oslc/tests/func/sureFireReportTest.php
===================================================================
--- branches/Branch_5_1/src/plugins/oslc/tests/func/sureFireReportTest.php	                        (rev 0)
+++ branches/Branch_5_1/src/plugins/oslc/tests/func/sureFireReportTest.php	2011-02-10 12:56:57 UTC (rev 12211)
@@ -0,0 +1,37 @@
+<?php
+
+require_once dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))).'/tests/func/Testing/SeleniumGforge.php';
+
+// This will analize the HTML report generated out of the OSLC
+// provider JUnit test suite by the Maven Surefire plugin to detect if
+// tests are passed as before (non-regression)
+
+class Example extends FForge_SeleniumTestCase
+{
+  protected function setUp()
+  {
+    $this->setBrowser("*chrome");
+    $this->setBrowserUrl("https://forge.local/plugins/oslc/surefire/surefire-report.html");
+  }
+
+  // Test the ServiceProviderCatalogTests results
+  public function testServiceProviderCatalogTests()
+  {
+    $this->open("/plugins/oslc/surefire/surefire-report.html");
+    $this->click("link=net.openservices.provider.test.oslcv1tests");
+
+    $this->assertEquals("net.openservices.provider.test.oslcv1tests", $this->getText("//div[@id='contentBox']/div[3]/div/h3"));
+
+    $this->assertEquals("ServiceProviderCatalogTests", $this->getText("//div[@id='contentBox']/div[3]/div/h3[contains(.,'net.openservices.provider.test.oslcv1tests')]/../table/tbody/tr[2]/td[2]"));
+
+    // Tests
+    $this->assertEquals("42", $this->getText("//div[@id='contentBox']/div[3]/div/h3[contains(.,'net.openservices.provider.test.oslcv1tests')]/../table/tbody/tr[2]/td[3]"));
+    // Errors
+    $this->assertEquals("0", $this->getText("//div[@id='contentBox']/div[3]/div/h3[contains(.,'net.openservices.provider.test.oslcv1tests')]/../table/tbody/tr[2]/td[4]"));
+    // Failures
+    $this->assertEquals("8", $this->getText("//div[@id='contentBox']/div[3]/div/h3[contains(.,'net.openservices.provider.test.oslcv1tests')]/../table/tbody/tr[2]/td[5]"));
+    // Skipped
+    $this->assertEquals("0", $this->getText("//div[@id='contentBox']/div[3]/div/h3[contains(.,'net.openservices.provider.test.oslcv1tests')]/../table/tbody/tr[2]/td[6]"));
+  }
+}
+?>
\ No newline at end of file




More information about the Fusionforge-commits mailing list