简体   繁体   中英

Serenity BDD Getting Started

I'm trying to learning Serenity BDD framework but i encounter some issues which need guidance from expect.I have downloaded serenity-cucumber4-starter-master from github.

Problems:

  1. AFAIK, there is Tasks, Screen and Actions classes creation but I did not found it in the project according to this theory.
  2. How is the implementation of this example different from screenplay design patterns?

My Code so far:

public class LoginTask implements Task {

    private HomepageScreen hp;

    @Override
    @Step("Landing on Guru Bank Website")
    public <T extends Actor> void performAs(T obj) {
        obj.attemptsTo(Open.browserOn(hp));

   }
}

@RunWith(SerenityRunner.class)
public class CucumberTestSuite {

    @Managed(driver = "chrome") 
    private WebDriver browser;

    private Actor john = Actor.named("john");

    // =================================================================================
    @Before
    public void setup() {
        john.can(BrowseTheWeb.with(browser));
    }

    @Test
    public void login() throws InterruptedException {
        //givenThat(john).can(BrowseTheWeb.with(browser));
        System.out.println("Automate web browser");
        //givenThat(john).wasAbleTo(LoginTask.);

        Thread.sleep(9000);
    }


}

givenThat() method is undefined. Where to get the import location?

Please help. Thanks.

givenThat()方法(和其他类似方法)在net.serenitybdd.screenplay.GivenWhenThen中定义。

import static net.serenitybdd.screenplay.GivenWhenThen.seeThat;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM