Running appium test suite for ios from jenkins slace


#1

When i am trying to run appium ios test suite from jenkins slave, while starting the webdriver agent, it says Carthage binaries not found. I have configured CARTHAGE_HOME environment variable at the node level but still its not able to find it. Here the build tool used is maven. I am on appium 1.9.1. Please help. Thanks in advance.


#2

I have the same problem when I try to start the appium server programatically from node, before suite. Carthage not found even is installed.
Works if the server is already started from desktop appium.
If anyone has some solution would be great.


#3

i dont have any issue in starting appium server. I am facing problem when the test starts running on ios simulator. To run the test, it needs to install WDA on simulator. Since WDA needs carthage, here its throwing error that the carthage binaries not found. This issue is only happening when starting the test from jenkins machine using node slave. My node is a Mac machine. When i am running the test directly on Mac, its working fine.


#4

@sampadrout it cause the way your slave mac connects to jenkins. It does not take environment with it.
To check this try:

  • in terminal on slave print: “echo $PATH”
  • add in test job same step

Compare result. You will see that in test job all paths are lost.

You need either:

  • to set path in jenkins job
  • or took environment with you while slave connecting to jenkins ( how you connecting?)

#5

Thanks a lot @Aleksei. I did fix it. I have added one env injection in the build step of the jenkins job. Its like CARTHAGE_HOME = usr/local/bin. This appended with the Path during build. Now WDA is finding the Carthage to start itself in the iOS simulator. Thanks again for the response.


#6

@Zuzeac I am using Serenity-BDD+Cucumber+Appium for the project. Here i have a library function which starts appium. Then instantiate this in @Beforeclass (JUNIT annotation) or you can do it @BeforeSuite in case of TestNG.
import io.appium.java_client.service.local.AppiumDriverLocalService;
import io.appium.java_client.service.local.AppiumServiceBuilder;
import io.appium.java_client.service.local.flags.GeneralServerFlag;

import static io.appium.java_client.service.local.AppiumDriverLocalService.buildService;

import java.io.File;

public final class AppiumServer {
private final static AppiumDriverLocalService service;

static {
	service = buildService(new AppiumServiceBuilder()
			.withIPAddress("127.0.0.1")
			.usingPort(Integer.parseInt("4723"))
			.withAppiumJS(new File("/usr/local/lib/node_modules/appium/build/lib/main.js"))				
			.withArgument(GeneralServerFlag.LOG_LEVEL, "info"));
}

public static void startAppiumServer() {
	try{
		service.start();
	}catch(Exception e){
		e.printStackTrace();
	}
}

public static void stopAppiumServer() {
	try{
		if (service.isRunning()) {
			service.stop();
		}
	}catch(Exception e){
		e.printStackTrace();
	}
}

}
Use it as below:
public class RegressionTest {

@BeforeClass
public static void setUp() throws IOException, Exception {
    startAppiumServer();
}

@AfterClass
public static void tearDown() throws IOException {
    stopAppiumServer();
}   

}