Skip to content

Commit

Permalink
fix screenshot logic to use --tmp dir
Browse files Browse the repository at this point in the history
  • Loading branch information
jlipps committed Oct 13, 2014
1 parent 5f4bdf2 commit 9d8f5c0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/devices/ios/ios-controller.js
Expand Up @@ -1197,12 +1197,13 @@ iOSController.getScreenshot = function (cb) {
var guid = uuid.create();
var command = ["au.capture('screenshot", guid, "')"].join('');

var screenshotFolder = "/tmp/appium-instruments/Run 1/";
if (!fs.existsSync(screenshotFolder)) {
mkdirp.sync(screenshotFolder);
var shotFolder = path.resolve(this.args.tmpDir,
"appium-instruments/Run 1/");
if (!fs.existsSync(shotFolder)) {
mkdirp.sync(shotFolder);
}

var shotPath = [screenshotFolder, 'screenshot', guid, ".png"].join("");
var shotPath = path.resolve(shotFolder, 'screenshot' + guid + '.png');
// Retrying the whole screenshot process for three times.
async.retry(3,
function (cb) {
Expand Down

0 comments on commit 9d8f5c0

Please sign in to comment.