How can I install * .apk from jenkins on a real device using Appium and run tests written in python?
I have a BDD test automation system with cucumber and python that behave for testing Android mobile apps. I want to set up a jenkins job in which I can start the appium server and start the android mobile app and run the test execution. Can anyone help with this? Thanks in advance.
source to share
Step 1: install Jenkins on your system, go to Jenkins url in browser. In my local I am accessing Jenkins using " http: // localhost: 8080 "
Step 2: Click New Item> Freestyle Project> OK
Step 3: Go to Build> Add Build Step> Run Shell and enter the following commands:
#!/bin/bash --login -x
appium &
sleep 5s
Step 4: Click "Create Now".
Step 5. Open the current job> "Console Output" to make sure the Appium server is running.
The console logs should display the following text:
[Appium] Welcome to Appium v1.6.4
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
Step 6: All test scripts should be placed in the Jenkins "workspace" directory. My scripts are in this location: / Users / Shared / Jenkins / Home / workspace / appium-android /
Step 7: I am using pytest, so my command looks like this:
cd $WORKSPACE
pytest /Users/Shared/Jenkins/Home/workspace/appium-android/tests/listings/test_listing_create.py
Run the command to execute the command.
to answer this: start the android mobile app.
Appium should take care of app launch
Make sure all dependencies like Python, Appium python client, Appium server, behave etc. are installed on Jenkins machine.
source to share