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 @Test(dependsOnMethods = { "testWithCorrectUsernamePassword" } )
32 public void testRepoStatisticsWithoutRepoCompared()
35 clickButtonWithValue( "View Statistics" );
36 assertTextPresent( "Please select a repository (or repositories) from the list." );
39 @Test(dependsOnMethods = { "testWithCorrectUsernamePassword" } )
40 public void testRepositoryStatisticsWithoutDate()
42 String repositoryName = p.getProperty( "REPOSITORY_NAME" ) ;
43 compareRepositories( "label=" + repositoryName, "", "" );
45 assertTextPresent( "Statistics Report" );
48 @Test(dependsOnMethods = { "testWithCorrectUsernamePassword" } )
49 public void testRepositoryStatisticsEndEarlierThanStart()
51 String repositoryName = p.getProperty( "REPOSITORY_NAME" ) ;
52 String startDate = p.getProperty( "END_DATE" );
53 String endDate = p.getProperty( "START_DATE" );
54 compareRepositories( "label=" + repositoryName, startDate, endDate );
55 //assertTextPresent( "Statistics for Repository '" + repositoryName + "'" );
56 assertPage( "Apache Archiva \\ Reports" );
57 assertTextPresent( "Start Date must be earlier than the End Date" );
60 @Test(dependsOnMethods = { "testWithCorrectUsernamePassword" } )
61 public void testRepositoryStatistics()
63 String repositoryName = p.getProperty( "REPOSITORY_NAME" ) ;
64 String startDate = p.getProperty( "START_DATE" );
65 String endDate = p.getProperty( "END_DATE" );
66 compareRepositories( "label=" + repositoryName, startDate, endDate );
67 //assertTextPresent( "Statistics for Repository '" + repositoryName + "'" );
68 assertPage( "Apache Archiva \\ Reports" );
69 assertTextPresent( "Statistics Report" );
72 @Test(dependsOnMethods = { "testWithCorrectUsernamePassword" } )
73 public void testRepositoriesStatisticComparisonReport()
76 clickButtonWithValue( "-->>" , false );
77 clickButtonWithValue( "View Statistics" );
78 assertTextPresent( "Statistics Report" );
81 @Test(dependsOnMethods = { "testWithCorrectUsernamePassword" } )
82 public void testRepositoryHealthWithoutDefect()
85 String groupId = p.getProperty( "ARTIFACT_GROUPID" );
86 getSelenium().type( "generateReport_groupId" , groupId );
87 clickButtonWithValue( "Show Report" );
88 assertPage( "Apache Archiva \\ Reports" );
89 assertTextPresent( "The operation generated an empty report." );
92 @Test(dependsOnMethods = { "testWithCorrectUsernamePassword" } )
93 public void testRepositoryHealthWithoutGroupId()
96 clickButtonWithValue( "Show Report" );
97 assertPage( "Apache Archiva \\ Reports" );
98 assertTextPresent( "The operation generated an empty report." );
100 //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.