Skip to content

Commit bcb5d60

Browse files
committedOct 15, 2016
Clean up tests
1 parent 29abc7e commit bcb5d60

7 files changed

+110
-95
lines changed
 

‎inst/Saucetests/runtest.R

+30-47
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ if(travis){
1818
user <- "seleniumPipes"
1919
pass <- Sys.getenv("SLPASS")
2020
SLAccount <- account(user, pass)
21-
if(identical(pass, "")){stop("Set a SLPASS env variable with sauceLabs pass")}
21+
if(identical(pass, "")){
22+
stop("Set a SLPASS env variable with sauceLabs pass")
23+
}
2224
}
2325
tunnels <- getTunnels(account = SLAccount, username = user)
2426
if(length(tunnels) == 0L){
@@ -29,63 +31,41 @@ appTunnels <- lapply(tunnels, function(x){
2931
)
3032
supPlat <- getSupportedPlatforms(SLAccount)
3133
supPlat <- supPlat[!short_version %in% c("dev", "beta")]
32-
supPlat <- supPlat[!(api_name == "firefox" & as.numeric(short_version) > 47.999)]
33-
supPlat <- supPlat[!(api_name == "chrome" & as.numeric(short_version) > 51.999)]
34+
supPlat <- supPlat[!(api_name == "firefox" &
35+
as.numeric(short_version) > 47.999)]
36+
supPlat <- supPlat[!(api_name == "chrome" &
37+
as.numeric(short_version) > 51.999)]
3438
port <- 80
3539
# selVersion <- "2.53.1"
3640
ip <- paste0("http://", user, ':', pass, "@ondemand.saucelabs.com")
3741
testDir <- system.file("Saucetests", package = "seleniumPipes")
38-
# osBrowser <- list(
39-
# "Windows 10" = list(list(browser = "chrome", version = '51')
40-
# , list(browser = "firefox", version = '45')
41-
# , list(browser = "internet explorer", version = '11')
42-
# , list(browser = "MicrosoftEdge", version = '13.10586')
43-
# ),
44-
# "Windows 8.1" = list(list(browser = "chrome", version = '51')
45-
# , list(browser = "firefox", version = '45')
46-
# , list(browser = "internet explorer", version = '11')
47-
# ),
48-
# "Linux" = list(list(browser = "chrome", version = '48')
49-
# , list(browser = "firefox", version = '45')
50-
# #, list(browser = "opera", version = '12')
51-
# ),
52-
# "OS X 10.11" = list(list(browser = "firefox", version = '45')
53-
# , list(browser = "chrome", version = '51')
54-
# # , list(browser = "safari", version = '9')
55-
# ),
56-
# "OS X 10.10" = list(list(browser = "firefox", version = '45')
57-
# , list(browser = "chrome", version = '51')
58-
# #, list(browser = "safari", version = '8')
59-
# )
60-
# )
61-
# osBrowser <- osBrowser[4]
62-
#
63-
# osBrowser <- lapply(names(osBrowser), function(x){
64-
# out <- rbindlist(osBrowser[[x]])
65-
# out[, os:=x]
66-
# })
67-
#
68-
# osBrowser <- rbindlist(osBrowser)
6942

7043
osBrowser <- supPlat[api_name %in% c("chrome", "firefox")
71-
, .(max(as.numeric(short_version))), by = list(os, api_name)]
72-
setnames(osBrowser, c("api_name", "os", "V1"), c("browser", "os", "version"))
44+
, .(max(as.numeric(short_version))),
45+
by = list(os, api_name)]
46+
setnames(osBrowser, c("api_name", "os", "V1"),
47+
c("browser", "os", "version"))
7348
testResults <- Map(function(os, browser, version){
74-
selOptions <- list(remoteServerAddr = ip, port = port, browserName = browser
75-
, platform = os#, version = version
76-
, extraCapabilities = list(username = user
77-
, accessKey = pass
78-
, recordVideo = FALSE
79-
, recordScreenshots = FALSE
80-
)#, "selenium-version" = selVersion)
49+
selOptions <- list(remoteServerAddr = ip, port = port,
50+
browserName = browser,
51+
platform = os, #version = version,
52+
extraCapabilities = list(username = user,
53+
accessKey = pass,
54+
recordVideo = FALSE,
55+
recordScreenshots = FALSE
56+
)#, "selenium-version" = selVersion)
8157
)
8258
if(travis){
8359
# use the first tunnel
84-
selOptions$extraCapabilities[["tunnel-identifier"]] <- appTunnels[[1]]$tunnel_identifier
60+
selOptions$extraCapabilities[["tunnel-identifier"]] <-
61+
appTunnels[[1]]$tunnel_identifier
8562
}
8663
options(seleniumPipes_selOptions = selOptions)
8764
testRes <- test_dir(testDir, reporter = "Tap", filter = "api_example")
88-
list(id = getOption("seleniumPipes_sauceID"), result = testRes, browser = browser, os = os)
65+
list(id = getOption("seleniumPipes_sauceID"),
66+
result = testRes,
67+
browser = browser,
68+
os = os)
8969
}, os = osBrowser$os
9070
, browser = osBrowser$browser
9171
, version = osBrowser$version)
@@ -95,8 +75,11 @@ pv <- packageVersion("seleniumPipes")
9575
updateResults <- lapply(testResults, function(x){
9676
updateJob(account = SLAccount, username = user, jobID = x$id,
9777
passed = sum(data.frame(x$result)$failed) == 0L,
98-
custom_data = list(release = do.call(paste, list(pv, collapse = "."))
99-
, testResults = data.frame(x$result)[, c("test", "failed", "error")])
78+
custom_data = list(
79+
release = do.call(paste, list(pv, collapse = ".")),
80+
testResults =
81+
data.frame(x$result)[, c("test", "failed", "error")]
82+
)
10083
)
10184
})
10285
options(seleniumPipes_no_try_delay = oldRetry)

‎inst/Saucetests/setup.R

+6-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ if(is.null(getOption("seleniumPipes_selOptions"))){
44
}
55
remDr <- do.call(remoteDr, getOption("seleniumPipes_selOptions"))
66
if(identical(getOption("seleniumPipes_SL"), TRUE)){
7-
options(seleniumPipes_sauceID = remDr$sessionInfo$webdriver.remote.sessionid)
7+
options(seleniumPipes_sauceID =
8+
remDr$sessionInfo$webdriver.remote.sessionid)
89
}
9-
remDr %>% setTimeout(milliseconds = 10000) # set page load timeout to 3 secs
10-
remDr %>% setTimeout(type = "implicit", milliseconds = 5000) # wait 5 secs for elements to load
10+
# set page load timeout to 3 secs
11+
remDr %>% setTimeout(milliseconds = 10000)
12+
# wait 5 secs for elements to load
13+
remDr %>% setTimeout(type = "implicit", milliseconds = 5000)
1114
rdBrowser <- remDr$sessionInfo$browserName
1215
if(rdBrowser %in% c("iPhone", "iPad", "safari")){
1316
htmlSrc <- "myname.local:3000"

‎inst/Saucetests/test_api_example_tests.R

+52-27
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,21 @@ if(identical(TRUE, getOption("seleniumPipes_SL"))){
33
# sauce labs test
44
pv <- packageVersion("seleniumPipes")
55
slFlags <- list(name = "seleniumPipes-test-suite"
6-
, build = sum(unlist(pv)*10^(3-seq_along(unlist(pv)))) # 1.2.1 for example 121
6+
, build = sum(unlist(pv)*10^(3-seq_along(unlist(pv))))
77
, tags = list("api-example")
8-
, "custom-data" = list(release = do.call(paste, list(pv, collapse = ".")))
8+
, "custom-data" =
9+
list(release = do.call(paste,
10+
list(pv, collapse = "."))
11+
12+
)
913
)
1014
selOptions <- getOption("seleniumPipes_selOptions")
1115
selOptions$extraCapabilities <- c(selOptions$extraCapabilities, slFlags)
1216
options(seleniumPipes_selOptions = selOptions)
1317
}
1418

15-
source(file.path(find.package("seleniumPipes"), "Saucetests", 'setup.R'), local = TRUE)
19+
source(file.path(find.package("seleniumPipes"), "Saucetests", 'setup.R'),
20+
local = TRUE)
1621
on.exit(remDr %>% deleteSession())
1722

1823
#1
@@ -44,7 +49,8 @@ test_that("FindElementsByXPath", {
4449
test_that("FindElementByXpathThrowNoSuchElementException", {
4550
expect_error(
4651
findElementText <- remDr%>% go(loadPage("simpleTest")) %>%
47-
findElement(using = "xpath", "//h4", retry = FALSE) %>% getElementText()
52+
findElement(using = "xpath", "//h4", retry = FALSE) %>%
53+
getElementText()
4854
)
4955
expect_equal(7, errorContent()$status)
5056
}
@@ -111,18 +117,22 @@ test_that("FindElementByXpathInElementContext", {
111117
test_that("FindElementByXpathInElementContextNotFound", {
112118
expect_error(remDr %>% go(loadPage("nestedElements")) %>%
113119
findElement(using = "name", "form2") %>%
114-
findElementFromElement(using = "xpath", "div", retry = FALSE))
120+
findElementFromElement(using = "xpath", "div",
121+
retry = FALSE))
115122
expect_equal(7, errorContent()$status)
116123
}
117124
)
118125

119126
#15
120127
test_that("ShouldBeAbleToEnterDataIntoFormFields", {
121128
elem <- remDr %>% go(loadPage("xhtmlTest")) %>%
122-
findElement(using = "xpath", "//form[@name='someForm']/input[@id='username']") %>%
129+
findElement(using = "xpath",
130+
"//form[@name='someForm']/input[@id='username']") %>%
123131
elementClear() %>%
124132
elementSendKeys("some text")
125-
elem <- remDr %>% findElement(using = "xpath", "//form[@name='someForm']/input[@id='username']")
133+
elem <- remDr %>%
134+
findElement(using = "xpath",
135+
"//form[@name='someForm']/input[@id='username']")
126136
expect_equal("some text", elem %>% getElementAttribute("value"))
127137
}
128138
)
@@ -153,8 +163,8 @@ test_that("SwitchToWindow", {
153163
# see https://code.google.com/p/selenium/issues/detail?id=3693
154164
#return()
155165
#}
156-
title_1 = "XHTML Test Page"
157-
title_2 = "We Arrive Here"
166+
title_1 <- "XHTML Test Page"
167+
title_2 <- "We Arrive Here"
158168

159169
remDr %>% go (loadPage("xhtmlTest")) %>%
160170
findElement(using = "link text", "Open new window") %>% elementClick()
@@ -167,13 +177,15 @@ test_that("SwitchToWindow", {
167177
chk <- tryCatch({
168178
windows <- unlist(remDr %>% getWindowHandles(retry = FALSE))
169179
currentWindow <- remDr %>% getWindowHandle(retry = FALSE)
170-
remDr %>% closeWindow() %>% switchToWindow(windows[!windows %in% currentWindow])
180+
remDr %>% closeWindow() %>%
181+
switchToWindow(windows[!windows %in% currentWindow])
171182
}, error = function(e) e)
172183
if(inherits(chk, "simpleError")){
173184
# try old functions
174185
windows <- unlist(remDr %>% getWindowHandlesOld)
175186
currentWindow <- remDr %>% getWindowHandleOld
176-
remDr %>% closeWindow() %>% switchToWindow(windows[!windows %in% currentWindow])
187+
remDr %>% closeWindow() %>%
188+
switchToWindow(windows[!windows %in% currentWindow])
177189
}
178190
expect_equal(title_1, remDr %>% getTitle)
179191
}
@@ -192,19 +204,22 @@ test_that("IsEnabled", {
192204
elem <- remDr %>% go(loadPage("formPage")) %>%
193205
findElement(using = "xpath", "//input[@id='working']")
194206
expect_true(elem %>% isElementEnabled)
195-
elem <- remDr %>% findElement(using = "xpath", "//input[@id='notWorking']")
207+
elem <- remDr %>% findElement(using = "xpath",
208+
"//input[@id='notWorking']")
196209
expect_false(elem %>% isElementEnabled)
197210
}
198211
)
199212

200213
#24-27
201214
test_that("IsSelectedAndToggle", {
202-
if(rdBrowser == 'chrome' && package_version(remDr$sessionInfo$version)$major < 16){
215+
if(rdBrowser == 'chrome' &&
216+
package_version(remDr$sessionInfo$version)$major < 16){
203217
return("deselecting preselected values only works on chrome >= 16")
204218
}
205219
elem <- remDr %>% go(loadPage("formPage")) %>%
206220
findElement(using = "id", "multi")
207-
option_elems <- elem %>% findElementsFromElement(using = "xpath", "option")
221+
option_elems <- elem %>%
222+
findElementsFromElement(using = "xpath", "option")
208223
Sys.sleep(2)
209224
expect_true(option_elems[[1]] %>% isElementSelected)
210225
option_elems[[1]] %>% elementClick
@@ -220,7 +235,6 @@ test_that("IsSelectedAndToggle", {
220235
#28-30
221236
test_that("Navigate", {
222237
# if(rdBrowser == 'safari'){
223-
# see http://code.google.com/p/selenium/issues/detail?id=3771&can=1&q=browser%3DSafari%20component%3DWebDriver%20status%3ANew%2CAccepted%2CWorkingAsIntended%2CWontFix%2CNotFeasible&colspec=ID%20Stars%20Type%20Status%20Priority%20Owner%20Summary%20Browser%20Component
224238
# return()
225239
# }
226240

@@ -248,7 +262,8 @@ test_that("GetImplicitAttribute", {
248262
findElements(using = "xpath", "//option")
249263
expect_true(length(elems) >= 3)
250264
for(x in seq(4)){
251-
expect_equal(x-1, as.integer(elems[[x]] %>% getElementAttribute("index")))
265+
expect_equal(x-1, as.integer(elems[[x]] %>%
266+
getElementAttribute("index")))
252267
}
253268
}
254269
)
@@ -272,7 +287,8 @@ test_that("ExecuteSimpleScript", {
272287
test_that("ExecuteScriptAndReturnElement", {
273288
chk <- tryCatch({
274289
elem <- remDr %>% go(loadPage("xhtmlTest")) %>%
275-
executeScript("return document.getElementById('id1');", retry = FALSE)
290+
executeScript("return document.getElementById('id1');",
291+
retry = FALSE)
276292
}, error = function(e) e)
277293
if(inherits(chk, "simpleError")){
278294
# try old functions
@@ -286,14 +302,16 @@ test_that("ExecuteScriptAndReturnElement", {
286302
#39
287303
test_that("ExecuteScriptWithArgs", {
288304
chk <- tryCatch({
305+
jS <- "return arguments[0] == 'fish' ? 'fish' : 'not fish';"
289306
result <- remDr %>% go(loadPage("xhtmlTest")) %>%
290-
executeScript("return arguments[0] == 'fish' ? 'fish' : 'not fish';", list("fish")
307+
executeScript(jS, list("fish")
291308
, retry = FALSE)
292309
}, error = function(e) e)
293310
if(inherits(chk, "simpleError")){
294311
# try old functions
312+
jS <- "return arguments[0] == 'fish' ? 'fish' : 'not fish';"
295313
result <- remDr %>% go(loadPage("xhtmlTest")) %>%
296-
executeScriptOld("return arguments[0] == 'fish' ? 'fish' : 'not fish';", list("fish"))
314+
executeScriptOld(jS, list("fish"))
297315
}
298316
expect_equal("fish", result)
299317
}
@@ -320,14 +338,19 @@ test_that("ExecuteScriptWithElementArgs", {
320338
chk <- tryCatch({
321339
button <- remDr %>% go(loadPage("javascriptPage")) %>%
322340
findElement(using = "id", "plainButton")
323-
appScript <- "arguments[0]['flibble'] = arguments[0].getAttribute('id'); return arguments[0]['flibble'];"
324-
result <- remDr %>% executeScript(appScript, list(button), retry = FALSE)
341+
appScript <-
342+
"arguments[0]['flibble'] = arguments[0].getAttribute('id');
343+
return arguments[0]['flibble'];"
344+
result <- remDr %>% executeScript(appScript, list(button),
345+
retry = FALSE)
325346
}, error = function(e) e)
326347
if(inherits(chk, "simpleError")){
327348
# try old functions
328349
button <- remDr %>% go(loadPage("javascriptPage")) %>%
329350
findElement(using = "id", "plainButton")
330-
appScript <- "arguments[0]['flibble'] = arguments[0].getAttribute('id'); return arguments[0]['flibble'];"
351+
appScript <-
352+
"arguments[0]['flibble'] = arguments[0].getAttribute('id');
353+
return arguments[0]['flibble'];"
331354
result <- remDr %>% executeScriptOld(appScript, list(button))
332355
}
333356
expect_equal("plainButton", result)
@@ -345,8 +368,10 @@ test_that("FindElementsByPartialLinkText", {
345368
#43-44
346369
test_that("IsElementDisplayed", {
347370
visible <- remDr %>% go(loadPage("javascriptPage")) %>%
348-
findElement(using = "id", "displayed") %>% getElementCssValue("visibility")
349-
not_visible <- remDr %>% findElement(using = "id", "hidden")%>% getElementCssValue("visibility")
371+
findElement(using = "id", "displayed") %>%
372+
getElementCssValue("visibility")
373+
not_visible <- remDr %>% findElement(using = "id", "hidden")%>%
374+
getElementCssValue("visibility")
350375
expect_identical(visible, "visible")
351376
expect_identical(not_visible, "hidden")
352377
}
@@ -365,16 +390,16 @@ test_that("MoveWindowPosition", {
365390
getWindowPosition()
366391
# note can't test 0,0 since some OS's dont allow that location
367392
# because of system toolbars
368-
new_x = 50
369-
new_y = 50
393+
new_x <- 50
394+
new_y <- 50
370395
if(loc[['x']] == new_x){
371396
new_x <- new_x + 10
372397
}
373398
if(loc['y'] == new_y){
374399
new_y <- new_y + 10
375400
}
376401
remDr %>% setWindowPosition(new_x, new_y)
377-
loc = remDr %>% getWindowPosition()
402+
loc <- remDr %>% getWindowPosition()
378403
# change test to be within 10 pixels
379404
expect_less_than(abs(loc[['x']] - new_x), 10)
380405
expect_less_than(abs(loc[['y']] - new_y), 10)

‎tests/testthat/test-api_example_tests.R

+2-3
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ test_that("IsSelectedAndToggle", {
229229
test_that("Navigate", {
230230
skip_on_cran()
231231
# if(rdBrowser == 'safari'){
232-
# see http://code.google.com/p/selenium/issues/detail?id=3771&can=1&q=browser%3DSafari%20component%3DWebDriver%20status%3ANew%2CAccepted%2CWorkingAsIntended%2CWontFix%2CNotFeasible&colspec=ID%20Stars%20Type%20Status%20Priority%20Owner%20Summary%20Browser%20Component
233232
# return()
234233
# }
235234

@@ -399,7 +398,7 @@ test_that("MoveWindowPosition", {
399398
new_y <- new_y + 10
400399
}
401400
remDr %>% setWindowPosition(new_x, new_y)
402-
loc = remDr %>% getWindowPosition
401+
loc <- remDr %>% getWindowPosition
403402
}, error = function(e) e)
404403
if(grepl("Selenium Server error", as.character(chk))){
405404
# try old functions
@@ -416,7 +415,7 @@ test_that("MoveWindowPosition", {
416415
new_y <- new_y + 10
417416
}
418417
remDr %>% setWindowPositionOld(new_x, new_y)
419-
loc = remDr %>% getWindowPositionOld
418+
loc <- remDr %>% getWindowPositionOld
420419
}
421420
# change test to be within 10 pixels
422421
expect_lt(abs(loc[['x']] - new_x), 10)

‎tests/testthat/test-executing_javascript_tests.R

+3-2
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,10 @@ test_that("testShouldBeAbleToPassANumberAnAsArgument", {
123123

124124
test_that("testShouldBeAbleToPassAWebElementAsArgument", {
125125
skip_on_cran()
126+
jS <- "arguments[0]['flibble'] = arguments[0].getAttribute('id');
127+
return arguments[0]['flibble']"
126128
value <- remDr %>% go(loadPage("javascriptPage")) %>%
127-
executeScript("arguments[0]['flibble'] = arguments[0].getAttribute('id'); return arguments[0]['flibble']"
128-
, list(remDr %>% findElement("id", "plainButton")))
129+
executeScript(jS, list(remDr %>% findElement("id", "plainButton")))
129130
expect_identical(value, "plainButton")
130131
}
131132
)

‎tests/testthat/test-frame_switching_tests.R

+15-11
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test_that("testShouldAlwaysFocusOnTheTopMostFrameAfterANavigationEvent", {
1717
}
1818
)
1919

20-
test_that("testShouldNotAutomaticallySwitchFocusToAnIFrameWhenAPageContainingThemIsLoaded", {
20+
test_that("testNotSwitchFocusToAnIFrameWhenAPageContainingThemIsLoaded", {
2121
skip_on_cran()
2222
result <- remDr %>% go(loadPage("iframes")) %>%
2323
findElement("id", "iframe_page_heading")
@@ -113,7 +113,7 @@ test_that("testShouldBeAbleToSwitchToFrameWithNameContainingDot", {
113113
}
114114
)
115115

116-
test_that("testShouldBeAbleToSwitchToAFrameUsingAPreviouslyLocatedWebElement", {
116+
test_that("testBeAbleToSwitchToAFrameUsingAPreviouslyLocatedWebElement", {
117117
skip_on_cran()
118118
frame <- remDr %>% go(loadPage("frameset")) %>%
119119
findElement("tag name", "frame")
@@ -124,7 +124,7 @@ test_that("testShouldBeAbleToSwitchToAFrameUsingAPreviouslyLocatedWebElement", {
124124
}
125125
)
126126

127-
test_that("testShouldBeAbleToSwitchToAnIFrameUsingAPreviouslyLocatedWebElement", {
127+
test_that("testBeAbleToSwitchToIFrameUsingAPreviouslyLocatedWebElement", {
128128
skip_on_cran()
129129
frame <- remDr %>% go(loadPage("iframes")) %>%
130130
findElement("tag name", "iframe")
@@ -165,7 +165,7 @@ test_that("testShouldSelectChildFramesByChainedCalls", {
165165
}
166166
)
167167

168-
test_that("testShouldThrowFrameNotFoundExceptionLookingUpSubFramesWithSuperFrameNames", {
168+
test_that("testThrowExceptionLookingUpSubFramesWithSuperFrameNames", {
169169
skip_on_cran()
170170
expect_error(remDr %>% go(loadPage("frameset")) %>%
171171
switchToFrame(remDr %>% findElement("name", "fourth")) %>%
@@ -178,7 +178,8 @@ test_that("testShouldThrowAnExceptionWhenAFrameCannotBeFound", {
178178
skip_on_cran()
179179
expect_error(
180180
result <- remDr %>% go(loadPage("xhtmlTest")) %>%
181-
switchToFrame(remDr %>% findElement("name", "Nothing here", retry = FALSE))
181+
switchToFrame(remDr %>% findElement("name", "Nothing here",
182+
retry = FALSE))
182183
)
183184
expect_identical(errorContent()$status, 7L)
184185
}
@@ -306,7 +307,8 @@ test_that("testGetCurrentUrlReturnsTopLevelBrowsingContextUrl", {
306307
result <- remDr %>% go(loadPage("frameset")) %>%
307308
getCurrentUrl
308309
expect_identical(result, loadPage("frameset"))
309-
result <- remDr %>% switchToFrame(remDr %>% findElement("name", "second")) %>%
310+
result <- remDr %>%
311+
switchToFrame(remDr %>% findElement("name", "second")) %>%
310312
getCurrentUrl
311313
expect_identical(result, loadPage("frameset"))
312314
}
@@ -317,13 +319,14 @@ test_that("testGetCurrentUrlReturnsTopLevelBrowsingContextUrlForIframes", {
317319
result <- remDr %>% go(loadPage("iframes")) %>%
318320
getCurrentUrl
319321
expect_identical(result, loadPage("iframes"))
320-
result <- remDr %>% switchToFrame(remDr %>% findElement("id", "iframe1")) %>%
322+
result <- remDr %>%
323+
switchToFrame(remDr %>% findElement("id", "iframe1")) %>%
321324
getCurrentUrl
322325
expect_identical(result, loadPage("iframes"))
323326
}
324327
)
325328

326-
test_that("testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUs", {
329+
test_that("testShouldSwitchToTheTopIfTheFrameIsDeletedFromUnderUs", {
327330
skip_on_cran()
328331
remDr %>% go(loadPage("frame_switching_tests/deletingFrame")) %>%
329332
switchToFrame(remDr %>% findElement("id", "iframe1")) %>%
@@ -337,7 +340,7 @@ test_that("testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUs", {
337340
}
338341
)
339342

340-
test_that("testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithFrameIndex", {
343+
test_that("testShouldSwitchToTheTopIfTheFrameIsDeletedFromUnderUs", {
341344
skip_on_cran()
342345
remDr %>% go(loadPage("frame_switching_tests/deletingFrame")) %>%
343346
switchToFrame(0L) %>%
@@ -351,7 +354,7 @@ test_that("testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithFra
351354
}
352355
)
353356

354-
test_that("testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithWebelement", {
357+
test_that("testShouldSwitchToTheTopIfTheFrameIsDeletedWithWebelement", {
355358
skip_on_cran()
356359
remDr %>% go(loadPage("frame_switching_tests/deletingFrame")) %>%
357360
switchToFrame(remDr %>% findElement("id", "iframe1")) %>%
@@ -380,7 +383,8 @@ test_that("testJavaScriptShouldExecuteInTheContextOfTheCurrentFrame", {
380383
result <- remDr %>% go(loadPage("frameset")) %>%
381384
executeScript("return window == window.top")
382385
expect_true(result)
383-
result <- remDr %>% switchToFrame(remDr %>% findElement("name", "third")) %>%
386+
result <- remDr %>%
387+
switchToFrame(remDr %>% findElement("name", "third")) %>%
384388
executeScript("return window != window.top")
385389
expect_true(result)
386390
}

‎tests/testthat/test-page_loading_tests.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ test_that("testShouldBeAbleToNavigateBackInTheBrowserHistory", {
4949
}
5050
)
5151

52-
test_that("testShouldBeAbleToNavigateBackInTheBrowserHistoryInPresenceOfIframes", {
52+
test_that("testShouldBeAbleToNavigateBackInPresenceOfIframes", {
5353
skip_on_cran()
5454
remDr %>% go(loadPage("xhtmlTest")) %>%
5555
findElement("name", "sameWindow") %>%
@@ -74,7 +74,7 @@ test_that("testShouldBeAbleToNavigateForwardsInTheBrowserHistory", {
7474
}
7575
)
7676

77-
test_that("testShouldNotHangifDocumentOpenCallIsNeverFollowedByDocumentCloseCall", {
77+
test_that("testShouldNotHangifOpenCallIsNeverFollowedByCloseCall", {
7878
skip_on_cran()
7979
result <- remDr %>% go(loadPage("document_write_in_onload")) %>%
8080
findElement("xpath", "//body")

0 commit comments

Comments
 (0)
Please sign in to comment.