Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services 如何从AWS Lambda Handler运行Cumber Runner_Amazon Web Services_Lambda_Junit_Cucumber_Runner - Fatal编程技术网

Amazon web services 如何从AWS Lambda Handler运行Cumber Runner

Amazon web services 如何从AWS Lambda Handler运行Cumber Runner,amazon-web-services,lambda,junit,cucumber,runner,Amazon Web Services,Lambda,Junit,Cucumber,Runner,我试图在AWS Lambda中使用Selenium Webdriver运行Cucumber runner类。到目前为止,我已经能够在AWS处理程序函数中运行selenium,但是如何从HandlerRequest调用Cucumber Runner以便在Lambda中运行测试呢 以下是我的代码片段: // following class is entry point for AWS, I need to call Cucumber runner from this function. public

我试图在AWS Lambda中使用Selenium Webdriver运行Cucumber runner类。到目前为止,我已经能够在AWS处理程序函数中运行selenium,但是如何从HandlerRequest调用Cucumber Runner以便在Lambda中运行测试呢

以下是我的代码片段:

// following class is entry point for AWS, I need to call Cucumber runner from this function.
public class **LambdaFunctionHandler** implements RequestHandler<Object, String> {

    private AmazonS3 s3 = AmazonS3ClientBuilder.standard().build();

    @Override
    public String handleRequest(Object input, Context context) {        
        context.getLogger().log("Input: " + input);
        try {

            runner();  // how do I call my Cucumber Runner Class to execute my tests?

        catch (Exception e) {
            e.printStackTrace(System.out);
            context.getLogger().log(e.getMessage());
        }

        return "request done";
    }

The following is the runner class
package runner;

import cucumber.api.CucumberOptions;

import cucumber.api.junit.Cucumber;

import org.junit.runner.RunWith;

@RunWith(Cucumber.class)

@CucumberOptions(
        features = "src\\test\\resources\\features"
        ,glue={"com.smallcomp.abc.steps"}
        ,format = {"json:target/cucumber.json","html:target/cucumber-pretty"}
        ,dryRun = false
        ,tags = {"@smoke"}
)


public class runner {

}
//下面的类是AWS的入口点,我需要从这个函数调用Cucumber runner。
公共类**lambdFunctionHandler**实现RequestHandler{
私有AmazonS3 s3=AmazonS3ClientBuilder.standard().build();
@凌驾
公共字符串handleRequest(对象输入,上下文){
context.getLogger().log(“输入:”+Input);
试一试{
runner();//如何调用Cucumber runner类来执行测试?
捕获(例外e){
e、 printStackTrace(系统输出);
context.getLogger().log(如getMessage());
}
返回“请求完成”;
}
以下是跑步者课程
打包机;
进口cucumber.api.CucumberOptions;
进口cucumber.api.junit.cucumber;
导入org.junit.runner.RunWith;
@RunWith(cumber.class)
@黄瓜选项(
features=“src\\test\\resources\\features”
,glue={“com.smallcomp.abc.steps”}
,format={“json:target/cucumber.json”,“html:target/cucumber-pretty”}
,dryRun=false
,tags={@smoke}
)
公开课跑者{
}