TeamCity fails to run iOS appium tests when auto-launched - ios

Description
We are using appium in our cucumber suite within TeamCity 8 on an Apple MacMini running Mavericks. The problem is that appium seems to fail to interact with the iOS Simulator when it is ran from TeamCity at login (via Automator).
The only combination that I have found to work is to run the following from the Terminal in an interactive session:
sh /Applications/buildagent/bin/agent.sh start
What does not work?
running agent.sh start from an ssh session
creating a shell script with Automator that launches at login (the macmini is set to login automatically)
Theory
My theory is that it has something to do with Preferences -> Security & Privacy -> Accessibility. The only way that it works when launching from Terminal is if Terminal is added to this list of allowed applications. I'm not sure what I need to add to this list in order for this to work automatically at login.
Any help would be greatly appreciated.

Many iOS tests will not run without an interactive session. For example, unit tests using the iOS simulator will not work.
Edit: By interactive session, I mean the TeamCity agent must be started from the desktop, not via an SSH session. Otherwise nothing can communicate with the Simulator.

You are correct, you need to allow Appium to interact with Automator.
Solutions straight from the documentation:
If you're running Appium from an NPM install: sudo authorize_ios
If you're running Appium from source: sudo grunt authorize
If you are running Appium.app, you can authorize iOS through the GUI. This prompt pops up the first time you click "Launch/Run" on the GUI and it tries to open the simulator

Related

iOS app not uninstall and reinstalling between tests on Browserstack App Automate

Currently running a smoke test suite on IntelliJ against Browserstack App Automate (Java, Appium, and Cucumber to write the test files).
The issue comes from running iOS tests as a series/suite. When one test ends and another begins, the app hasn't reset or reinstalled and starts from where the other app ended (with a new user created). For each test, we need the app to start from afresh and this doesn't seem to be happening. Android tests for our app work just fine, but this issue only happens when running them on iOS.
Has anyone encountered a similar issue?
Could you execute the tests by setting the capability "fullReset" to "true". Read more on this in the link: http://appium.io/docs/en/writing-running-appium/other/reset-strategies/index.html
Then execute the command "driver.resetApp()" after the execution of one test and before the beginning of the second?

I am using appium.app on mac how to open more than one session to run with different ports

I want to run the appium with different ports i am using appium.app on mac desktop.how to run with different ports any ideas..?
What do you mean to run appium with different ports? In case you're using the app, you set the port before you start the server.
In case you meant to run multiple appium sessions with different ports, I've installed appium using npm and then started my servers from command line
I guess you are talking about attaching more than one device and then executing the scripts in parallel on all devices like the selenium grid.
You can go through this link, which is appum's official documentation for setting up selenium grid for mobile automation.

Running appium scripts for ios in parallel

I have two mac machines with all the setup installed for appium. I want to run the appium scripts on two ios simulators in parallel.It is not possible in one mac machine by launching two simulators in parallel because mac uses only one instrument instance at a time.
Is there any way to approach this by using two machines?
Thanks.
For android you can run two emulators in parallel, So u can establish two appium sessions and run the scripts in parallel.But coming to ios xcode won't allow you to run the simulators in parallel.
You could use the Selenium grid to handle your two machines, as instructed at https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/grid.md
Otherwise you'll need to create a driver session against each of the servers in your script. To target a specific Appium server, simply change the url:port combination to match either of your servers when creating the Appium webdriver object/session.
As of now,
http://appium.io/docs/en/advanced-concepts/parallel-tests/
"With Xcode9 Appium supports parallel RealDevice and Simulator testing." for iOS

Can Jenkins start up GenyMotion on Ubuntu 14, if I access the Jenkins website from my Mac?

Is it possible for this setting to work?
1) Ubuntu 14 with Jenkins, Genymotion, and Virtual Box installed
2) The job inside Jenkins will restore and run Genymotion from a command line following this tutorial: http://blog.genymobile.com/genymotion-jenkins-android-testing/
From my Mac, I tried to access the Jenkins website and run the build.
Firstly, Genymotion failed because it couldn't "connect to X server".
So, I installed Xvnc Plugin on Jenkins which solved the error.
Unfortunately, Genymotion still failed to start up with the error "Cannot get IP address".
Please note that I only have "ssh -X" access to the server.
I can manually start up Genymotion but the process was terminated when I logged off. As a result, I could not leave the GenyMotion run on the Server as suggested by this solution: Jenkins - Use Genymotion VM instead of Android Emulator
Any advice?
Here is the way to make Genymotion works on a continuous integration server.
First, the computer running Genymotion needs to respect the hardware requirements
You won't be able to run Genymotion if you don't have an X server running.
I don't think xVNC supports OpenGL so I advise you to run your standard X server.
You can launch the Xorg server by running startx.
Then you need to set your ssh connection in Jenkins without the -X parameter because we want the rendering to be done locally
Then you need to declare the environement variable DISPLAY to the default X client's value. Most of the time it is :0
This value will ask to open all the windows you launch through the ssh connexion into the first X client. It is the one running on the computer screen.
To check the DISPLAY value you need to enter, you need to access the computer physically and type echo $DISPLAY. Most of the time this value is :0
Also, if your computer is not compatible with the hardware requirements, you can use another computer on your network to run your tests thanks to the Jenkins nodes. Here is a good tutorial to set it up.
And finally, I want to mention we will soon release a command line tool for Genymotion and a Gradle Plugin that will allows you to control your Genymotion devices running during your tests directly from your build.gradle file.
It`s a bit late, but maybe this could help you out
### Get IP address of selected VM
VM_IP=`VBoxManage guestproperty get $VM_SELECTED androvm_ip_management | awk - F ": " '{print $2}'`
I found this here (repo) respectively here (slides)

What happens to TFS Build service when running in Interactive Mode?

I am trying to setup a build agent to build my Win8 app, which I'm told I should be able to do on a Server 2012 machine.
Everything was going well, until the step told me to stop the build service and run it in 'interactive mode'.
What this appears to do, it make the service run with a command prompt saying "I'm running in interactive mode, press escape when done" (When I pressed escape the build service stopped).
My question is this, if I need to run the build service in interactive mode for win8 builds, how will I cope for the inevitable situation when the server restarts, or some admin logs the user out? presumably the build service will stop.
Is there a better way to handle this?
unless there is a specific reason why you need to run in interactive mode, i was building win8 apps all last year on a 2012 server running with out interactive mode and it ran fine. try it without and see what happens

Resources