From cf093c2b4c4fd3ff88baaf6b7c5e2b0c34c8344c Mon Sep 17 00:00:00 2001 From: angiejones Date: Tue, 8 Jan 2019 18:46:33 -0800 Subject: [PATCH] full page visual test --- resources/test.properties | 2 +- src/test/java/ScrollTests.java | 10 ++++++++++ src/test/java/base/BaseTests.java | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 src/test/java/ScrollTests.java diff --git a/resources/test.properties b/resources/test.properties index 828ea2f..4d098a7 100644 --- a/resources/test.properties +++ b/resources/test.properties @@ -1,7 +1,7 @@ ################ # MY APP # ################ -site.url=https://the-internet.herokuapp.com/dynamic_content +site.url=https://the-internet.herokuapp.com/large ################ # SELENIUM # diff --git a/src/test/java/ScrollTests.java b/src/test/java/ScrollTests.java new file mode 100644 index 0000000..cee6e70 --- /dev/null +++ b/src/test/java/ScrollTests.java @@ -0,0 +1,10 @@ +import base.BaseTests; +import org.junit.Test; + +public class ScrollTests extends BaseTests { + + @Test + public void testLargeDom() { + validateWindow(); + } +} \ No newline at end of file diff --git a/src/test/java/base/BaseTests.java b/src/test/java/base/BaseTests.java index 279c2e6..0df4731 100644 --- a/src/test/java/base/BaseTests.java +++ b/src/test/java/base/BaseTests.java @@ -1,6 +1,5 @@ package base; -import com.applitools.eyes.MatchLevel; import com.applitools.eyes.selenium.Eyes; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -11,6 +10,7 @@ import java.io.FileInputStream; import java.util.Properties; + public class BaseTests { protected static WebDriver driver; @@ -45,7 +45,7 @@ private static void initiateEyes(){ public void validateWindow(){ eyes.open(driver, "The Internet", Thread.currentThread().getStackTrace()[2].getMethodName()); - eyes.setMatchLevel(MatchLevel.LAYOUT); + eyes.setForceFullPageScreenshot(true); eyes.checkWindow(); eyes.close(); }