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
16 17 18 19 20 21 22 |
# File 'lib/onlyoffice_webdriver_wrapper/webdriver/webdriver_helper.rb', line 16 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
9 10 11 |
# File 'lib/onlyoffice_webdriver_wrapper/webdriver/webdriver_helper.rb', line 9 def system_screenshot(file_name) `import -window root #{file_name}` end |