Module: OnlyofficeWebdriverWrapper::WebdriverHelper
- Included in:
- WebDriver
- Defined in:
- lib/onlyoffice_webdriver_wrapper/webdriver/webdriver_helper.rb
Overview
Some additional methods for webdriver
Instance Method Summary collapse
-
#download(file_url) ⇒ String
Download temp file and return it location.
- #system_screenshot(file_name) ⇒ Object
Instance Method Details
#download(file_url) ⇒ String
Download temp file and return it location
14 15 16 17 18 19 20 |
# File 'lib/onlyoffice_webdriver_wrapper/webdriver/webdriver_helper.rb', line 14 def download(file_url) data = Kernel.open(file_url, &:read) file = Tempfile.new('onlyoffice-downloaded-file') file.write(data) file.close file.path end |
#system_screenshot(file_name) ⇒ Object
7 8 9 |
# File 'lib/onlyoffice_webdriver_wrapper/webdriver/webdriver_helper.rb', line 7 def system_screenshot(file_name) `import -window root #{file_name}` end |