首页 > 解决方案 > Serenity BDD 剧本登录示例

问题描述

我是 serenity BDD 的新手,无法理解这个概念,有人可以帮我一个使用剧本方法的简单登录屏幕示例。

这是我编写的代码,但我不确定我是否以正确的方式遵循该方法

@Before
    public void setTheStage() {
        OnStage.setTheStage(new OnlineCast());
    }

 @Given("^(.*) login in to qa")
    public void samLoginInToQa(String actor) {
        theActorCalled(actor).attemptsTo(NavigateTo.theQALoginPage());


        theActorInTheSpotlight().attemptsTo(loginPage.login());
    }

   public static Performable login() {
        return Task.where("{0} login to login",
                Enter.theValue("aaa").into(Login.USERNAMEFIELD),
                Enter.theValue("bbb").into(Login.PASSWORDFIELD),
                Click.on(Login.SUBMITBUTTON)
        );

标签: serenity-bddcucumber-serenityserenity-platform

解决方案


推荐阅读