You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i have the below code in my env.rb to generate screenshots for failed and passed scenarios.
def take_screenshot(scenario)
if scenario.failed?
scenario_name = scenario.name.gsub /[^\w-]/, ' '
time = Time.now.strftime("%Y-%m-%d %H%M")
Dir.mkdir("failed_png") unless File.directory?("failed_png")
filename = time + ' - ' + scenario_name + '.png'
screenshot_path = './failed_png/' + filename
save_screenshot(screenshot_path)
embed ('../../failed_png/' + filename), 'image/png'
else
scenario_name = scenario.name.gsub /[^\w-]/, ' '
time = Time.now.strftime("%Y-%m-%d %H%M")
Dir.mkdir("success_png") unless File.directory?("success_png")
filename = time + ' - ' + scenario_name + '.png'
screenshot_path = './success_png/' + filename
save_screenshot(screenshot_path)
embed ('../../success_png/' + filename), 'image/png'
end
end
After do |scenario|
take_screenshot(scenario)
end
the above code creates images in my success_png folder . here below the snap shot of my folder structure .
when i do this , i get the pretty face report of my scenario, image is displayed correctly but i get the failure scenario due to the error in the command line like below:
and when i inspect the image in pretty face report html, i can see the path is valid and i can see the image when i click , but why this error? here is the src in the pretty_face html report
due to this my scenarios are failing. can u let me know what i shall do to get rid of the this error . i am using pretty_face version 0.10.1 with actionpack 4.0.4.
another issue , i am facing is , no matter what if i put the pretty_face arguments like this in default yml file in cucumber, it doesnt run the report. i have to always put a seperate profile in the yml for generating pretty_face report. i am doing something wrong ?
hi ,
i have the below code in my env.rb to generate screenshots for failed and passed scenarios.
def take_screenshot(scenario)
if scenario.failed?
scenario_name = scenario.name.gsub /[^\w-]/, ' '
time = Time.now.strftime("%Y-%m-%d %H%M")
Dir.mkdir("failed_png") unless File.directory?("failed_png")
filename = time + ' - ' + scenario_name + '.png'
screenshot_path = './failed_png/' + filename
save_screenshot(screenshot_path)
embed ('../../failed_png/' + filename), 'image/png'
else
scenario_name = scenario.name.gsub /[^\w-]/, ' '
time = Time.now.strftime("%Y-%m-%d %H%M")
Dir.mkdir("success_png") unless File.directory?("success_png")
filename = time + ' - ' + scenario_name + '.png'
screenshot_path = './success_png/' + filename
save_screenshot(screenshot_path)
embed ('../../success_png/' + filename), 'image/png'
end
end
After do |scenario|
take_screenshot(scenario)
end
the above code creates images in my success_png folder . here below the snap shot of my folder structure .
when i do this , i get the pretty face report of my scenario, image is displayed correctly but i get the failure scenario due to the error in the command line like below:
and when i inspect the image in pretty face report html, i can see the path is valid and i can see the image when i click , but why this error? here is the src in the pretty_face html report
src="images/../../success_png/2014-05-13 0949 - Valid Login.png"
due to this my scenarios are failing. can u let me know what i shall do to get rid of the this error . i am using pretty_face version 0.10.1 with actionpack 4.0.4.
another issue , i am facing is , no matter what if i put the pretty_face arguments like this in default yml file in cucumber, it doesnt run the report. i have to always put a seperate profile in the yml for generating pretty_face report. i am doing something wrong ?
default: --format pretty --tag ~@wip --format PrettyFace::Formatter::Html --out results/index.html
The text was updated successfully, but these errors were encountered: