-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuia-console.html
99 lines (98 loc) · 3.29 KB
/
uia-console.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!doctype html>
<!--
TODO:
* Recents
* Links to help (context sensitive?)
-->
<html>
<head>
<title>UIAutomation Console</title>
<style type="text/css">
body {
font-family: Helvetica;
}
textarea {
width: 99%;
height: 200px;
padding: 4px;
border-radius: 5px;
background-color: Black;
font-family: monaco;
color: LightGrey;
font-size: 12px;
}
#cheat-sheet {
margin-top: 15px;
border: solid 1px DimGrey;
border-radius: 5px;
color: DimGray;
}
#cheat-sheet h3 {
margin: 0px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
padding: 5px 10px;
background: -moz-linear-gradient(top, rgba(206,220,231,1) 0%, rgba(89,106,114,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(206,220,231,1)), color-stop(100%,rgba(89,106,114,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(206,220,231,1) 0%,rgba(89,106,114,1) 100%); /* Chrome10+,Safari5.1+ */
font-size: large;
color: White;
text-shadow: 0px -1px Black;
}
#cheat-sheet-content {
padding-left: 10px;
padding-right: 10px;
}
dd {
font-family: monaco;
font-size: 12px;
}
</style>
<script>
function runClicked() {
var ajax = new XMLHttpRequest();
ajax.open("POST", "http://localhost:4567/submit-command", true);
ajax.send(document.getElementById('textarea').value);
}
function continueClicked() {
var ajax = new XMLHttpRequest();
ajax.open("POST", "http://localhost:4567/submit-command", true);
ajax.send("continue");
}
</script>
</head>
<body>
<textarea id="textarea"></textarea>
<div>
<button onclick="runClicked();">Execute</button>
<button onclick="continueClicked();">Continue</button>
</div>
<div id="cheat-sheet">
<h3>Cheat Sheet</h3>
<div id="cheat-sheet-content">
<dl>
<dt>Log main window</dt>
<dd>UIATarget.localTarget().frontMostApp().mainWindow().logElementTree();</dd>
</dl>
<dl>
<dt>Log output</dt>
<dd>UIALogger.logDebug("Hello");</dd>
</dl>
<dl>
<dt>Go to tab</dt>
<dd>UIATarget.localTarget().frontMostApp().mainWindow().tabBar().buttons()["Home"].tap();</dd>
</dl>
<dl>
<dt>Take screenshot</dt>
<dd>UIATarget.localTarget().captureScreenWithName("UIAConsole_screenshot");</dd>
</dl>
</div>
<h3>Links</h3>
<ul>
<li><a href="https://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/UsingtheAutomationInstrument/UsingtheAutomationInstrument.html">UIAutomation Guide</a>
<li><a href="https://developer.apple.com/library/ios/documentation/ToolsLanguages/Reference/UIATargetClassReference/UIATargetClass/UIATargetClass.html">UIATarget reference</a></li>
<li><a href="https://developer.apple.com/library/ios/documentation/ToolsLanguages/Reference/UIAElementClassReference/UIAElement/UIAElement.html">UIAElement reference</a></li>
</ul>
</div>
</body>
</html>