File: sureFireReportTest.php

package info (click to toggle)
fusionforge 5.3.2%2B20141104-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 60,472 kB
  • sloc: php: 271,846; sql: 36,817; python: 14,575; perl: 6,406; sh: 5,980; xml: 4,294; pascal: 1,411; makefile: 911; cpp: 52; awk: 27
file content (41 lines) | stat: -rw-r--r-- 1,935 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?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 SureFireReports extends FForge_SeleniumTestCase
{

	// Test the ServiceProviderCatalogTests results
	public function testServiceProviderCatalogTestsResults()
	{
		system('mvn --version &>/dev/null', $retval);
        if ($retval) {
            $this->markTestSkipped('Maven (mvn) is not available.');
        }

		// Make sure there's a project with a tracker
		$this->populateStandardTemplate('trackers');
		$this->init();

		// start the OSLC test suite
		echo "\nStarting OSLC test suite\n";
		$directory = dirname(dirname(__FILE__));
		echo "Executing " . $directory . "/run-provider-tests.sh\n";
		system('cd ' . $directory . '; ./run-provider-tests.sh');
		echo "OSLC test suite executed\n\n";

		// Check the OSLC JUnit testsuite results in the generated HTML report
		$this->open("/plugins/oslc/surefire/surefire-report.html");
		$this->assertEquals("net.openservices.provider.test.oslcv2tests", $this->getTable("//div[@id='contentBox']/div[3]/table.1.0"));
		$this->assertEquals("ServiceProviderCatalogXmlTests", $this->getTable("//div[@id='contentBox']/div[3]/div/table.1.1"));
		$this->assertEquals("100%", $this->getTable("//div[@id='contentBox']/div[3]/div/table.1.6"));
		$this->assertEquals("ServiceProviderXmlTests", $this->getTable("//div[@id='contentBox']/div[3]/div/table.3.1"));
		$this->assertEquals("100%", $this->getTable("//div[@id='contentBox']/div[3]/div/table.3.6"));
		$this->assertEquals("ServiceProviderCatalogRdfXmlTests", $this->getTable("//div[@id='contentBox']/div[3]/div/table.4.1"));
		$this->assertEquals("100%", $this->getTable("//div[@id='contentBox']/div[3]/div/table.4.6"));
	}
}