1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Strip script in Session rather than Selenium driver

This commit is contained in:
Thomas Walpole 2018-07-20 00:07:30 -07:00
parent e65182aad1
commit 9b834e7445
3 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,10 @@
# Version 3.4.1
Release date: unreleased
### Fixed
* `Session#evaluate_script` now strips the script in `Session` rather than only in the Selenium driver
# Version 3.4.0
Release date: 2018-07-19

View file

@ -99,7 +99,7 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base
end
def evaluate_script(script, *args)
result = execute_script("return #{script.strip}", *args)
result = execute_script("return #{script}", *args)
unwrap_script_result(result)
end

View file

@ -580,7 +580,7 @@ module Capybara
#
def evaluate_script(script, *args)
@touched = true
result = driver.evaluate_script(script, *driver_args(args))
result = driver.evaluate_script(script.strip, *driver_args(args))
element_script_result(result)
end