View Javadoc

1   package com.atlassian.webdriver.it.visualcomparison;
2   
3   import com.atlassian.selenium.visualcomparison.ScreenElement;
4   import com.atlassian.webdriver.debug.WebDriverDebug;
5   import com.atlassian.webdriver.it.AbstractSimpleServerTest;
6   import com.atlassian.webdriver.it.pageobjects.page.VisualComparisonPage;
7   import com.atlassian.webdriver.testing.annotation.WindowSize;
8   import com.atlassian.webdriver.visualcomparison.WebDriverBrowserEngine;
9   import org.junit.Test;
10  
11  import javax.inject.Inject;
12  
13  import static org.junit.Assert.assertEquals;
14  
15  public class TestWebDriverBrowserEngine extends AbstractSimpleServerTest
16  {
17      @Inject
18      WebDriverBrowserEngine engine;
19  
20      @Inject
21      WebDriverDebug debug;
22  
23      @Test
24      @WindowSize(width = 1024, height = 768)
25      public void testGetElementAtNoScrolling()
26      {
27          product.visit(VisualComparisonPage.class, 1);
28          ScreenElement element = engine.getElementAt(38, 20);
29          assertEquals("<span class=\"aui-header-logo-device\">AUI</span>", element.getHtml());
30      }
31  
32      @Test
33      @WindowSize(width = 1024, height = 768)
34      public void testGetElementAtWithScrolling()
35      {
36          product.visit(VisualComparisonPage.class, 1);
37          ScreenElement element = engine.getElementAt(530, 1410);
38          assertEquals("<input class=\"upfile\" id=\"uploadFile\" name=\"uploadFile\" title=\"upload file\" type=\"file\">",
39                  element.getHtml());
40      }
41  
42  }