package pt.fccn.mobile.arquivo.tests.replay.options;

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

import pt.fccn.arquivo.selenium.Retry;
import pt.fccn.arquivo.selenium.WebDriverTestBaseParalell;

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

	private static final String WAYBACK_EXAMPLE = "/wayback/19961013145650/http://www.fccn.pt/";

	private static final String NOFRAME_EXAMPLE = "/noFrame/replay/19961013145650/http://www.fccn.pt/";

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

	@Test
	@Retry
	public void replayExpandTest() throws InterruptedException {
		driver.get(this.testURL + WAYBACK_EXAMPLE);

		run("Open replay right menu", () -> waitUntilElementIsVisibleAndGet(By.id("replayMenuButton")).click());

		run("Click expand link", () -> waitUntilElementIsVisibleAndGet(By.id("expandPage")).click());

		run("Check we go to correct no frame url",
				() -> new WebDriverWait(driver, 20).until(ExpectedConditions.urlContains(NOFRAME_EXAMPLE)));

		run("Check we go to correct no frame text", () -> {
			new WebDriverWait(driver, 20).until(
					ExpectedConditions.textToBePresentInElementLocated(By.xpath("/html/body/center/h2"), "Nacional"));
		});

	}

}

@@ -473,23 +473,88 @@
 WAYBACK_
-EXAMPLE
+SITE = %22http://www.fccn.pt/%22;%0A%0A%09private static final String WAYBACK_PATH
  = %22/way
@@ -573,36 +573,32 @@
 3145650/
-http://www.fccn.pt/%22
+%22 + WAYBACK_SITE
 ;%0A%0A%09priv
@@ -671,36 +671,32 @@
 3145650/
-http://www.fccn.pt/%22
+%22 + WAYBACK_SITE
 ;%0A%0A%09publ
@@ -984,23 +984,20 @@
 WAYBACK_
-EXAMPLE
+PATH
 );%0A%0A%09%09ru
@@ -1189,32 +1189,134 @@
 e%22)).click());%0A%0A
+%09%09// or url contains wayback site (specific for android driver) or the correct%0A%09%09// full no frame url%0A
 %09%09run(%22Check we 
@@ -1343,21 +1343,17 @@
 me url%22,
-%0A%09%09%09%09
+ 
 () -%3E ne
@@ -1404,16 +1404,89 @@
 nditions
+%0A%09%09%09%09.or(ExpectedConditions.urlContains(WAYBACK_SITE), ExpectedConditions
 .urlCont
@@ -1508,16 +1508,17 @@
 AMPLE)))
+)
 ;%0A%0A%09%09run

Change replay expand test with code specific for android web driver.