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

utilities.allure.AllureBatchGenerator Maven / Gradle / Ivy

Go to download

An open-source Selenium Java-based Test automation Framework that allows you to perform multiple actions to test a web application's functionality, behaviour, which provides easy to use syntax, and easy to set up environment according to the needed requirements for testing

There is a newer version: 1.1.1
Show newest version
package utilities.allure;

import org.apache.commons.lang.SystemUtils;
import utilities.LoggingManager;

import java.io.*;
import java.nio.file.*;

public class AllureBatchGenerator {

    private AllureBatchGenerator(){

    }
    public static void generateBatFile(){
        Path file;
        if(SystemUtils.IS_OS_WINDOWS) {
            file = Paths.get("generateAllureReport.bat");
        }
        else {
            file = Paths.get("generateAllureReport.sh");
        }
        if(!Files.exists(file)){
            try {
                Files.writeString(file,"@echo off\n", StandardOpenOption.CREATE, StandardOpenOption.APPEND);
                Files.writeString(file,"allure serve target/allure-results\n", StandardOpenOption.CREATE,
                        StandardOpenOption.APPEND);
                Files.writeString(file,"pause\n", StandardOpenOption.CREATE, StandardOpenOption.APPEND);
                Files.writeString(file,"exit", StandardOpenOption.CREATE, StandardOpenOption.APPEND);
            } catch (IOException e) {
                LoggingManager.error("Unable to create Allure Batch File" + e.getMessage());
            }
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy