Sha256: 33f378792826f17b6b20f2b89165c20b1acfec0068d938e38cc5313b70c7fa71

Contents?: true

Size: 767 Bytes

Versions: 10

Compression:

Stored size: 767 Bytes

Contents

require 'selenium-webdriver'

%x[rm -r aipim/screenshots/*]

Before do |scenario|
	@ScenarioTitle = scenario.title
	@ScenarioDescription = scenario.description
	@FeatureFile = scenario.file.to_s.split('/')
	@FeatureFile.delete_at(0)
	@FeatureFile = @FeatureFile.join('/')
	@FeatureName = scenario.feature.title
	@ScenarioTags = scenario.source_tag_names

	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?
		path = "aipim/screenshots/#{@FeatureFile}"
		system("mkdir -p #{path}")

		sleep(1.0)
		page.driver.save_screenshot("#{path}/#{Time.now.to_i}.png")
	end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
aipim-rails-0.0.174 lib/webdriver/screenshot.rb
aipim-rails-0.0.172 lib/webdriver/screenshot.rb
aipim-rails-0.0.169 lib/webdriver/screenshot.rb
aipim-rails-0.0.168 lib/webdriver/screenshot.rb
aipim-rails-0.0.166 lib/webdriver/screenshot.rb
aipim-rails-0.0.161 lib/webdriver/screenshot.rb
aipim-rails-0.0.160 lib/webdriver/screenshot.rb
aipim-rails-0.0.159 lib/webdriver/screenshot.rb
aipim-rails-0.0.157 lib/webdriver/screenshot.rb
aipim-rails-0.0.139 lib/webdriver/screenshot.rb