diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-11-24 11:20:54 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-11-24 11:21:08 +0100 |
commit | 7b7fa8b98ad7bb8dd51da02fc304b5ff05e30729 (patch) | |
tree | d1a6f139a9007e312262e2a152a4c67459144d70 /it | |
parent | 7fb14c3d55ba19b85e7361577a92ee5a0f8ccefc (diff) | |
download | sonarqube-7b7fa8b98ad7bb8dd51da02fc304b5ff05e30729.tar.gz sonarqube-7b7fa8b98ad7bb8dd51da02fc304b5ff05e30729.zip |
7035 Use coverage measures instead of overall coverage ones on the project overview page
Diffstat (limited to 'it')
6 files changed, 272 insertions, 9 deletions
diff --git a/it/it-tests/src/test/java/it/Category1Suite.java b/it/it-tests/src/test/java/it/Category1Suite.java index 69598fb0899..6896d5b070d 100644 --- a/it/it-tests/src/test/java/it/Category1Suite.java +++ b/it/it-tests/src/test/java/it/Category1Suite.java @@ -51,6 +51,7 @@ import it.measureHistory.TimeMachineTest; import it.measureHistory.TimeMachineUiTest; import it.projectAdministration.BulkDeletionTest; import it.projectAdministration.ProjectAdministrationTest; +import it.projectOverview.ProjectOverviewTest; import it.qualityGate.QualityGateNotificationTest; import it.qualityGate.QualityGateTest; import it.qualityGate.QualityGateUiTest; @@ -70,6 +71,8 @@ import static util.ItUtils.xooPlugin; // project administration BulkDeletionTest.class, ProjectAdministrationTest.class, + // project pages + ProjectOverviewTest.class, // settings PropertySetsTest.class, SubCategoriesTest.class, diff --git a/it/it-tests/src/test/java/it/projectOverview/ProjectOverviewTest.java b/it/it-tests/src/test/java/it/projectOverview/ProjectOverviewTest.java index 145d926f5f5..9e3ac118f5b 100644 --- a/it/it-tests/src/test/java/it/projectOverview/ProjectOverviewTest.java +++ b/it/it-tests/src/test/java/it/projectOverview/ProjectOverviewTest.java @@ -36,7 +36,7 @@ public class ProjectOverviewTest { @Test public void test_project_overview_after_first_analysis() throws Exception { - executeBuild("project-for-overview", "Project For Overview"); + executeBuild("shared/xoo-sample", "project-for-overview", "Project For Overview"); Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("test_project_overview_after_first_analysis", "/projectOverview/ProjectOverviewTest/test_project_overview_after_first_analysis.html" @@ -44,9 +44,39 @@ public class ProjectOverviewTest { new SeleneseTest(selenese).runOn(orchestrator); } - private void executeBuild(String projectKey, String projectName) { + @Test + public void test_ut_coverage_on_project_overview() throws Exception { + executeBuild("testing/xoo-sample-ut-coverage", "project-for-overview-ut-coverage", "Project For Overview UT"); + + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("test_ut_coverage_on_project_overview", + "/projectOverview/ProjectOverviewTest/test_ut_coverage_on_project_overview.html" + ).build(); + new SeleneseTest(selenese).runOn(orchestrator); + } + + @Test + public void test_it_coverage_on_project_overview() throws Exception { + executeBuild("testing/xoo-sample-it-coverage", "project-for-overview-it-coverage", "Project For Overview IT"); + + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("test_it_coverage_onfi_project_overview", + "/projectOverview/ProjectOverviewTest/test_it_coverage_on_project_overview.html" + ).build(); + new SeleneseTest(selenese).runOn(orchestrator); + } + + @Test + public void test_overall_coverage_on_project_overview() throws Exception { + executeBuild("testing/xoo-sample-overall-coverage", "project-for-overview-overall-coverage", "Project For Overview Overall"); + + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("test_overall_coverage_on_project_overview", + "/projectOverview/ProjectOverviewTest/test_overall_coverage_on_project_overview.html" + ).build(); + new SeleneseTest(selenese).runOn(orchestrator); + } + + private void executeBuild(String projectLocation, String projectKey, String projectName) { orchestrator.executeBuild( - SonarRunner.create(projectDir("shared/xoo-sample")) + SonarRunner.create(projectDir(projectLocation)) .setProjectKey(projectKey) .setProjectName(projectName) ); diff --git a/it/it-tests/src/test/resources/projectOverview/ProjectOverviewTest/test_it_coverage_on_project_overview.html b/it/it-tests/src/test/resources/projectOverview/ProjectOverviewTest/test_it_coverage_on_project_overview.html new file mode 100644 index 00000000000..896815ce200 --- /dev/null +++ b/it/it-tests/src/test/resources/projectOverview/ProjectOverviewTest/test_it_coverage_on_project_overview.html @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <link rel="selenium.base" href="http://localhost:49506"/> + <title>test_project_overview_after_first_analysis</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> + <thead> + <tr> + <td rowspan="1" colspan="3">test_project_overview_after_first_analysis</td> + </tr> + </thead> + <tbody> + <tr> + <td>open</td> + <td>/sonar/overview?id=project-for-overview-it-coverage</td> + <td></td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*50.0%*Coverage*</td> +</tr> +<tr> + <td>open</td> + <td>/sonar/overview/tests?id=project-for-overview-it-coverage</td> + <td></td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*50.0%*IT coverage*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*50.0%*IT line coverage*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*50.0%*IT condition coverage*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*IT uncovered conditions*1*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*IT uncovered lines*2*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*X*Complexity*Y*IT coverage*Size*IT uncovered lines*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*Size*Lines of code*Color*IT coverage*</td> +</tr> +</tbody> +</table> +</body> +</html> diff --git a/it/it-tests/src/test/resources/projectOverview/ProjectOverviewTest/test_overall_coverage_on_project_overview.html b/it/it-tests/src/test/resources/projectOverview/ProjectOverviewTest/test_overall_coverage_on_project_overview.html new file mode 100644 index 00000000000..02eea808417 --- /dev/null +++ b/it/it-tests/src/test/resources/projectOverview/ProjectOverviewTest/test_overall_coverage_on_project_overview.html @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <link rel="selenium.base" href="http://localhost:49506"/> + <title>test_project_overview_after_first_analysis</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> + <thead> + <tr> + <td rowspan="1" colspan="3">test_project_overview_after_first_analysis</td> + </tr> + </thead> + <tbody> + <tr> + <td>open</td> + <td>/sonar/overview?id=project-for-overview-overall-coverage</td> + <td></td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*62.5%*Coverage*</td> +</tr> +<tr> + <td>open</td> + <td>/sonar/overview/tests?id=project-for-overview-overall-coverage</td> + <td></td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*62.5%*Overall coverage*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*75.0%*Overall line coverage*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*50.0%*Overall condition coverage*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*Uncovered conditions*3*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*IT uncovered conditions*3*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*Overall uncovered conditions*2*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*Uncovered lines*2*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*IT uncovered lines*2*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*Overall uncovered lines*1*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*X*Complexity*Y*Overall coverage*Size*Overall uncovered lines*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*Size*Lines of code*Color*Overall coverage*</td> +</tr> +</tbody> +</table> +</body> +</html> diff --git a/it/it-tests/src/test/resources/projectOverview/ProjectOverviewTest/test_project_overview_after_first_analysis.html b/it/it-tests/src/test/resources/projectOverview/ProjectOverviewTest/test_project_overview_after_first_analysis.html index ddbe51f8e0b..d62a279456d 100644 --- a/it/it-tests/src/test/resources/projectOverview/ProjectOverviewTest/test_project_overview_after_first_analysis.html +++ b/it/it-tests/src/test/resources/projectOverview/ProjectOverviewTest/test_project_overview_after_first_analysis.html @@ -32,17 +32,12 @@ <tr> <td>waitForText</td> <td>id=content</td> - <td>*Blocker*0*Critical*0*Major*0*Minor*0*Info*0*</td> - </tr> - <tr> - <td>waitForText</td> - <td>id=content</td> <td>*0.0%*Duplications*0*Duplicated Blocks*</td> </tr> <tr> <td>waitForText</td> <td>id=content</td> - <td>*13*Lines of Code*1*Files*</td> + <td>*13*Lines of Code*</td> </tr> <tr> <td>assertNotText</td> diff --git a/it/it-tests/src/test/resources/projectOverview/ProjectOverviewTest/test_ut_coverage_on_project_overview.html b/it/it-tests/src/test/resources/projectOverview/ProjectOverviewTest/test_ut_coverage_on_project_overview.html new file mode 100644 index 00000000000..69bc51e7f38 --- /dev/null +++ b/it/it-tests/src/test/resources/projectOverview/ProjectOverviewTest/test_ut_coverage_on_project_overview.html @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <link rel="selenium.base" href="http://localhost:49506"/> + <title>test_project_overview_after_first_analysis</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> + <thead> + <tr> + <td rowspan="1" colspan="3">test_project_overview_after_first_analysis</td> + </tr> + </thead> + <tbody> + <tr> + <td>open</td> + <td>/sonar/overview?id=project-for-overview-ut-coverage</td> + <td></td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*50.0%*Coverage*</td> +</tr> +<tr> + <td>open</td> + <td>/sonar/overview/tests?id=project-for-overview-ut-coverage</td> + <td></td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*50.0%*Coverage*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*50.0%*Line coverage*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*50.0%*Condition coverage*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*Lines to cover*4*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*Uncovered conditions*1*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*Uncovered lines*2*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*X*Complexity*Y*Coverage*Size*Uncovered lines*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*Size*Lines of code*Color*Coverage*</td> +</tr> +</tbody> +</table> +</body> +</html> |