OLD | NEW |
| (Empty) |
1 -- Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | |
2 -- for details. All rights reserved. Use of this source code is governed by a | |
3 -- BSD-style license that can be found in the LICENSE file. | |
4 | |
5 tell application "Firefox 29" to activate | |
6 | |
7 delay 3.0 | |
8 | |
9 tell application "System Events" | |
10 keystroke "n" using command down | |
11 | |
12 delay 1.0 | |
13 | |
14 keystroke "l" using command down | |
15 | |
16 keystroke "http://localhost:8080/" | |
17 -- Simulate Enter key. | |
18 key code 36 | |
19 | |
20 delay 10.0 | |
21 | |
22 keystroke "l" using command down | |
23 -- Simulate Tab key. | |
24 key code 48 | |
25 key code 48 | |
26 key code 48 | |
27 key code 48 | |
28 | |
29 -- Simulate End key. | |
30 key code 119 | |
31 | |
32 -- Simulate Home key. | |
33 key code 115 | |
34 | |
35 -- Simulate Tab key. | |
36 key code 48 | |
37 | |
38 -- Simulate Cmd-Up. | |
39 key code 126 using command down | |
40 | |
41 -- Simulate Down. | |
42 key code 125 | |
43 key code 125 | |
44 key code 125 | |
45 key code 125 | |
46 key code 125 | |
47 | |
48 -- Simulate Cmd-Right. | |
49 key code 124 using command down | |
50 | |
51 -- Simulate Delete | |
52 key code 51 | |
53 | |
54 delay 0.1 | |
55 keystroke "a" using command down | |
56 delay 0.2 | |
57 keystroke "c" using command down | |
58 | |
59 delay 0.2 | |
60 set clipboardData to (the clipboard as text) | |
61 | |
62 if ("main() {" is in (clipboardData as string)) then | |
63 error "main() { in clipboardData" | |
64 end if | |
65 | |
66 if ("main() " is not in (clipboardData as string)) then | |
67 error "main() is not in clipboardData" | |
68 end if | |
69 | |
70 keystroke "l" using command down | |
71 delay 0.2 | |
72 | |
73 keystroke "http://localhost:8080/" | |
74 -- Simulate Enter key. | |
75 key code 36 | |
76 | |
77 delay 5.0 | |
78 | |
79 keystroke "l" using command down | |
80 -- Simulate Tab key. | |
81 key code 48 | |
82 key code 48 | |
83 key code 48 | |
84 key code 48 | |
85 | |
86 -- Simulate End key. | |
87 key code 119 | |
88 | |
89 -- Simulate Home key. | |
90 key code 115 | |
91 | |
92 -- Simulate Tab key. | |
93 key code 48 | |
94 | |
95 -- Simulate Cmd-Down. | |
96 key code 125 using command down | |
97 | |
98 repeat 204 times | |
99 -- Simulate Delete | |
100 key code 51 | |
101 end repeat | |
102 | |
103 delay 5.0 | |
104 repeat 64 times | |
105 -- Simulate Delete | |
106 key code 51 | |
107 end repeat | |
108 | |
109 | |
110 delay 0.1 | |
111 keystroke "a" using command down | |
112 delay 0.5 | |
113 keystroke "c" using command down | |
114 | |
115 delay 0.5 | |
116 set clipboardData to (the clipboard as text) | |
117 | |
118 if ("/" is not (clipboardData as string)) then | |
119 error "/ is not clipboardData" | |
120 end if | |
121 | |
122 end tell | |
123 | |
124 tell application "Firefox" to quit | |
125 | |
126 display notification "Test passed" with title "Firefox test" sound name "Glass" | |
OLD | NEW |