lib/webdriver/screenshot.rb in aipim-rails-0.0.174 vs lib/webdriver/screenshot.rb in aipim-rails-0.0.179

- old
+ new

@@ -14,10 +14,12 @@ page.driver.browser.manage.window.maximize page.driver.browser.manage.window.resize_to(SCREENSHOT_WIDTH, SCREENSHOT_HEIGHT) end After do - if (@ScenarioTags.include?('@screenshot') && @ScenarioTags.include?('@javascript')) && !page.driver.browser.nil? + config = YAML.load_file("config/aipim.yml") + + if (@ScenarioTags.include?('@screenshot') && @ScenarioTags.include?('@javascript') && !page.driver.browser.nil? && config['screenshot']) path = "aipim/screenshots/#{@FeatureFile}" system("mkdir -p #{path}") sleep(1.0) page.driver.save_screenshot("#{path}/#{Time.now.to_i}.png") \ No newline at end of file