package pt.fccn.mobile.arquivo.tests.menu;

import org.junit.Test;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

import pt.fccn.arquivo.selenium.Retry;
import pt.fccn.mobile.arquivo.utils.LocaleUtils;

/**
 *
 * @author Ivo Branco <ivo.branco@fccn.pt>
 *
 */
public class MenuAboutHomepageTest extends MenuTest {

	public MenuAboutHomepageTest(String os, String version, String browser, String deviceName, String deviceOrientation) {
		super(os, version, browser, deviceName, deviceOrientation);
	}

	@Test
	@Retry
	public void menuAboutHomepagePTTest() {
		LocaleUtils.changeLanguageToPT(this);
		menuAbout("https://sobre.arquivo.pt/pt/");
	}

	@Test
	@Retry
	public void menuAboutHomepageENTest() {
		LocaleUtils.changeLanguageToEN(this);
		menuAbout("https://sobre.arquivo.pt/en/");
	}

	private void menuAbout(String expectedUrl) {
		openMenu();

		run("Click about button", () -> driver.findElementByXPath("//*[@id=\"menuSwiperSlide\"]/a/h4").click());

		appendError("Check if current url is the about page",
				() -> new WebDriverWait(driver, 20).until(ExpectedConditions.urlContains(expectedUrl)));

	}

}

@@ -48,22 +48,208 @@
 ort 
-org.junit.Test
+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
 ;%0Aim
@@ -1207,142 +1207,217 @@
 ));%0A
-%0A%09%09appendError(%22Check if current url is the about page%22,%0A%09%09%09%09() -%3E new WebDriverWait(driver, 20).until(ExpectedConditions.urlContains(
+%09%09%09%09%0A%09%09waitUntilElementIsVisibleAndGet(By.xpath(%22//*%5B@id=%5C%22logoContainer%5C%22%5D%22)); %0A%09%09%09%09%0A%09%09run(%22Verify sobre.arquivo.pt%22, () -%3E %7B%0A%09%09%09assertEquals(%22Check if current url is the about page%22, driver.getCurrentUrl(), 
 expe
@@ -1424,17 +1424,21 @@
 ctedUrl)
-)
+;%0A%09%09%7D
 );%0A%0A%09%7D%0A%0A

Fix Menu