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.Assert;
24 import org.testng.annotations.Test;
26 @Test( groups = { "appearance" }, dependsOnMethods = { "testWithCorrectUsernamePassword" }, sequential = true )
27 public class AppearanceTest
28 extends AbstractArchivaTest
30 public void testAddAppearanceEmptyValues()
33 clickLinkWithText( "Edit" );
34 addEditAppearance( "", "", "", false );
35 assertTextPresent( "You must enter a name" );
38 @Test( dependsOnMethods = { "testAddAppearanceEmptyValues" } )
39 public void testAddAppearanceInvalidValues()
42 clickLinkWithText( "Edit" );
43 addEditAppearance( "<>~+[ ]'\"", "/home/user/abcXYZ0129._/\\~:?!&=-<> ~+[ ]'\"",
44 "/home/user/abcXYZ0129._/\\~:?!&=-<> ~+[ ]'\"", false );
46 "Organisation name must only contain alphanumeric characters, white-spaces(' '), equals(=), question-marks(?), exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
47 assertTextPresent( "You must enter a URL" );
48 assertTextPresent( "You must enter a URL for your logo" );
51 @Test( dependsOnMethods = { "testAddAppearanceInvalidValues" } )
52 public void testAddAppearanceInvalidOrganisationName()
55 clickLinkWithText( "Edit" );
56 addEditAppearance( "<>~+[ ]'\"", "http://www.apache.org/", "http://www.apache.org/images/asf_logo_wide.gifs",
59 "Organisation name must only contain alphanumeric characters, white-spaces(' '), equals(=), question-marks(?), exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
62 public void testAddAppearanceInvalidOrganisationUrl()
65 clickLinkWithText( "Edit" );
66 addEditAppearance( "The Apache Software Foundation", "/home/user/abcXYZ0129._/\\~:?!&=-<> ~+[ ]'\"",
67 "http://www.apache.org/images/asf_logo_wide.gifs", false );
68 assertTextPresent( "You must enter a URL." );
72 public void testAddAppearanceInvalidOrganisationLogo()
75 clickLinkWithText( "Edit" );
76 addEditAppearance( "The Apache Software Foundation", "http://www.apache.org/",
77 "/home/user/abcXYZ0129._/\\~:?!&=-<> ~+[ ]'\"", false );
78 assertTextPresent( "You must enter a URL for your logo." );
81 @Test(enabled = false)
82 public void testAddAppearanceValidValues()
85 clickLinkWithText( "Edit" );
86 // FIXME: not allowed this URL for the logo?!
87 addEditAppearance( "The Apache Software Foundation", "http://www.apache.org/",
88 "http://www.apache.org/images/asf_logo_wide.gifs", true );
89 assertTextPresent( "The Apache Software Foundation" );
92 @Test( dependsOnMethods = { "testAddAppearanceValidValues" }, enabled = false)
93 public void testEditAppearance()
97 clickLinkWithText( "Edit" );
98 // FIXME: not allowed this URL for the logo?!
99 addEditAppearance( "Apache Software Foundation", "http://www.apache.org/",
100 "http://www.apache.org/images/asf_logo_wide.gifs", true );
101 assertTextPresent( "Apache Software Foundation" );