DEV: Store smoke tests failure image in a dedicated tmp folder.

This commit is contained in:
Guo Xiang Tan 2018-05-30 15:59:07 +08:00
parent 30279a4843
commit fe5a48997c
2 changed files with 4 additions and 1 deletions

View File

@ -26,6 +26,9 @@ task "smoke:test" do
request.basic_auth(ENV['AUTH_USER'], ENV['AUTH_PASSWORD']) request.basic_auth(ENV['AUTH_USER'], ENV['AUTH_PASSWORD'])
end end
dir = 'tmp/smoke-test-screenshots'
FileUtils.mkdir_p(dir) unless Dir.exists?(dir)
start = Time.now start = Time.now
while true while true
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http| response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|

View File

@ -26,7 +26,7 @@ const path = require('path');
}); });
const takeFailureScreenshot = function() { const takeFailureScreenshot = function() {
const screenshotPath = `${process.env.SCREENSHOT_PATH || 'tmp'}/smoke-test.png`; const screenshotPath = `${process.env.SCREENSHOT_PATH || 'tmp/smoke-test-screenshots'}/smoke-test-${Date.now()}.png`;
console.log(`Screenshot of failure taken at ${screenshotPath}`); console.log(`Screenshot of failure taken at ${screenshotPath}`);
return page.screenshot({ path: screenshotPath, fullPage: true }); return page.screenshot({ path: screenshotPath, fullPage: true });
}; };