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" );
71 * @Test( dependsOnMethods = { "testRepositoryStatistics" } ) public void
72 * testRepositoriesStatisticComparisonReport() { //goToReportsPage(); clickButtonWithValue( "-->>" , false );
73 * clickButtonWithValue( "View Statistics" ); assertTextPresent( "Statistics Report" ); } public void
74 * testRepositoryHealthWithoutDefect() { goToReportsPage(); String groupId = getProperty( "ARTIFACT_GROUPID" );
75 * getSelenium().type( "generateReport_groupId" , groupId ); clickButtonWithValue( "Show Report" ); assertPage(
76 * "Apache Archiva \\ Reports" ); assertTextPresent( "The operation generated an empty report." ); } public void
77 * testRepositoryHealthWithoutGroupId() { goToReportsPage(); clickButtonWithValue( "Show Report" ); assertPage(
78 * "Apache Archiva \\ Reports" ); assertTextPresent( "The operation generated an empty report." ); //TODO As of the
79 * creation of the tests, GroupId is not a required field in showing the reports of repository health. GroupId
80 * should be required I think. }