Skip to content

Commit

Permalink
Working more on the recorder and ide
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.getwindmill.com/trunk@176 78c7df6f-8922-0410-bcd3-9426b1ad491b
  • Loading branch information
admc committed Apr 30, 2007
1 parent 8f30170 commit 2d41beb
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 14 deletions.
10 changes: 5 additions & 5 deletions windmill/js/lib/builder.js
Expand Up @@ -3,7 +3,7 @@
};


function methodSelected() {
opener.windmill.builder.methodSelected =function() {
var method = $('methodDD').value;

//Reset values for when the user changes the actions
Expand Down Expand Up @@ -74,7 +74,7 @@
//Set the text to reflect whats been selected
$('methodName').innerHTML = "How will you be accessing the element you would like to "+method+".";
}
function getActionString(){
opener.windmill.builder.getActionString = function(){
var paramsString = "";


Expand Down Expand Up @@ -103,7 +103,7 @@
}

//Create the json string
function addAction() {
opener.windmill.builder.addAction = function() {

actionString = getActionString();
$('test').value = $('test').value +actionString+"\n";
Expand All @@ -118,9 +118,9 @@
}

//Append action to the recorder
function addToRecorder(){
opener.windmill.builder.addToRecorder = function(){

action = getActionString();
action = opener.windmill.builder.getActionString();
$("wmTest").value = $("wmTest").value + action +'}\n';
}

Expand Down
21 changes: 20 additions & 1 deletion windmill/js/lib/ui.js
Expand Up @@ -185,6 +185,9 @@ windmill.ui = new function() {
else if ((typeof(e.target.onclick) != "undefined") || (locator == 'link')){
windmill.remote.document.getElementById("wmTest").value = windmill.remote.document.getElementById("wmTest").value + '{"method": "'+e.type+'", "params":{"'+locator+'": "'+locValue+'"}}\n';
}
else if ((typeof(e.target.onclick) != "undefined") || (locator == 'link')){
windmill.remote.document.getElementById("wmTest").value = windmill.remote.document.getElementById("wmTest").value + '{"method": "'+e.type+'", "params":{"'+locator+'": "'+locValue+'"}}\n';
}
}
}
windmill.ui.scrollRecorderTextArea();
Expand Down Expand Up @@ -271,8 +274,9 @@ windmill.ui = new function() {
}

//Handle key listeners for windmill remote shortcuts
this.remoteAttach = function(e){
this.remoteKeyPress = function(e){
var tabNum = parseInt(windmill.remote.tabs.aid.replace('tab',''));
console.log(e);

//If they are pressing ctrl and left arrow
if ((e.keyCode == 37) && (e.ctrlKey == true)){
Expand All @@ -292,6 +296,20 @@ windmill.ui = new function() {
var focusTab = 'tab'+ tabNum;
windmill.remote.tabs.focus(focusTab);
}

//keyboard shortcut to run your recorded test
if ((e.charCode == 114) && (e.ctrlKey == true)){
if (windmill.remote.document.getElementById('wmTest').value != ""){
windmill.ui.sendPlayBack();
}
}

//ctrl b, gets the action from the builder and adds it to the recorder
if ((e.charCode == 98) && (e.ctrlKey == true)){
if (windmill.remote.document.getElementById('methodDD').value != ""){
windmill.builder.addToRecorder();
}
}

}

Expand Down Expand Up @@ -332,6 +350,7 @@ windmill.ui = new function() {
var params_obj = {};
json_object.params = params_obj;
var json_string = fleegix.json.serialize(json_object)
json_string = json_string.replace('\\', '');
fleegix.xhr.doPost(resp, '/windmill-jsonrpc/', json_string);

}
Expand Down
4 changes: 2 additions & 2 deletions windmill/js/lib/windmill.js
Expand Up @@ -20,7 +20,7 @@ var windmill = new function () {
this.init = function (b){
browser = b;
}

this.builder={};
//So that users can generate a user for the current test randomly
//Usually you want one username for the test so you can set it once and leave it for the test
//a user can write a method to set overWrite to true if they want to replace it each time %random% is used in a json test
Expand All @@ -40,7 +40,7 @@ var windmill = new function () {
windmill.ui.writePerformance("<br>Starting UI performance session.<br> <b>User Environment: " + browser.current_ua + ".</b><br>");
load_timer.write();

fleegix.event.listen(windmill.remote.document, 'onkeypress', windmill.ui, 'remoteAttach');
fleegix.event.listen(windmill.remote.document, 'onkeypress', windmill.ui, 'remoteKeyPress');
fleegix.event.listen(windmill.testingApp.document, 'onkeypress', windmill.ui, 'getRemote');

}
Expand Down
17 changes: 11 additions & 6 deletions windmill/js/remote.html
Expand Up @@ -15,10 +15,15 @@
<body onload="javascript:opener.windmill.Start();">

<div id="tab1" style="display:none">
<img src="ide/img/logo.jpg">
<div style="width:90%">Welcome to <b>Windmill</b>!<br><br>
Windmill is a web testing framework intended for complete automation of user interface testing, with strong test debugging capabilities.
<table border="0" cellspacing="5" cellpadding="5">
<tr><td><img src="ide/img/logo.jpg"></td>
<td><div style="font: 10pt arial;"><br><br>
<b>Windmill</b> is a web testing framework intended for complete automation of user interface testing, with strong test debugging capabilities.
</div>
</td>
</tr>
</table>

<br><br>
<!--If tests should have started running but didn't:
<input type="button" id="reload" value="Start" onClick="javascript:opener.windmill.controller.continueLoop();">-->
Expand Down Expand Up @@ -96,7 +101,7 @@
<div id="method" style="border:1px solid #aaaaaa;">
<table style="font:9pt arial"><tr><td colspan="2" width="100%">
<b>Choose the user action you would like to simulate.</b><br><br>
Windmill Method: <SELECT NAME="method" id="methodDD" onchange="methodSelected()">
Windmill Method: <SELECT NAME="method" id="methodDD" onchange="opener.windmill.builder.methodSelected()">
<OPTION VALUE="">Choose Method</option>
<OPTION VALUE="open">open</option>
<OPTION VALUE="click">click</option>
Expand Down Expand Up @@ -155,8 +160,8 @@
</table>
</div>

<input type="submit" value="Add Action to Test" onclick="addAction();">
<input type="submit" value="Append Action to Recorder Test" onclick="addToRecorder()">
<input type="submit" value="Add Action to Test" onclick="opener.windmill.builder.addAction();">
<input type="submit" value="Append Action to Recorder Test" onclick="opener.windmill.builder.addToRecorder()">
<div id="messages" style="visibility:hidden;">Action added..</div>

</div>
Expand Down

0 comments on commit 2d41beb

Please sign in to comment.