Author: skygo
Date: Wed Mar 5 01:07:27 2014
New Revision: 1574275
URL: http://svn.apache.org/r1574275
Log:
a few repository test workflow + update selenium
Added:
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java
- copied, changed from r1571885,
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/LoginTest.java
Modified:
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/pom.xml
Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/pom.xml
URL:
http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/pom.xml?rev=1574275&r1=1574274&r2=1574275&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/pom.xml
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/pom.xml Wed
Mar 5 01:07:27 2014
@@ -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>
Copied:
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java
(from r1571885,
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/LoginTest.java)
URL:
http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java?p2=archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java&p1=archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/LoginTest.java&r1=1571885&r2=1574275&rev=1574275&view=diff
==============================================================================
---
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/LoginTest.java
(original)
+++
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java
Wed Mar 5 01:07:27 2014
@@ -20,68 +20,64 @@ package org.apache.archiva.web.test;
*/
import org.apache.archiva.web.test.parent.AbstractArchivaTest;
+import org.junit.Assert;
import org.junit.Test;
/**
* Based on LoginTest of Emmanuel Venisse test.
*
- * @author José Morales MartÃnez
+ * @author skygo
*
*/
-public class LoginTest
+public class RepositoryAdminTest
extends AbstractArchivaTest
{
@Test
- public void testWithBadUsername()
+ public void testManagedRepository()
{
- goToLoginPage();
- setFieldValue( "user-login-form-username", "badUsername" );
- clickLinkWithLocator( "modal-login-ok", true );
- assertTextPresent( "This field is required." );
-
- }
-
- @Test
- public void testWithBadPassword()
- {
- goToLoginPage();
- setFieldValue( "user-login-form-username", getProperty(
"ADMIN_USERNAME" ) );
- setFieldValue( "user-login-form-password", "badPassword" );
- clickLinkWithLocator( "modal-login-ok", true );
- assertTextPresent( "You have entered an incorrect username and/or
password" );
- }
-
- @Test
- public void testWithEmptyUsername()
- {
- goToLoginPage();
- setFieldValue( "user-login-form-password", "password" );
- clickLinkWithLocator( "modal-login-ok", true );
- assertTextPresent( "This field is required." );
- }
-
- @Test
- public void testWithEmptyPassword()
- {
- goToLoginPage();
- setFieldValue( "user-login-form-username", getProperty(
"ADMIN_USERNAME" ) );
- clickLinkWithLocator( "modal-login-ok", true );
- assertTextPresent( "This field is required." );
- }
-
- @Test
- public void testWithCorrectUsernamePassword()
- {
- goToLoginPage();
- setFieldValue( "user-login-form-username", getProperty(
"ADMIN_USERNAME" ) );
- setFieldValue( "user-login-form-password", getProperty(
"ADMIN_PASSWORD" ) );
- clickLinkWithLocator( "modal-login-ok", true );
-
- assertUserLoggedIn( getProperty( "ADMIN_USERNAME" ) );
+ 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