@@ -0,0 +1,2356 @@
+package pt.fccn.mobile.arquivo.tests.pagesearch;%0A%0Aimport static org.hamcrest.CoreMatchers.containsString;%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport org.junit.Test;%0Aimport org.openqa.selenium.By;%0Aimport org.openqa.selenium.support.ui.ExpectedConditions;%0A%0Aimport pt.fccn.arquivo.selenium.Retry;%0Aimport pt.fccn.arquivo.selenium.WebDriverTestBaseParalell;%0Aimport pt.fccn.mobile.arquivo.utils.LocaleUtils;%0A%0A/**%0A *%0A * @author Ivo Branco %3Civo.branco@fccn.pt%3E%0A *%0A */%0Apublic class PageSearchEmptyTest extends WebDriverTestBaseParalell %7B%0A%0A%09private static final String QUERY = %22xptoxptoxptoxptoxptoxptoxptoxptoxpto%22;%0A%0A%09public PageSearchEmptyTest(String os, String version, String browser, String deviceName, String deviceOrientation) %7B%0A%09%09super(os, version, browser, deviceName, deviceOrientation);%0A%09%7D%0A%0A%09@Test%0A%09@Retry%0A%09public void pageSearchTestPT() %7B%0A%09%09LocaleUtils.changeLanguageToPT(this);%0A%09%09pageSearchTest(%22N%C3%A3o foram encontrados resultados para a sua pesquisa%22);%0A%09%7D%0A%0A%09@Test%0A%09@Retry%0A%09public void pageSearchTestEN() %7B%0A%09%09LocaleUtils.changeLanguageToEN(this);%0A%09%09pageSearchTest(%22No results were found for the query%22);%0A%09%7D%0A%0A%09private void pageSearchTest(String noResultsMessage) %7B%0A%09%09run(%22Search with %22 + QUERY, () -%3E %7B%0A%09%09%09driver.findElement(By.id(%22txtSearch%22)).clear();%0A%09%09%09driver.findElement(By.id(%22txtSearch%22)).sendKeys(QUERY);%0A%09%09%09driver.findElement(By.xpath(%22//*%5B@id=%5C%22buttonSearch%5C%22%5D/button%22)).click();%0A%09%09%7D);%0A%0A%09%09run(%22Wait for search results appear%22, () -%3E waitUntilElementIsVisibleAndGet(By.id(%22resultados-lista%22)));%0A%0A%09%09appendError(%22Check result count should be zero%22, () -%3E %7B%0A%09%09%09int count = driver.findElementsByXPath(%22//*%5B@id=%5C%22resultados-lista%5C%22%5D/ul/li%22).size();%0A%09%09%09assertEquals(%22Check result count should be zero%22, 0, count);%0A%09%09%7D);%0A%0A%09%09By emptyResultMessageBy = By.id(%22conteudo-pesquisa-erro%22);%0A%0A%09%09appendError(%22Empty result message should be visible%22,%0A%09%09%09%09() -%3E ExpectedConditions.visibilityOfElementLocated(emptyResultMessageBy));%0A%0A%09%09appendError(() -%3E assertThat(%22Empty result message should contains specific text%22,%0A%09%09%09%09driver.findElement(By.id(%22conteudo-pesquisa-erro%22)).getText(), containsString(noResultsMessage)));%0A%0A%09%09appendError(() -%3E assertThat(%22Empty result message should show search criteria%22,%0A%09%09%09%09driver.findElement(By.id(%22conteudo-pesquisa-erro%22)).getText(), containsString(QUERY)));%0A%09%7D%0A%0A%7D%0A

Add new page search empty test.