]> source.dussan.org Git - archiva.git/blob
756763feca2e133a18e3eab9e4bd85644777e657
[archiva.git] /
1 package org.apache.archiva.web.test;
2
3 /*
4  * Licensed to the Apache Software Foundation (ASF) under one
5  * or more contributor license agreements.  See the NOTICE file
6  * distributed with this work for additional information
7  * regarding copyright ownership.  The ASF licenses this file
8  * to you under the Apache License, Version 2.0 (the
9  * "License"); you may not use this file except in compliance
10  * with the License.  You may obtain a copy of the License at
11  *
12  *   http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  * KIND, either express or implied.  See the License for the
18  * specific language governing permissions and limitations
19  * under the License.
20  */
21
22 import org.apache.archiva.web.test.parent.AbstractArtifactReportsTest;
23 import org.testng.annotations.Test;
24
25 @Test( groups = { "reports" }, dependsOnMethods = { "testWithCorrectUsernamePassword" } )
26 public class ReportsTest 
27         extends AbstractArtifactReportsTest
28 {
29         //TODO Tests for repository with defects
30         
31         public void testRepoStatisticsWithoutRepoCompared()
32         {
33                 goToReportsPage();
34                 clickButtonWithValue( "View Statistics" );
35                 assertTextPresent( "Please select a repository (or repositories) from the list." );
36         }
37         
38         @Test(dependsOnMethods = { "testRepoStatisticsWithoutRepoCompared" } )
39         public void testRepositoryStatisticsWithoutDate()
40         {
41                 String repositoryName = getProperty( "REPOSITORY_NAME" ) ;
42                 compareRepositories( "label=" + repositoryName, "", "" );
43                 //TODO
44                 //assertTextPresent( "Statistics Report" );
45         }
46         
47         @Test(dependsOnMethods = { "testRepoStatisticsWithoutRepoCompared" } )
48         public void testRepositoryStatisticsEndEarlierThanStart()
49         {
50                 String repositoryName = getProperty( "REPOSITORY_NAME" ) ;
51                 String startDate = getProperty( "END_DATE" );
52                 String endDate = getProperty( "START_DATE" );
53                 compareRepositories( "label=" + repositoryName, startDate, endDate );
54                 //assertTextPresent( "Statistics for Repository '" + repositoryName + "'" );
55                 assertPage( "Apache Archiva \\ Reports" );
56                 assertTextPresent( "Start Date must be earlier than the End Date" );
57         }
58                 
59         public void testRepositoryStatistics()
60         {
61                 String repositoryName = getProperty( "REPOSITORY_NAME" ) ;
62                 String startDate = getProperty( "START_DATE" );
63                 String endDate = getProperty( "END_DATE" );
64                 compareRepositories( "label=" + repositoryName, startDate, endDate );
65                 //assertTextPresent( "Statistics for Repository '" + repositoryName + "'" );
66                 //assertPage( "Apache Archiva \\ Reports" );
67                 //assertTextPresent( "Statistics Report" );
68         }
69         
70         /* @Test( dependsOnMethods = { "testRepositoryStatistics" } )
71         public void testRepositoriesStatisticComparisonReport()
72         {
73                 //goToReportsPage();
74                 clickButtonWithValue( "-->>" , false );
75                 clickButtonWithValue( "View Statistics" );
76                 assertTextPresent( "Statistics Report" );
77         }
78         
79         public void testRepositoryHealthWithoutDefect()
80         {
81                 goToReportsPage();
82                 String groupId = getProperty( "ARTIFACT_GROUPID" );
83                 getSelenium().type( "generateReport_groupId" , groupId );
84                 clickButtonWithValue( "Show Report" );
85                 assertPage( "Apache Archiva \\ Reports" );
86                 assertTextPresent( "The operation generated an empty report." );
87         }
88         
89         public void testRepositoryHealthWithoutGroupId()
90         {
91                 goToReportsPage();
92                 clickButtonWithValue( "Show Report" );
93                 assertPage( "Apache Archiva \\ Reports" );
94                 assertTextPresent( "The operation generated an empty report." );
95                 
96                 //TODO As of the creation of the tests, GroupId is not a required field in showing the reports of repository health. GroupId should be required I think.
97         }*/
98         
99         
100         
101 }