Skip to content

Commit 487ebd0

Browse files
committed
Moving a test method to a more appropriate test class
1 parent e97bda0 commit 487ebd0

File tree

3 files changed

+31
-60
lines changed

3 files changed

+31
-60
lines changed

java/client/test/org/openqa/selenium/support/pagefactory/DefaultElementLocatorTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import static org.mockito.Mockito.verify;
2424
import static org.mockito.Mockito.when;
2525

26-
import org.junit.Rule;
2726
import org.openqa.selenium.By;
2827
import org.openqa.selenium.NoSuchElementException;
2928
import org.openqa.selenium.WebDriver;

java/client/test/org/openqa/selenium/support/pagefactory/UsingPageFactoryTest.java

+31
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@
2222
import static org.junit.Assert.assertThat;
2323

2424
import org.junit.Test;
25+
import org.openqa.selenium.By;
2526
import org.openqa.selenium.JavascriptExecutor;
27+
import org.openqa.selenium.StubDriver;
28+
import org.openqa.selenium.WebDriver;
2629
import org.openqa.selenium.WebElement;
30+
import org.openqa.selenium.remote.RemoteWebElement;
31+
import org.openqa.selenium.remote.internal.WebElementToJsonConverter;
2732
import org.openqa.selenium.support.CacheLookup;
2833
import org.openqa.selenium.support.FindBy;
2934
import org.openqa.selenium.support.PageFactory;
@@ -61,6 +66,32 @@ public void canListDecoratedElements() {
6166
}
6267
}
6368

69+
@Test
70+
public void testDecoratedElementsShouldBeUnwrapped() {
71+
final RemoteWebElement element = new RemoteWebElement();
72+
element.setId("foo");
73+
74+
WebDriver driver = new StubDriver() {
75+
@Override
76+
public WebElement findElement(By by) {
77+
return element;
78+
}
79+
};
80+
81+
PublicPage page = new PublicPage();
82+
PageFactory.initElements(driver, page);
83+
84+
Object seen = new WebElementToJsonConverter().apply(page.element);
85+
Object expected = new WebElementToJsonConverter().apply(element);
86+
87+
assertEquals(expected, seen);
88+
}
89+
90+
91+
public class PublicPage {
92+
public WebElement element;
93+
}
94+
6495
public static class Page {
6596
@FindBy(name = "someForm")
6697
WebElement formElement;

java/client/test/org/openqa/selenium/v1/support/DecoratedWebElementTest.java

-59
This file was deleted.

0 commit comments

Comments
 (0)