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();
53 assertTextPresent( "Latest Events" );
56 @Test(dependsOnMethods = { "testWithCorrectUsernamePassword" } )
57 public void testViewAuditLogsNoDataFound()
59 goToAuditLogReports();
60 assertAuditLogsReportPage();
62 setFieldValue( "groupId", "non.existing" );
65 assertPage( "Apache Archiva \\ Audit Log Report" );
66 assertTextPresent( "Results" );
67 assertTextPresent( "No audit logs found." );
70 @Test (dependsOnMethods = { "testAddArtifactValidValues" } )
71 public void testViewAuditLogsDataFound()
73 goToAuditLogReports();
74 assertAuditLogsReportPage();
76 selectValue( "repository", "internal" );
77 setFieldValue( "groupId", "test" );
80 assertAuditLogsReportPage();
81 assertTextPresent( "Results" );
82 assertTextNotPresent( "No audit logs found." );
83 assertTextPresent( "test:test:1.0" );
84 assertTextPresent( "Uploaded File" );
85 assertTextPresent( "internal" );
86 assertTextPresent( "admin" );
89 @Test (dependsOnMethods = { "testViewAuditLogsDataFound" } )
90 public void testViewAuditLogsOnlyArtifactIdIsSpecified()
92 goToAuditLogReports();
93 assertAuditLogsReportPage();
95 selectValue( "repository", "internal" );
96 setFieldValue( "artifactId", "test" );
99 assertAuditLogsReportPage();
100 assertTextPresent( "Results" );
101 assertTextNotPresent( "No audit logs found." );
102 assertTextPresent( "test:test:1.0" );
103 assertTextPresent( "Uploaded File" );
104 assertTextPresent( "internal" );
105 assertTextPresent( "admin" );
108 @Test (dependsOnMethods = { "testViewAuditLogsOnlyArtifactIdIsSpecified" } )
109 public void testViewAuditLogsForAllRepositories()
111 goToAuditLogReports();
112 assertAuditLogsReportPage();
114 selectValue( "repository", "all" );
117 assertAuditLogsReportPage();
118 assertTextPresent( "Results" );
119 assertTextNotPresent( "No audit logs found." );
120 assertTextPresent( "test:test:1.0" );
121 assertTextPresent( "Uploaded File" );
122 assertTextPresent( "internal" );
123 assertTextPresent( "admin" );