Skip to content

Commit

Permalink
Adding tests for executeScript that returns recursive structures
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Aug 28, 2017
1 parent 9731d69 commit 7dec9f1
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions java/client/test/org/openqa/selenium/ExecutingJavascriptTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -553,4 +553,30 @@ public void shouldReturnDocumentElementIfDocumentIsReturned() {
assertTrue(value instanceof WebElement);
assertTrue(((WebElement) value).getText().contains("A single line of text"));
}

@Test(timeout = 10000)
@Ignore(value = IE, reason = "returns WebElement")
@Ignore(PHANTOMJS)
@Ignore(SAFARI)
public void shouldHandleObjectThatThatHaveToJSONMethod() {
driver.get(pages.simpleTestPage);

Object value = executeScript("return window.performance.timing");

assertTrue(value instanceof Map);
}

@Test(timeout = 10000)
@Ignore(CHROME)
@Ignore(IE)
@Ignore(PHANTOMJS)
@Ignore(SAFARI)
@Ignore(value = MARIONETTE, issue = "https://github.com/mozilla/geckodriver/issues/904")
public void shouldHandleRecursiveStructures() {
driver.get(pages.simpleTestPage);

Object value = executeScript("var obj1 = {}; var obj2 = {}; obj1['obj2'] = obj2; obj2['obj1'] = obj1; return obj1");

assertTrue(value instanceof Map);
}
}

0 comments on commit 7dec9f1

Please sign in to comment.