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.AbstractArchivaTest;
23 import org.testng.annotations.Test;
25 @Test( groups = { "auditlogsreport" }, dependsOnMethods = { "testWithCorrectUsernamePassword" } )
26 public class AuditLogsReportTest
27 extends AbstractArchivaTest
29 private void goToAuditLogReports()
31 clickLinkWithText( "Audit Log Report" );
34 private void assertAuditLogsReportPage()
36 assertPage( "Apache Archiva \\ Audit Log Report" );
37 assertTextPresent( "Audit Log Report" );
39 assertElementPresent( "repository" );
40 assertElementPresent( "groupId" );
41 assertElementPresent( "artifactId" );
42 assertElementPresent( "startDate" );
43 assertElementPresent( "endDate" );
44 assertElementPresent( "rowCount" );
45 assertButtonWithValuePresent( "View Audit Log" );
48 @Test(dependsOnMethods = { "testWithCorrectUsernamePassword" } )
49 public void testAuditLogsReport()
51 goToAuditLogReports();
52 assertAuditLogsReportPage();
55 @Test(dependsOnMethods = { "testWithCorrectUsernamePassword" } )
56 public void testViewAuditLogsNoDataFound()
58 goToAuditLogReports();
59 assertAuditLogsReportPage();
61 setFieldValue( "groupId", "non.existing" );
64 assertPage( "Apache Archiva \\ Audit Log Report" );
65 assertTextPresent( "No audit logs found." );
68 @Test (dependsOnMethods = { "testAddArtifactValidValues" } )
69 public void testViewAuditLogsDataFound()
71 goToAuditLogReports();
72 assertAuditLogsReportPage();
74 selectValue( "repository", "internal" );
75 setFieldValue( "groupId", "test" );
78 assertAuditLogsReportPage();
79 assertTextNotPresent( "No audit logs found." );
80 assertTextPresent( "test:test:1.0" );
81 assertTextPresent( "Uploaded File" );
82 assertTextPresent( "internal" );
83 assertTextPresent( "admin" );
86 @Test (dependsOnMethods = { "testViewAuditLogsDataFound" } )
87 public void testViewAuditLogsOnlyArtifactIdIsSpecified()
89 goToAuditLogReports();
90 assertAuditLogsReportPage();
92 selectValue( "repository", "internal" );
93 setFieldValue( "artifactId", "test" );
96 assertAuditLogsReportPage();
97 assertTextNotPresent( "No audit logs found." );
98 assertTextPresent( "test:test:1.0" );
99 assertTextPresent( "Uploaded File" );
100 assertTextPresent( "internal" );
101 assertTextPresent( "admin" );
104 @Test (dependsOnMethods = { "testViewAuditLogsOnlyArtifactIdIsSpecified" } )
105 public void testViewAuditLogsForAllRepositories()
107 goToAuditLogReports();
108 assertAuditLogsReportPage();
110 selectValue( "repository", "all" );
113 assertAuditLogsReportPage();
114 assertTextNotPresent( "No audit logs found." );
115 assertTextPresent( "test:test:1.0" );
116 assertTextPresent( "Uploaded File" );
117 assertTextPresent( "internal" );
118 assertTextPresent( "admin" );