Skip to content

Commit 5373a01

Browse files
committed
one more test
1 parent de5b4af commit 5373a01

1 file changed

Lines changed: 42 additions & 1 deletion

File tree

src/test/java/org/htmlunit/html/xpath/HtmlUnitXPath2Test.java

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ public void textNodeTest() throws Exception {
10201020
}
10211021

10221022
/**
1023-
* count(@*) counts all attributes including id; p[a] has id,x,y=3, p[b] has id,y=2.
1023+
* Function count(@*) counts all attributes including id; p[a] has id,x,y=3, p[b] has id,y=2.
10241024
* @throws Exception if the test fails
10251025
*/
10261026
@Test
@@ -1136,6 +1136,47 @@ public void childAxis() throws Exception {
11361136
compare("//div/child::p");
11371137
}
11381138

1139+
/**
1140+
* @throws Exception if the test fails
1141+
*/
1142+
@Test
1143+
@Alerts(DEFAULT = "d3d2d1",
1144+
FF = "d1d2d3",
1145+
FF_ESR = "d1d2d3")
1146+
@HtmlUnitNYI(CHROME = "d1d2d3",
1147+
EDGE= "d1d2d3")
1148+
public void anchestorOrder() throws Exception {
1149+
final String content = DOCTYPE_HTML
1150+
+ "<html>\n"
1151+
+ "<head>\n"
1152+
+ "<script>\n"
1153+
+ LOG_TITLE_FUNCTION
1154+
+ "function test() {\n"
1155+
+ " try {\n"
1156+
+ " let res = '';\n"
1157+
+ " let tester = document.getElementById('d4');\n"
1158+
+ " let result = document.evaluate('ancestor::div',"
1159+
+ " tester, null, XPathResult.ANY_TYPE, null);\n"
1160+
+ " while (node = result.iterateNext()) {\n"
1161+
+ " res += node.id;\n"
1162+
+ " }\n"
1163+
+ " log(res);\n"
1164+
+ " } catch(e) { logEx(e) }\n"
1165+
+ "}\n"
1166+
+ "</script></head>\n"
1167+
+ "<body onload='test()'>\n"
1168+
+ " <div id='d1'>\n"
1169+
+ " <div id='d2'>\n"
1170+
+ " <div id='d3'>\n"
1171+
+ " <div id='d4'>Tester</div>\n"
1172+
+ " </div>\n"
1173+
+ " </div>\n"
1174+
+ " </div>\n"
1175+
+ "</body></html>";
1176+
1177+
loadPageVerifyTitle2(content);
1178+
}
1179+
11391180
// -----------------------------------------------------------------------
11401181
// XPathResult types
11411182
// -----------------------------------------------------------------------

0 commit comments

Comments
 (0)