@@ -0,0 +1,2541 @@
+package pt.fccn.mobile.arquivo.tests.narrative;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.CoreMatchers.containsString;%0A%0Aimport org.junit.Test;%0Aimport org.openqa.selenium.By;%0Aimport org.openqa.selenium.support.ui.ExpectedConditions;%0Aimport org.openqa.selenium.support.ui.WebDriverWait;%0A%0Aimport pt.fccn.arquivo.selenium.Retry;%0Aimport pt.fccn.arquivo.selenium.WebDriverTestBaseParalell; %0A%0A/**%0A *%0A * @author Pedro Gomes %3Cpedro.gomes@fccn.pt%3E%0A *%0A */%0Apublic class NarrativeButtonTest extends WebDriverTestBaseParalell %7B%0A%0A    public NarrativeButtonTest(String os, String version, String browser, String deviceName, String deviceOrientation) %7B%0A        super(os, version, browser, deviceName, deviceOrientation);%0A    %7D%0A%0A    @Test%0A    @Retry%0A    public void narrativeButtonTest() %7B%0A        %0A        run(%22Search fccn%22, () -%3E %7B%0A            driver.findElement(By.id(%22submit-search-input%22)).clear();%0A           driver.findElement(By.id(%22submit-search-input%22)).sendKeys(%22fccn%22); %0A        %7D);%0A%0A        run(%22Search Narrative%22, () -%3E %7B%0A            driver.findElement(By.id(%22search-tools-narrative-button%22)).click();%0A        %7D);%0A%0A        run(%22Check modal%22, () -%3E %7B%0A            waitUntilElementIsVisibleAndGet(By.id(%22confirm-narrative-modal%22));%0A        %7D);%0A%0A        appendError(() -%3E assertEquals(%22Verify text from ContaMeHistorias.pt%22, %22Vai sair do Arquivo.pt para o ContaMeHistorias.pt%22,%0A            driver.findElement(By.xpath(%22//*%5B@id=%5C%22confirm-narrative-modal%5C%22%5D/ul/li%5B1%5D/p%22)).getText()));%0A%0A        run(%22Check the cancel button%22, () -%3E %7B%0A            driver.findElement(By.xpath(%22//*%5B@id=%5C%22confirm-narrative-modal%5C%22%5D/ul/li%5B3%5D/a/button%22)).click();%0A        %7D);%0A%0A        appendError(%22Check if modal is closed%22, () -%3E new WebDriverWait(driver, 20)%0A                .until(ExpectedConditions.invisibilityOfElementLocated(By.id(%22confirm-narrative-modal%22))));%0A%0A        run(%22Search Narrative%22, () -%3E %7B%0A            driver.findElement(By.id(%22search-tools-narrative-button%22)).click();%0A        %7D);%0A%0A        run(%22Check modal%22, () -%3E %7B%0A            waitUntilElementIsVisibleAndGet(By.id(%22confirm-narrative-modal%22));%0A        %7D);%0A%0A        run(%22Click on OK button%22, () -%3E %7B%0A            driver.findElement(By.xpath(%22//*%5B@id=%5C%22search-form-narrative%5C%22%5D/button%22)).click();%0A        %7D);%0A%0A        appendError(() -%3E assertEquals(%22Verify text from ContaMeHistorias.pt%22, %22https://contamehistorias.pt/arquivopt/searching?query=fccn&last_years=10&lang=pt%22,%0A            driver.getCurrentUrl()));%0A    %7D%0A%0A%7D%0A

Add Narrative Test