1 package org.apache.maven.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
23 * Archiva's webapp UI test for browsing the indexed repository.
26 public class BrowseRepositoryTest
27 extends AbstractArchivaTestCase
29 private void browseArtifact()
31 clickLinkWithText( "Browse" );
32 assertPage( "Browse Repository" );
33 assertTextPresent( "Browse Repository" );
34 assertLinkPresent( "org.apache.maven.archiva.web.test/" );
36 clickLinkWithText( "org.apache.maven.archiva.web.test/" );
37 assertPage( "Browse Repository" );
38 assertTextPresent( "Browse Repository" );
39 assertTextPresent( "Artifacts" );
40 assertLinkPresent( "artifact-a/" );
42 clickLinkWithText( "artifact-a/" );
43 assertPage( "Browse Repository" );
44 assertTextPresent( "Browse Repository" );
45 assertTextPresent( "Versions" );
46 assertLinkPresent( "1.0/" );
48 clickLinkWithText( "1.0/" );
49 assertPage( "Browse Repository" );
50 assertTextPresent( "artifact-a" );
51 assertLinkPresent( "Main" );
54 public void testBrowseArtifactInfo()
58 assertTextPresent( "Info" );
59 assertLinkPresent( "Dependencies" );
60 assertLinkPresent( "Dependency Tree" );
61 assertLinkPresent( "Used By" );
62 assertLinkPresent( "Mailing Lists" );
64 assertEquals("Group ID", getSelenium().getTable("//table[1].0.0"));
65 assertEquals("org.apache.maven.archiva.web.test", getSelenium().getTable("//table[1].0.1"));
66 assertEquals("Artifact ID", getSelenium().getTable("//table[1].1.0"));
67 assertEquals("artifact-a", getSelenium().getTable("//table[1].1.1"));
68 assertEquals("Version", getSelenium().getTable("//table[1].2.0"));
69 assertEquals("1.0", getSelenium().getTable("//table[1].2.1"));
70 assertEquals("Packaging", getSelenium().getTable("//table[1].3.0"));
71 assertEquals("jar", getSelenium().getTable("//table[1].3.1"));
74 public void testBrowseArtifactDependencies()
78 clickLinkWithText( "Dependencies" );
79 assertLinkPresent( "Info" );
80 assertTextPresent( "Dependencies" );
81 assertLinkPresent( "Dependency Tree" );
82 assertLinkPresent( "Used By" );
83 assertLinkPresent( "Mailing Lists" );
85 assertPage( "Browse Repository" );
86 assertTextPresent( "artifact-a" );
87 assertLinkPresent( "artifact-b" );
90 public void testBrowseArtifactDependencyTree()
94 clickLinkWithText( "Dependency Tree" );
95 assertLinkPresent( "Info" );
96 assertLinkPresent( "Dependencies" );
97 assertTextPresent( "Dependency Tree" );
98 assertLinkPresent( "Used By" );
99 assertLinkPresent( "Mailing Lists" );
101 assertPage( "Browse Repository" );
102 assertTextPresent( "artifact-a" );
103 assertLinkPresent( "artifact-b" );
104 assertLinkPresent( "artifact-c" );
107 public void testBrowseArtifactUsedBy()
111 clickLinkWithText( "Used By" );
112 assertLinkPresent( "Info" );
113 assertLinkPresent( "Dependencies" );
114 assertLinkPresent( "Dependency Tree" );
115 assertTextPresent( "Used By" );
116 assertLinkPresent( "Mailing Lists" );
118 assertPage( "Browse Repository" );
119 assertTextPresent( "artifact-a" );
120 assertLinkPresent( "artifact-s" );
123 public void testBrowseArtifactMailingLists()
127 clickLinkWithText( "Mailing Lists" );
128 assertLinkPresent( "Info" );
129 assertLinkPresent( "Dependencies" );
130 assertLinkPresent( "Dependency Tree" );
131 assertLinkPresent( "Used By" );
132 assertTextPresent( "Mailing Lists" );
134 assertPage( "Browse Repository" );
135 assertTextPresent( "artifact-a" );
136 assertTextPresent( "No mailing lists" );
139 public void testBrowseUpRepositoryDirectory()
143 assertLinkPresent( "artifact-a" );
145 clickLinkWithText( "artifact-a" );
146 assertPage( "Browse Repository" );
147 assertTextPresent( "Browse Repository" );
148 assertTextPresent( "artifact-a" );
149 assertTextPresent( "Versions" );
150 assertLinkPresent( "1.0/" );
151 assertLinkPresent( "test" );
153 clickLinkWithText( "test" );
154 assertPage( "Browse Repository" );
155 assertTextPresent( "Browse Repository" );
156 assertTextPresent( "Artifacts" );
157 assertLinkPresent( "artifact-a/" );
158 assertLinkPresent( "web" );
160 clickLinkWithText( "web" );
161 assertPage( "Browse Repository" );
162 assertTextPresent( "Browse Repository" );
163 assertTextPresent( "Groups" );
164 assertLinkPresent( "org.apache.maven.archiva.web.test/" );
165 assertLinkPresent( "[top]" );
167 clickLinkWithText( "[top]" );
168 assertPage( "Browse Repository" );
169 assertTextPresent( "Browse Repository" );
170 assertTextPresent( "Groups" );
171 assertLinkPresent( "org.apache.maven.archiva.web.test/" );
174 public void testBrowseDependencyArtifact()
178 clickLinkWithText( "Dependencies" );
179 assertPage( "Browse Repository" );
180 assertTextPresent( "artifact-a" );
181 assertLinkPresent( "artifact-b" );
183 clickLinkWithText( "artifact-b" );
184 assertEquals("Group ID", getSelenium().getTable("//table[1].0.0"));
185 assertEquals("org.apache.maven.archiva.web.test", getSelenium().getTable("//table[1].0.1"));
186 assertEquals("Artifact ID", getSelenium().getTable("//table[1].1.0"));
187 assertEquals("artifact-b", getSelenium().getTable("//table[1].1.1"));
188 assertEquals("Version", getSelenium().getTable("//table[1].2.0"));
189 assertEquals("2.0", getSelenium().getTable("//table[1].2.1"));
190 assertEquals("Packaging", getSelenium().getTable("//table[1].3.0"));
191 assertEquals("jar", getSelenium().getTable("//table[1].3.1"));