archiva-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marecor Baclay <marecor.bac...@gmail.com>
Subject Re: svn commit: r924673 - in /archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test: ArtifactManagementTest.java RepositoryTest.java parent/AbstractArchivaTest.java parent/AbstractRepositoryTest.jav
Date Tue, 06 Apr 2010 05:07:03 GMT
On Tue, Apr 6, 2010 at 12:46 PM, Brett Porter <brett@apache.org> wrote:

>
> On 18/03/2010, at 8:25 PM, mbaclay@apache.org wrote:
>
> > Author: mbaclay
> > Date: Thu Mar 18 09:25:09 2010
> > New Revision: 924673
> >
> > URL: http://svn.apache.org/viewvc?rev=924673&view=rev
> > Log:
> > [MRM-1323] archiva webapp tests failed to run in internet explorer
> > Submitted by: Gwen Harold Autencio
> >
> >
> > Modified:
> >
>  archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java
> >
>  archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/RepositoryTest.java
> >
>  archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArchivaTest.java
> >
>  archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractRepositoryTest.java
> >
> > Modified:
> archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java
> > URL:
> http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java?rev=924673&r1=924672&r2=924673&view=diff
> >
> ==============================================================================
> > ---
> archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java
> (original)
> > +++
> archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java
> Thu Mar 18 09:25:09 2010
> > @@ -96,15 +96,15 @@ public class ArtifactManagementTest
> >     @Test( groups = "requiresUpload" )
> >     public void testDotNetTypes()
> >     {
> > -        addArtifact( getGroupId(), "testDotNetTypes", getVersion(),
> "library", getArtifactFilePath(),
> > +        addArtifact( "dotNetTypes", "dotNetTypes", getVersion(),
> "library", getArtifactFilePath(),
> >                      getRepositoryId() );
> > -        assertTextPresent( "Artifact 'test:testDotNetTypes:1.0' was
> successfully deployed to repository 'internal'" );
> > -        getSelenium().open( baseUrl + "/browse/" + getGroupId() +
> "/testDotNetTypes/" + getVersion() );
> > +        assertTextPresent( "Artifact 'dotNetTypes:dotNetTypes:1.0' was
> successfully deployed to repository 'internal'" );
> > +        getSelenium().open( baseUrl + "/browse/" + "dotNetTypes" +
> "/dotNetTypes/" + getVersion() );
> >         waitPage();
> >
> >         assertTextPresent( "<type>library</type>" );
> >         String basePath =
> > -            "/archiva/repository/internal/" + getGroupId() +
> "/testDotNetTypes/" + getVersion() + "/testDotNetTypes-" +
> > +            "/archiva/repository/internal/" + "dotNetTypes" +
> "/dotNetTypes/" + getVersion() + "/dotNetTypes-" +
> >                 getVersion();
> >         assertLinkPresent( ".NET Library" );
> >         assertElementPresent( "//a[@href='" + basePath + ".dll']" );
>
> Why was this change necessary?
>

This change was made because, in firefox there are tests in search
with assertTextPresent( "Hits: 1 to 1 of 1" ); and with 2 tests
(testAddArtifactValidValues and testDotNetTypes) that uploads artifacts in
artifact test. The search test with assertTextPresent( "Hits: 1 to 1 of 1"
); fails because search display 2 hits because of the same groupId.


>
> >
> > Modified:
> archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/RepositoryTest.java
> > URL:
> http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/RepositoryTest.java?rev=924673&r1=924672&r2=924673&view=diff
> >
> ==============================================================================
> > ---
> archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/RepositoryTest.java
> (original)
> > +++
> archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/RepositoryTest.java
> Thu Mar 18 09:25:09 2010
> > @@ -29,7 +29,7 @@ public class RepositoryTest
> >       public void testAddManagedRepoValidValues()
> >       {
> >               goToRepositoriesPage();
> > -             clickLinkWithLocator(
> "//div[@id='contentArea']/div/div/a[@href='/archiva/admin/addRepository.action']"
> );
> > +             clickLinkWithText( "Add" );
> >               addManagedRepository( "managedrepo1", "Managed Repository
> Sample 1" , getRepositoryDir() + "repository/" , "", "Maven 2.x Repository",
> "0 0 * * * ?", "", "" );
> >               clickButtonWithValue( "Save" );
> >               assertTextPresent( "Managed Repository Sample 1" );
> > @@ -40,7 +40,7 @@ public class RepositoryTest
> >       public void testAddManagedRepoInvalidValues()
> >       {
> >               goToRepositoriesPage();
> > -         clickLinkWithLocator(
> "//div[@id='contentArea']/div/div/a[@href='/archiva/admin/addRepository.action']"
> );
> > +         clickLinkWithText( "Add" );
> >               addManagedRepository( "", "" , "" , "", "Maven 2.x
> Repository", "", "", "" );
> >               assertTextPresent( "You must enter a repository
> identifier." );
> >               assertTextPresent( "You must enter a repository name." );
>
> would it be better to just always use 'open' here, like below?
>

Yup, it would be better to use 'open'. Thanks!


>
> > @@ -105,7 +105,7 @@ public class RepositoryTest
> >       @Test(dependsOnMethods = { "testAddRemoteRepoValidValues" } )
> >       public void testAddRemoteRepoNullValues()
> >       {
> > -         clickLinkWithLocator(
> "//div[@id='contentArea']/div/div/a[@href='/archiva/admin/addRemoteRepository.action']"
> );
> > +         getSelenium().open( "/archiva/admin/addRemoteRepository.action"
> );
> >               addRemoteRepository( "" , "" , "" , "" , "" , "" , "Maven
> 2.x Repository" );
> >               assertTextPresent( "You must enter a repository
> identifier." );
> >               assertTextPresent( "You must enter a repository name." );
> > @@ -136,7 +136,7 @@ public class RepositoryTest
> >       @Test(dependsOnMethods = { "testDeleteManageRepo" } )
> >       public void testAddRemoteRepoValidValues()
> >       {
> > -             clickLinkWithLocator(
> "//div[@id='contentArea']/div/div/a[@href='/archiva/admin/addRemoteRepository.action']"
> );
> > +             getSelenium().open(
> "/archiva/admin/addRemoteRepository.action" );
> >               addRemoteRepository( "remoterepo" , "Remote Repository
> Sample" , "http://repository.codehaus.org/org/codehaus/mojo/" , "" , "" ,
> "" , "Maven 2.x Repository" );
> >               assertTextPresent( "Remote Repository Sample" );
> >       }
> >
>
> - Brett
> --
> Brett Porter
> brett@apache.org
> http://brettporter.wordpress.com/
>
>
>
>
>

I am still reviewing the scripts now and will try to improve it as per
MRM-1276. Thanks!


--
Cora

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message