How do I start app server and emulators from jenkins and then run selenium test cases?

How do I start app server and emulators from jenkins and then run selenium test scripts?

You need to start the Maven project I created for Mobile Automation from Jenkins, but without manual intervention. Launch Appium server and emulator.

+3


source to share


3 answers


Not much detail in your question, but coming soon:

  • Create Jenkins job.
  • Accurately locate source code to build and run
  • Add build step to run Appium (command depends on your environment)
  • Add a build step to run the emulator ( emulator -avd your_emulator_name

    or use Genymotion)
  • Add build step for calling maven command (clean test)


Don't forget to start Appium and run the emulator as background processes, otherwise it will block the task from running. The format of the commands depends on your environment (Linux or Win). You may need to insert a time delay to allow the emulator to initialize (and again the command format depends on your OS). Hope this makes sense to you.

+3


source


Make a Jenkins Job that will check the project in the target environment, build it and then run a script that will invoke the appium command that points to the embedded application, and then run the selenium command to start the tests.



0


source


You can take a look at this appium maven plugin:

https://github.com/Ardesco/appium-maven-plugin

It will start Appium before running tests and then shutdown it. You can also use a Maven profile to prevent it from happening all the time.

<plugin>
<groupId>com.lazerycode.appium</groupId>
<artifactId>appium-maven-plugin</artifactId>
<version>0.2.0</version>
<configuration>
    <nodeDefaultLocation>${project.basedir}/src/test/node</nodeDefaultLocation>
    <appiumLocation>${project.basedir}/src/test/node_modules/appium</appiumLocation>
</configuration>
<executions>
    <execution>
        <id>start appium</id>
        <phase>pre-integration-test</phase>
        <goals>
            <goal>start</goal>
        </goals>
    </execution>
    <execution>
        <id>stop appium</id>
        <phase>post-integration-test</phase>
        <goals>
            <goal>stop</goal>
        </goals>
    </execution>
</executions>

      

You can use frontend-maven-plugin to download Appium if you don't have it locally (more info in the link above)

0


source







All Articles