3 require_once dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))).'/tests/func/Testing/SeleniumGforge.php';
5 // This will analize the HTML report generated out of the OSLC
6 // provider JUnit test suite by the Maven Surefire plugin to detect if
7 // tests are passed as before (non-regression)
9 class SureFireReports extends FForge_SeleniumTestCase
12 // Test the ServiceProviderCatalogTests results
13 public function testServiceProviderCatalogTestsResults()
16 // Make sure there's a project with a tracker
17 $this->populateStandardTemplate('trackers');
20 // start the OSLC test suite
21 echo "\nStarting OSLC test suite\n";
22 $directory = dirname(dirname(__FILE__));
23 echo "Executing " . $directory . "/run-provider-tests.sh\n";
24 system('cd '. $directory . '; ./run-provider-tests.sh');
25 echo "OSLC test suite executed\n\n";
27 // Check the results in the generated HTML report
28 $this->open("/plugins/oslc/surefire/surefire-report.html");
29 $this->click("link=net.openservices.provider.test.oslcv1tests");
31 $this->assertEquals("net.openservices.provider.test.oslcv1tests", $this->getText("//div[@id='contentBox']/div[3]/div/h3"));
33 $this->assertEquals("ServiceProviderCatalogTests", $this->getText("//div[@id='contentBox']/div[3]/div/h3[contains(.,'net.openservices.provider.test.oslcv1tests')]/../table/tbody/tr[2]/td[2]"));
36 $this->assertEquals("56", $this->getText("//div[@id='contentBox']/div[3]/div/h3[contains(.,'net.openservices.provider.test.oslcv1tests')]/../table/tbody/tr[2]/td[3]"));
38 $this->assertEquals("0", $this->getText("//div[@id='contentBox']/div[3]/div/h3[contains(.,'net.openservices.provider.test.oslcv1tests')]/../table/tbody/tr[2]/td[4]"));
40 $this->assertEquals("8", $this->getText("//div[@id='contentBox']/div[3]/div/h3[contains(.,'net.openservices.provider.test.oslcv1tests')]/../table/tbody/tr[2]/td[5]"));
42 $this->assertEquals("0", $this->getText("//div[@id='contentBox']/div[3]/div/h3[contains(.,'net.openservices.provider.test.oslcv1tests')]/../table/tbody/tr[2]/td[6]"));