View Javadoc

1   package com.atlassian.webdriver.it.tests;
2   
3   import com.atlassian.pageobjects.browser.Browser;
4   import com.atlassian.pageobjects.browser.IgnoreBrowser;
5   import com.atlassian.webdriver.it.AbstractSimpleServerTest;
6   import com.atlassian.webdriver.it.pageobjects.page.ArgumentConversionBugPage;
7   import com.atlassian.webdriver.utils.JavaScriptUtils;
8   import org.junit.Before;
9   import org.junit.Test;
10  import org.openqa.selenium.By;
11  import org.openqa.selenium.WebDriver;
12  import org.openqa.selenium.WebElement;
13  
14  import javax.inject.Inject;
15  import java.util.List;
16  
17  @IgnoreBrowser(Browser.HTMLUNIT_NOJS)
18  public class TestArgumentConversionBug extends AbstractSimpleServerTest
19  {
20      @Inject
21      private  WebDriver driver;
22  
23      @Before
24      public void goToPage()
25      {
26          product.visit(ArgumentConversionBugPage.class);
27      }
28  
29      // This test is checking that the arg processing bug has been fixed.
30      // http://code.google.com/p/selenium/issues/detail?id=1280
31      @Test
32      public void testDriverDoesNotFailToProcessArgs()
33      {
34          List<WebElement> els = driver.findElements(By.tagName("div"));
35          Object[] args = new Object[] { els };
36          JavaScriptUtils.execute("return arguments[0] == null", driver, args);
37      }
38  
39  }