Skip to content

Commit c1a35dd

Browse files
committed
Add a test for tidyverse#405.
This won't pass checks until tidyverse#445 is merged, but this particular new test passes and should prevent regressions of this particular use case.
1 parent c9782e0 commit c1a35dd

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

tests/testthat/html/navigate1.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Navigate 1</title>
5+
</head>
6+
<body>
7+
<a href="navigate2.html">Navigate to Page 2</a>
8+
</body>

tests/testthat/html/navigate2.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Navigate 2</title>
5+
</head>
6+
<body>
7+
<p>Success!</p>
8+
</body>

tests/testthat/test-live.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ test_that("can press special keys",{
8888
expect_equal(html_text(html_element(sess, "#keyInfo")), "]/BracketRight")
8989
})
9090

91+
test_that("can find elements after click that navigates", {
92+
skip_if_no_chromote()
93+
94+
sess <- read_html_live(html_test_path("navigate1"))
95+
sess$click("a")
96+
expect_equal(html_text2(html_element(sess, "p")), "Success!")
97+
})
9198

9299
# as_key_desc -------------------------------------------------------------
93100

0 commit comments

Comments
 (0)