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
25 public abstract class AbstractArchivaTestCase
26 extends AbstractSeleniumTestCase
28 private String baseUrl = "http://localhost:9696/archiva";
30 protected String getApplicationName()
35 protected String getInceptionYear()
40 protected void postAdminUserCreation()
42 if ( getTitle().equals( getTitlePrefix() + "Configuration" ) )
44 //Add Managed Repository
45 setFieldValue( "id", "test-repository" );
46 setFieldValue( "urlName", "test-repository" );
47 setFieldValue( "name", "Web UI Test Managed Repository" );
48 setFieldValue( "directory", getBasedir() + "/target/repository" );
49 clickButtonWithValue( "Add Repository" );
52 assertPage( "Configuration" );
53 setFieldValue( "indexPath", getBasedir() + "/target/index" );
54 clickButtonWithValue( "Save Configuration" );
55 assertPage( "Administration" );
59 public void assertHeader()
61 assertTrue( "banner is missing", getSelenium().isElementPresent( "xpath=//div[@id='banner']" ) );
62 assertTrue( "bannerLeft is missing",
63 getSelenium().isElementPresent( "xpath=//div[@id='banner']" + "/span[@id='bannerLeft']" ) );
64 assertTrue( "bannerLeft link is missing", getSelenium().isElementPresent(
65 "xpath=//div[@id='banner']" + "/span[@id='bannerLeft']/a[@href='http://maven.apache.org/archiva/']" ) );
66 assertTrue( "bannerLeft img is missing", getSelenium().isElementPresent( "xpath=//div[@id='banner']" +
67 "/span[@id='bannerLeft']/a[@href='http://maven.apache.org/archiva/']" + "/img[@src='" + getWebContext() +
68 "/images/archiva.png']" ) );
70 assertTrue( "bannerRight is missing",
71 getSelenium().isElementPresent( "xpath=//div[@id='banner']/span[@id='bannerRight']" ) );
74 protected String getTitlePrefix()
76 return "Maven Archiva :: ";
79 public String getBaseUrl()
84 protected String getWebContext()