All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.testobject.appium.common.AppiumResource Maven / Gradle / Ivy

There is a newer version: 0.2.7
Show newest version
package org.testobject.appium.common;

import org.openqa.selenium.remote.SessionId;
import org.testobject.appium.internal.RestClient;

import javax.ws.rs.core.MediaType;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public class AppiumResource {

	private final RestClient client;

	public AppiumResource(RestClient client) {
		this.client = client;
	}

	public void updateTestReportStatus(SessionId sessionId, boolean passed) {
		client
				.path("session")
				.path(sessionId.toString())
				.path("test").type(MediaType.APPLICATION_JSON_TYPE)
				.put(Collections.singletonMap("passed", passed));
	}

	public void updateTestReportName(SessionId sessionId, String suiteName, String testName) {
		Map values = new HashMap();
		values.put("suiteName", suiteName);
		values.put("testName", testName);

		client
				.path("session")
				.path(sessionId.toString())
				.path("test")
				.type(MediaType.APPLICATION_JSON_TYPE)
				.put(Collections.singletonMap("passed", values));
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy