continue work on selenium test with id rather than label

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1138210 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2011-06-21 22:13:49 +00:00
parent 1666960349
commit 8095a5ff97
8 changed files with 21 additions and 15 deletions

View File

@ -154,7 +154,7 @@ public abstract class AbstractUpdatePolicy
if ( !localFile.exists() ) if ( !localFile.exists() )
{ {
// No file means it's ok. // No file means it's ok.
log.debug( "OK to update " + getUpdateMode() + ", local file does not exist." ); log.debug( "OK to update {}, local file does not exist.", getUpdateMode() );
return; return;
} }

View File

@ -434,12 +434,15 @@ public abstract class AbstractArchivaTest
public void assertFindArtifactPage() public void assertFindArtifactPage()
{ {
assertPage( "Apache Archiva \\ Find Artifact" ); //assertPage( "Apache Archiva \\ Find Artifact" );
assertTextPresent( "Find Artifact" ); assertElementPresent( "searchBox" );
assertTextPresent( "Search for:" ); //assertTextPresent( "Find Artifact" );
assertTextPresent( "Checksum:" ); //assertTextPresent( "Search for:" );
assertElementPresent( "q" ); //assertTextPresent( "Checksum:" );
assertButtonWithValuePresent( "Search" ); assertElementPresent( "quickSearchValue" );
assertElementPresent( "searchHint" );
//assertButtonWithValuePresent( "Search" );
assertElementPresent( "quickSearchSubmit" );
} }
// Appearance // Appearance
@ -490,14 +493,18 @@ public abstract class AbstractArchivaTest
"Upload Artifact,Group Id*:,Artifact Id*:,Version*:,Packaging*:,Classifier:,Generate Maven 2 POM,Artifact File*:,POM File:,Repository Id:"; "Upload Artifact,Group Id*:,Artifact Id*:,Version*:,Packaging*:,Classifier:,Generate Maven 2 POM,Artifact File*:,POM File:,Repository Id:";
String[] arrayArtifact = artifact.split( "," ); String[] arrayArtifact = artifact.split( "," );
for ( String arrayartifact : arrayArtifact ) for ( String arrayartifact : arrayArtifact )
{
assertTextPresent( arrayartifact ); assertTextPresent( arrayartifact );
}
String artifactElements = String artifactElements =
"upload_groupId,upload_artifactId,upload_version,upload_packaging,upload_classifier,upload_generatePom,upload_artifact,upload_pom,upload_repositoryId,upload_0"; "upload_groupId,upload_artifactId,upload_version,upload_packaging,upload_classifier,upload_generatePom,upload_artifact,upload_pom,upload_repositoryId,uploadSubmit";
String[] arrayArtifactElements = artifactElements.split( "," ); String[] arrayArtifactElements = artifactElements.split( "," );
for ( String artifactelements : arrayArtifactElements ) for ( String artifactelements : arrayArtifactElements )
{
assertElementPresent( artifactelements ); assertElementPresent( artifactelements );
} }
}
public void addArtifact( String groupId, String artifactId, String version, String packaging, public void addArtifact( String groupId, String artifactId, String version, String packaging,
String artifactFilePath, String repositoryId ) String artifactFilePath, String repositoryId )

View File

@ -52,8 +52,7 @@ public abstract class AbstractSearchTest
{ {
goToSearchPage(); goToSearchPage();
getSelenium().type( "dom=document.forms[1].elements[0]", artifactId ); setFieldValue( "quickSearchValue", artifactId );
//clickButtonWithValue( "Search" );
clickButtonWithLocator( "quickSearchSubmit" ); clickButtonWithLocator( "quickSearchSubmit" );
} }

View File

@ -169,7 +169,7 @@
<props> <props>
<prop key="org.quartz.scheduler.instanceName">scheduler1</prop> <prop key="org.quartz.scheduler.instanceName">scheduler1</prop>
<prop key="org.quartz.threadPool.class">org.quartz.simpl.SimpleThreadPool</prop> <prop key="org.quartz.threadPool.class">org.quartz.simpl.SimpleThreadPool</prop>
<prop key="org.quartz.threadPool.threadCount">1</prop> <prop key="org.quartz.threadPool.threadCount">2</prop>
<prop key="org.quartz.threadPool.threadPriority">4</prop> <prop key="org.quartz.threadPool.threadPriority">4</prop>
<prop key="org.quartz.jobStore.class">org.quartz.simpl.RAMJobStore</prop> <prop key="org.quartz.jobStore.class">org.quartz.simpl.RAMJobStore</prop>
</props> </props>

View File

@ -226,7 +226,7 @@
<td><s:checkbox name="scanAll" value="scanAll"/>Process All Artifacts</td> <td><s:checkbox name="scanAll" value="scanAll"/>Process All Artifacts</td>
</tr> </tr>
<tr> <tr>
<td><s:submit value="Scan Repository Now"/></td> <td><s:submit value="Scan Repository Now" id="scanRepoNow%{#attr.repository.id}"/></td>
</tr> </tr>
</table> </table>
</s:form> </s:form>

View File

@ -80,7 +80,7 @@
<div id="topSearchBox"> <div id="topSearchBox">
<s:form method="get" action="quickSearch" namespace="/" validate="true"> <s:form method="get" action="quickSearch" namespace="/" validate="true" id="quickSearchBoxForm">
<s:textfield id="quickSearchBox" label="Search for" size="30" name="q"/> <s:textfield id="quickSearchBox" label="Search for" size="30" name="q"/>
</s:form> </s:form>
</div> </div>

View File

@ -95,7 +95,7 @@
<c:url var="iconCreateUrl" value="/images/icons/create.png" /> <c:url var="iconCreateUrl" value="/images/icons/create.png" />
<s:form method="get" id="quickSearch" action="quickSearch" validate="true"> <s:form method="get" id="quickSearch" action="quickSearch" validate="true">
<s:textfield label="Search for" size="50" name="q"/> <s:textfield label="Search for" size="50" name="q" id="quickSearchValue"/>
<s:hidden name="completeQueryString" value="%{completeQueryString}"/> <s:hidden name="completeQueryString" value="%{completeQueryString}"/>
<s:submit value="Search" id="quickSearchSubmit"/> <s:submit value="Search" id="quickSearchSubmit"/>
</s:form> </s:form>

View File

@ -115,7 +115,7 @@
<s:submit label="Go!"/> <s:submit label="Go!"/>
</s:form> </s:form>
<script type="text/javascript"> <script type="text/javascript">
document.getElementById("quickSearch_q").focus(); document.getElementById("quickSearchValue").focus();
</script> </script>
</c:if> </c:if>