1 package org.apache.archiva.web.test;
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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
22 import org.apache.archiva.web.test.parent.AbstractArtifactReportsTest;
23 import org.testng.annotations.Test;
25 @Test( groups = { "reports" }, dependsOnMethods = { "testWithCorrectUsernamePassword" } )
26 public class ReportsTest
27 extends AbstractArtifactReportsTest
29 //TODO Tests for repository with defects
31 public void testRepoStatisticsWithoutRepoCompared()
34 clickButtonWithValue( "View Statistics" );
35 assertTextPresent( "Please select a repository (or repositories) from the list." );
38 @Test(dependsOnMethods = { "testRepoStatisticsWithoutRepoCompared" } )
39 public void testRepositoryStatisticsWithoutDate()
41 String repositoryName = getProperty( "REPOSITORY_NAME" ) ;
42 compareRepositories( "label=" + repositoryName, "", "" );
44 //assertTextPresent( "Statistics Report" );
47 @Test(dependsOnMethods = { "testRepoStatisticsWithoutRepoCompared" } )
48 public void testRepositoryStatisticsEndEarlierThanStart()
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" );
59 public void testRepositoryStatistics()
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" );
70 /* @Test( dependsOnMethods = { "testRepositoryStatistics" } )
71 public void testRepositoriesStatisticComparisonReport()
74 clickButtonWithValue( "-->>" , false );
75 clickButtonWithValue( "View Statistics" );
76 assertTextPresent( "Statistics Report" );
79 public void testRepositoryHealthWithoutDefect()
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." );
89 public void testRepositoryHealthWithoutGroupId()
92 clickButtonWithValue( "Show Report" );
93 assertPage( "Apache Archiva \\ Reports" );
94 assertTextPresent( "The operation generated an empty report." );
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.