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

com.relevantcodes.extentreports.utils.ExtentUtil Maven / Gradle / Ivy

Go to download

ExtentReports is an open-source reporting library for test automation. It is very easily integrated with all test-frameworks (TestNG, JUnit, NUnit etc.) and provides better looking reports. Because Extent is created as a logging utility, it is also possible to use custom logs for each test, add snapshots & videos, assign categories and authors and filter using several parameters.

There is a newer version: 2.41.2
Show newest version
package com.relevantcodes.extentreports.utils;

import com.relevantcodes.extentreports.LogStatus;

public class ExtentUtil {
    public static LogStatus toLogStatus(String logStatus) {
        logStatus = logStatus.toLowerCase();
        
        if (logStatus.equals(LogStatus.PASS.toString())) {
            return LogStatus.PASS;
        }
        
        if (logStatus.equals(LogStatus.FAIL.toString())) {
            return LogStatus.FAIL;
        }
        
        if (logStatus.equals(LogStatus.FATAL.toString())) {
            return LogStatus.FATAL;
        }
        
        if (logStatus.equals(LogStatus.ERROR.toString())) {
            return LogStatus.ERROR;
        }
        
        if (logStatus.equals(LogStatus.WARNING.toString())) {
            return LogStatus.WARNING;
        }
        
        if (logStatus.equals(LogStatus.SKIP.toString())) {
            return LogStatus.SKIP;
        }
        
        if (logStatus.equals(LogStatus.INFO.toString())) {
            return LogStatus.INFO;
        }
        
        return LogStatus.UNKNOWN;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy