Skip to content

Instantly share code, notes, and snippets.

@steppat
Created August 11, 2020 09:43
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steppat/64eae8b2005345c71f23b78941bf2a2e to your computer and use it in GitHub Desktop.
Save steppat/64eae8b2005345c71f23b78941bf2a2e to your computer and use it in GitHub Desktop.
public class LeilaoSteps implements io.cucumber.java8.Pt{
private LoginPage loginPage;
private LeiloesPage leiloesPage;
private NovoLeilaoPage novoLeilaoPage;
private Browser browser;
public LeilaoSteps() {
Dado("um usuario logado", () -> {
this.browser = new Browser();
browser.seed();
loginPage = browser.getLoginPage();
leiloesPage = loginPage.realizaLoginComoFulano();
});
Quando("acessa a pagina de novo leilao", () -> {
novoLeilaoPage = this.leiloesPage.visitaPaginaParaCriarUmNovoLeilao();
});
Quando("prenche o formulario com dados validos", () -> {
this.leiloesPage = this.novoLeilaoPage.preencheForm("PC Novo", "1500", "01/11/2020");
});
Entao("volta para a pagina de leiloes", () -> {
Assert.assertTrue(this.leiloesPage.estaNaPaginaDeLeiloes());
});
Entao("o novo leilao aparece na tabela", () -> {
this.leiloesPage.existe("PC Novo", "1500", "01/11/2020", "fulano");
this.browser.clean();
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment