2011-02-03 15 views
5

मैं स्वचालन के लिए मेवेन कार्गो और सेलेनियम का उपयोग करता हूं। यहाँ कोड है:मेवेन कार्गो और सेलेनियम

<plugin> 
      <groupId>org.codehaus.cargo</groupId> 
      <artifactId>cargo-maven2-plugin</artifactId> 
      <version>1.0.5</version> 
      <configuration> 
       <wait>false</wait> 
       <container> 
        <containerId>tomcat6x</containerId> 
        <zipUrlInstaller> 
         <url> 
          http://mirrors.enquira.co.uk/apache/tomcat/tomcat-6/v6.0.30/bin/apache-tomcat-6.0.30.zip 
         </url> 
         <installDir>${installDir}</installDir> 
        </zipUrlInstaller> 
        <output> 
         ${project.build.directory}/tomcat6x.log 
        </output> 
        <log>${project.build.directory}/cargo.log</log> 
       </container> 
       <configuration> 
        <home> 
         ${project.build.directory}/tomcat6x/container 
        </home> 
        <properties> 
         <cargo.logging>high</cargo.logging> 
         <cargo.servlet.port>8081</cargo.servlet.port> 
        </properties> 
        <files> 
         <copy> 
          <file>${project.basedir}/src/main/resources/datasource.properties</file> 
          <todir>webapps</todir> 
          <configfile>true</configfile> 
          <overwrite>true</overwrite> 
         </copy> 
        </files> 
        <properties> 
         <customMessage>${catalina.home}</customMessage> 
        </properties> 
       </configuration> 
      </configuration> 
      <executions> 
       <execution> 
        <id>start-container</id> 
        <phase>pre-integration-test</phase> 
        <goals> 
         <goal>configure</goal> 
         <goal>start</goal> 
         <goal>deploy</goal> 
        </goals> 
        <configuration> 
         <deployer> 
          <deployables> 
           <deployable> 
            <groupId>${project.groupId}</groupId> 
            <artifactId>${project.artifactId}</artifactId> 
            <type>war</type> 
            <pingURL>**the url**</pingURL> 
            <pingTimeout>180000</pingTimeout> 
            <properties> 
             <context>**war-name**</context> 
            </properties> 
           </deployable> 
          </deployables> 
         </deployer> 
        </configuration> 
       </execution> 

       <execution> 
        <id>stop-container</id> 
        <phase>post-integration-test</phase> 
        <goals> 
         <goal>stop</goal> 
        </goals> 
       </execution> 
      </executions> 

लेकिन के रूप में युद्ध बड़ा हो रही शुरू कर दिया pingtimeout को बढ़ाने के लिए, मुझे नहीं पिंग टाइमआउट उपयोग करना चाहते हैं, लेकिन मैं इस समय के लिए मजबूर किया जा रहा हूँ, तैनाती समय का एक सा लेता है के रूप में शुरू और पेलटाइम का उल्लेख नहीं किया गया है और सेलेनियम इंतजार नहीं करता है।

क्या इस समस्या का कोई समाधान है?

+0

सका http://stackoverflow.com/questions/1498967/help-with-selenium-maven-cargo संबंधित हो? – Raghuram

उत्तर

1

जेट्टी का उपयोग करने के बारे में क्या? मेवेन-जेट्टी-प्लगइन तब तक इंतजार करेगा जब तक कि आपका वेबपैड लोड न हो जाए। वैकल्पिक रूप से, आप टॉमकैट प्रबंधक के माध्यम से चल रहे टॉमकैट इंस्टेंस में अपने वेबपैप को तैनात करने के लिए टॉमकैट-मेवेन-प्लगइन और इसके तैनाती लक्ष्य का उपयोग कर सकते हैं। युद्ध के तैनात होने तक यह प्लगइन निष्पादन (और इसलिए आपके सेलेनियम परीक्षणों का लॉन्च) के साथ भी इंतजार करेगा।

यह मेरी कॉन्फ़िगरेशन है। यह जेट्टी का शुभारंभ करेंगे आवेदन की तैनाती, सेलेनियम का शुभारंभ, सेलेनियम परीक्षण लॉन्च किया और अंत में सभी सर्वरों इस्तीफा:

<plugin> 
     <groupId>org.mortbay.jetty</groupId> 
     <artifactId>maven-jetty-plugin</artifactId> 
     <configuration> 
      <contextPath>/</contextPath> 
      <scanIntervalSeconds>0</scanIntervalSeconds> 
     </configuration> 
     <executions> 
      <execution> 
      <id>start</id> 
      <phase>pre-integration-test</phase> 
      <goals> 
       <goal>run</goal> 
      </goals> 
      <configuration> 
       <daemon>true</daemon> 
      </configuration> 
      </execution> 
      <execution> 
      <id>stop</id> 
      <phase>post-integration-test</phase> 
      <goals> 
       <goal>stop</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 

     <plugin> 
     <groupId>org.codehaus.mojo</groupId> 
     <artifactId>selenium-maven-plugin</artifactId> 
     <configuration> 
      <background>true</background> 
     </configuration> 
     <executions> 
      <execution> 
      <id>start-selenium</id> 
      <phase>pre-integration-test</phase> 
      <goals> 
       <goal>start-server</goal> 
      </goals> 
      </execution> 
      <execution> 
      <id>stop-selenium</id> 
      <phase>post-integration-test</phase> 
      <goals> 
       <goal>stop-server</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 

     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-surefire-plugin</artifactId> 
     <executions> 
      <execution> 
      <id>selenium-tests</id> 
      <phase>integration-test</phase> 
      <goals> 
       <goal>test</goal> 
      </goals> 
      <configuration> 
       <skip>false</skip> 
       <excludes> 
       <exclude>none</exclude> 
       </excludes> 
       <includes> 
       <include>**/*SeleniumTest.java</include> 
       </includes> 
      </configuration> 
      </execution> 
     </executions> 
     </plugin> 
संबंधित मुद्दे