This repository has been archived by the owner on Sep 4, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This introduces new wrappers in automation extension to allow taking a
screenshot and comparing screenshots. Developers taking screenshots can accomplish it using either the API providing a path or using the "Take Screen Shot" button provided on the whitel overlay shown by using "showOverlay()" on the automated spec runner page. If the button is used then developers can grab this newly taken screen shot using new jake task. jake grab-image[ip,file-name] where file-name is the name you want to name the file in the repo. The file is then copied to test/data/automation/ReferenceImages. For comparing images only the name of the image needs to passed in and the current screenshot is compared against an image with that file name on device under /accounts/1000/shared/misc/PuppetMaster/ReferenceImages. To make this process more convinent for developers it augments new agents to the jake deploy-automation. Namely automation-interface and PuppetMasterAgent have been added to the jake task. It also copies all reference images from the repo to device. Take away - * use jake deploy-automation * wait a few minutes and deploy your app and now you can take and compare screenshots. * use jake upload-ssh-key to avoids crazy number of password prompts. * Must restart the device the first installation of the agents. Reviewed By: Bryan Higgins <bhiggins@rim.com> Tested By: Brayan Higging <bhiggins@rim.com>
- Loading branch information
Showing
8 changed files
with
197 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright 2012 Research In Motion Limited. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
var utils = require("./utils"), | ||
jWorkflow = require("jWorkflow"), | ||
_c = require("./conf"); | ||
|
||
module.exports = function (ip, fileName) { | ||
var cmd = "scp root@" + ip + ":/accounts/1000/shared/camera/WebWorksScreenShot.bmp test/data/automation/ReferenceImages/" + fileName; | ||
return function (prev, baton) { | ||
var build = jWorkflow.order(); | ||
baton.take(); | ||
build = build.andThen(utils.execCommandWithJWorkflow(cmd)); | ||
|
||
build.start(function (error) { | ||
if (error) { | ||
baton.drop(error); | ||
} | ||
}); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright 2012 Research In Motion Limited. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
var childProcess = require("child_process"), | ||
util = require("util"), | ||
jWorkflow = require("jWorkflow"), | ||
conf = require("./build/conf"), | ||
grabImage = require("./build/grab-image"); | ||
|
||
function _done(error) { | ||
if (error) { | ||
util.puts("Grabbing image failed:\n" + error); | ||
process.exit(1); | ||
} else { | ||
util.puts("Grabbing image successful"); | ||
process.exit(); | ||
} | ||
} | ||
|
||
module.exports = function () { | ||
var args = Array.prototype.slice.call(arguments)[0], | ||
ip = args[0] || conf.USB_IP, | ||
fileName = args[1] || "TestCase.bmp", | ||
build = jWorkflow.order(grabImage(ip, fileName)); | ||
|
||
build.start(function (error) { | ||
_done(error); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters