Search in sources :

Example 1 with Logo

use of com.github.noraui.application.model.logogame.Logo in project NoraUi by NoraUi.

the class LogoGameSteps method playWithMyInputFile.

@Alors("Je joue avec mon fichier d'entrée '(.*)'")
@Then("I play with my input file '(.*)'")
public void playWithMyInputFile(String jsonLogos) throws TechnicalException {
    Logos logos = new Logos();
    logos.deserialize(jsonLogos);
    for (int i = 0; i < logos.size(); i++) {
        Logo logo = logos.get(i);
        logo.setNid(i);
        try {
            WebElement element = getDriver().findElement(Utilities.getLocator(this.logoGamePage.brandElement, logo.getBrand(), logo.getBrand()));
            if (element != null) {
                updateText(this.logoGamePage.brandElement, logo.getBrand(), null, logo.getBrand(), logo.getBrand());
            }
        } catch (Exception e) {
            new Result.Warning<>(logo.getBrand(), Messages.format("Brand « %s » does not exist.", logo.getBrand()), true, logo.getNid());
        }
    }
}
Also used : Logos(com.github.noraui.application.model.logogame.Logos) WebElement(org.openqa.selenium.WebElement) FailureException(com.github.noraui.exception.FailureException) TechnicalException(com.github.noraui.exception.TechnicalException) Logo(com.github.noraui.application.model.logogame.Logo) Result(com.github.noraui.exception.Result) Alors(cucumber.api.java.fr.Alors) Then(cucumber.api.java.en.Then)

Aggregations

Logo (com.github.noraui.application.model.logogame.Logo)1 Logos (com.github.noraui.application.model.logogame.Logos)1 FailureException (com.github.noraui.exception.FailureException)1 Result (com.github.noraui.exception.Result)1 TechnicalException (com.github.noraui.exception.TechnicalException)1 Then (cucumber.api.java.en.Then)1 Alors (cucumber.api.java.fr.Alors)1 WebElement (org.openqa.selenium.WebElement)1