-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathenv.js
More file actions
47 lines (38 loc) · 950 Bytes
/
env.js
File metadata and controls
47 lines (38 loc) · 950 Bytes
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
// This is the Screen object "superclass" that has methods that other screen
// objects can share.
var Screen = function(properties) {
for (key in properties) {
if(properties.hasOwnProperty(key)) {
this[key] = properties[key];
}
}
};
Screen.prototype = {
target: function() {
return UIATarget.localTarget();
},
app: function() {
return this.target().frontMostApp();
},
navBar: function() {
return this.app().navigationBar();
},
window: function() {
return this.app().mainWindow();
}
};
// The specific screen objects that encapsulate the behavior that the user
// does.
ListScreen = new Screen({
tapCellWithName: function(name) {
return this.window().tableViews()[0].cells()[name].tap();
}
});
DetailScreen = new Screen({
displayedText: function() {
return this.window().staticTexts()[0].name();
},
tapBackButton: function() {
this.navBar().leftButton().tap();
}
});