mirror of https://git.sr.ht/~hrbrmstr/htmlunit
boB Rudis
4 years ago
27 changed files with 88 additions and 89 deletions
Binary file not shown.
@ -0,0 +1,41 @@ |
|||
|
|||
test_url <- "https://hrbrmstr.github.io/htmlunitjars/index.html" |
|||
|
|||
w <- web_client() |
|||
|
|||
expect_equal(class(w), "webclient") |
|||
expect_equal(class(wc_browser_info(w)), "browserinfo") |
|||
|
|||
expect_equal(class(wc_go(w, url = test_url)), "webclient") |
|||
|
|||
expect_equal(wc_url(w), test_url) |
|||
expect_equal(wc_title(w), "") |
|||
|
|||
expect_true(inherits(wc_render(w, "parsed"), "xml_document")) |
|||
expect_true(inherits(wc_render(w, "html"), "character")) |
|||
expect_true(inherits(wc_render(w, "text"), "character")) |
|||
|
|||
expect_true(inherits(wc_click_on(w, "table"), "webclient")) |
|||
|
|||
expect_equal( |
|||
wc_html_nodes(w, "title") %>% sapply(wc_html_text), |
|||
"" |
|||
) |
|||
|
|||
expect_equal( |
|||
wc_html_nodes(w, "title") %>% sapply(wc_html_name), |
|||
"title" |
|||
) |
|||
|
|||
h <- wc_headers(w) |
|||
expect_true(any(h$value == "GitHub.com")) |
|||
|
|||
expect_inherits( |
|||
hu_read_html(url = test_url, ret = "html_document"), |
|||
"xml_document" |
|||
) |
|||
expect_true( |
|||
inherits(hu_read_html(url = test_url, ret = "text"), |
|||
"character" |
|||
)) |
|||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,4 +1,2 @@ |
|||
is/rud/htmlunit/App$1.class |
|||
is/rud/htmlunit/Zapp.class |
|||
is/rud/htmlunit/App.class |
|||
is/rud/htmlunit/Zapp$1.class |
|||
|
@ -1,2 +1 @@ |
|||
/Users/hrbrmstr/packages/htmlunit/java/htmlunit/src/main/java/is/rud/htmlunit/App.java |
|||
/Users/hrbrmstr/packages/htmlunit/java/htmlunit/src/main/java/is/rud/htmlunit/Zapp.java |
|||
|
@ -1,2 +0,0 @@ |
|||
library(testthat) |
|||
test_check("htmlunit") |
@ -1,45 +0,0 @@ |
|||
context("Core htmlunit ops work") |
|||
test_that("we can do something", { |
|||
|
|||
test_url <- "https://hrbrmstr.github.io/htmlunitjars/index.html" |
|||
|
|||
w <- web_client() |
|||
|
|||
expect_is(w, "webclient") |
|||
expect_is(wc_browser_info(w), "browserinfo") |
|||
|
|||
expect_is(wc_go(w, url = test_url), "webclient") |
|||
|
|||
expect_equal(wc_url(w), test_url) |
|||
expect_equal(wc_title(w), "") |
|||
|
|||
expect_is(wc_render(w, "parsed"), "xml_document") |
|||
expect_is(wc_render(w, "html"), "character") |
|||
expect_is(wc_render(w, "text"), "character") |
|||
|
|||
expect_is(wc_click_on(w, "table"), "webclient") |
|||
|
|||
expect_equal( |
|||
wc_html_nodes(w, "title") %>% sapply(wc_html_text), |
|||
"" |
|||
) |
|||
|
|||
expect_equal( |
|||
wc_html_nodes(w, "title") %>% sapply(wc_html_name), |
|||
"title" |
|||
) |
|||
|
|||
h <- wc_headers(w) |
|||
expect_true(any(h$value == "GitHub.com")) |
|||
|
|||
expect_is( |
|||
hu_read_html(url = test_url, ret = "html_document"), |
|||
"xml_document" |
|||
) |
|||
expect_is( |
|||
hu_read_html(url = test_url, ret = "text"), |
|||
"character" |
|||
) |
|||
|
|||
|
|||
}) |
@ -0,0 +1,5 @@ |
|||
|
|||
if ( requireNamespace("tinytest", quietly=TRUE) ){ |
|||
tinytest::test_package("htmlunit") |
|||
} |
|||
|
Loading…
Reference in new issue