diff options
author | skygo <skygo@unknown> | 2014-03-05 01:07:27 +0000 |
---|---|---|
committer | skygo <skygo@unknown> | 2014-03-05 01:07:27 +0000 |
commit | 79045ba70be0031bff5d238e816bbf6e09652e5b (patch) | |
tree | 632200502963173b64c96f2aa410f3c98b0fb3da /archiva-modules | |
parent | 3f378e23fd6b668d54c85510972d020255f962e5 (diff) | |
download | archiva-79045ba70be0031bff5d238e816bbf6e09652e5b.tar.gz archiva-79045ba70be0031bff5d238e816bbf6e09652e5b.zip |
a few repository test workflow + update selenium
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1574275 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r-- | archiva-modules/archiva-web/archiva-webapp-test/pom.xml | 7 | ||||
-rw-r--r-- | archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java | 83 |
2 files changed, 87 insertions, 3 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/pom.xml b/archiva-modules/archiva-web/archiva-webapp-test/pom.xml index e9be5d987..f5d558073 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/pom.xml +++ b/archiva-modules/archiva-web/archiva-webapp-test/pom.xml @@ -36,7 +36,8 @@ <maxWaitTimeInMs>10000</maxWaitTimeInMs> <seleniumPluginVersion>2.3</seleniumPluginVersion> - <selenium-server.version>2.37.1</selenium-server.version> + <selenium-server.version>2.40.0</selenium-server.version> + <fluentlenium.version>0.9.2</fluentlenium.version> </properties> <dependencies> @@ -84,7 +85,7 @@ <dependency> <groupId>org.fluentlenium</groupId> <artifactId>fluentlenium-festassert</artifactId> - <version>0.9.1</version> + <version>${fluentlenium.version}</version> <scope>test</scope> </dependency> @@ -96,7 +97,7 @@ <dependency> <groupId>org.fluentlenium</groupId> <artifactId>fluentlenium-core</artifactId> - <version>0.9.1</version> + <version>${fluentlenium.version}</version> <scope>test</scope> </dependency> diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java new file mode 100644 index 000000000..7bdca2278 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java @@ -0,0 +1,83 @@ +package org.apache.archiva.web.test; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.archiva.web.test.parent.AbstractArchivaTest; +import org.junit.Assert; +import org.junit.Test; + +/** + * Based on LoginTest of Emmanuel Venisse test. + * + * @author skygo + * + */ + + +public class RepositoryAdminTest + extends AbstractArchivaTest +{ + + @Test + public void testManagedRepository() + { + login( getAdminUsername(), getAdminPassword() ); + clickLinkWithLocator( "menu-repositories-list-a", true ); + + // add custom repo + assertTextPresent( "Repositories Administration " ); + clickLinkWithXPath( "//a[@href='#remote-repositories-content']", true ); + + clickLinkWithXPath( "//a[@href='#remote-repository-edit']", true ); + + setFieldValue( "id", "myrepoid" ); + setFieldValue( "name", "My repo name" ); + setFieldValue( "url", "http://www.repo.org" ); + + clickButtonWithLocator( "remote-repository-save-button", true ); + + clickLinkWithLocator( "menu-proxy-connectors-list-a", true ); + + // proxy connect + assertTextPresent( "Proxy Connectors" ); + assertTextPresent( "central" ); + assertTextNotPresent( "myrepoid" ); + clickButtonWithLocator( "proxy-connectors-view-tabs-a-edit", true ); + getSelenium().select( "sourceRepoId", "internal" ); + getSelenium().select( "targetRepoId", "myrepoid" ); + clickButtonWithLocator( "proxy-connector-btn-save", true); + assertTextPresent( "central" ); + assertTextPresent( "myrepoid" ); + clickLinkWithXPath( "//i[contains(concat(' ',normalize-space(@class),' '),' icon-resize-vertical ')]/../..", true ); + assertTextPresent( "internal" ); + // order test + Assert.assertTrue( "First repo is myrepo",getSelenium().getText("xpath=//div[@id='proxy-connector-edit-order-div']/div[1]" ).contains( "myrepoid" )); + Assert.assertTrue( "Second repo is central",getSelenium().getText("xpath=//div[@id='proxy-connector-edit-order-div']/div[2]" ).contains( "central" )); + + // works until this point + /*getSelenium().mouseDown( "xpath=//div[@id='proxy-connector-edit-order-div']/div[1]" ); + getSelenium().mouseMove( "xpath=//div[@id='proxy-connector-edit-order-div']/div[2]" ); + getSelenium().mouseUp( "xpath=//div[@id='proxy-connector-edit-order-div']/div[last()]" ); + Assert.assertTrue( "Second repo is myrepo", getSelenium().getText("xpath=//div[@id='proxy-connector-edit-order-div']/div[2]" ).contains( "myrepoid" )); + Assert.assertTrue( "First repo is central", getSelenium().getText("xpath=//div[@id='proxy-connector-edit-order-div']/div[1]" ).contains( "central" )); + */ + } + +}
\ No newline at end of file |