
package com.qmetry.qaf.automation.util;

import static com.qmetry.qaf.automation.core.TestBaseProvider.instance;

import com.qmetry.qaf.automation.core.MessageTypes;

/**
 * This class provides utility methods to log message in report.
 * 
 * @author chirag
 */
public class Reporter {

	private Reporter() {

	}

	/**
	 * You can specify the message type with message. If message is with type
	 * {@link MessageTypes#Fail} the test case will get fail. When you want to
	 * create step within test case you can use {@link MessageTypes#TestStep}
	 * 
	 * @param msg
	 * @param type
	 */
	public static void log(String msg, MessageTypes type) {
		instance().get().addAssertionLog(msg, type);
	}

	// @QAFTestStep
	public static void log(String msg) {
		log(msg, MessageTypes.Info);
	}

	/**
	 * Capture screen shot and attach with message in report.
	 * 
	 * @param msg
	 * @param type
	 */
	public static void logWithScreenShot(String msg, MessageTypes type) {
		instance().get().addAssertionLogWithScreenShot(msg, type);
	}

	/**
	 * Capture screen shot and attach with message in report.
	 * 
	 * @param msg
	 */
	// @QAFTestStep
	public static void logWithScreenShot(String msg) {
		logWithScreenShot(msg, MessageTypes.Info);
	}

}
