root/mail-onna-stick/trunk/lib/mosweb/static/selenium/tests/MOSCommentary.html

Revision 313, 3.5 kB (checked in by grig, 11 years ago)

Changed Ajax-specific test (MOSCommentary.html) to use waitForCondition instead of pause. Hopefully this way there will be no more failing tests due to differences in speed across platforms.

Line 
1 <html>
2 <head><title>TestBrowseMailsources</title></head>
3 <body>
4 <table cellpadding="1" cellspacing="1" border="1">
5 <thead>
6 <tr><td rowspan="1" colspan="3">TestCommentary</td></tr>
7 </thead><tbody>
8 <tr>
9         <td>open</td>
10         <td>/message/20050409174524.GA4854@highenergymagic.org</td>
11         <td></td>
12 </tr>
13 <tr>
14     <td>dblclick</td>
15     <td>//blockquote</td>
16     <td></td>
17 </tr>
18 <tr>
19     <td>waitForCondition</td>
20     <td>var value = selenium.getText("//textarea[@name='comment']");
21         value == ""
22     </td>
23     <td>10000</td>
24 </tr>
25 <!--
26 <tr>
27     <td>pause</td>
28     <td>2000</td>
29     <td></td>
30 </tr>
31 -->
32 <tr>
33     <td>store</td>
34     <td>javascript{Math.round(1000*Math.random())}</td>
35     <td>var</td>
36 </tr>
37 <tr>
38     <td>type</td>
39     <td>username</td>
40     <td>user${var}</td>
41 </tr>
42 <tr>
43     <td>type</td>
44     <td>email</td>
45     <td>user${var}@mos.org</td>
46 </tr>
47 <tr>
48     <td>type</td>
49     <td>comment</td>
50     <td>hello there from user${var}</td>
51 </tr>
52 <tr>
53         <td>click</td>
54     <td>//form//button[1]</td>
55     <td></td>
56 </tr>
57 <tr>
58     <td>waitForCondition</td>
59     <td>var value = selenium.getText("//div[@class='commentary-comment commentary-inline']"); value.match(/hello there from user${var}/);</td>
60     <td>10000</td>
61 </tr>
62 <!--
63 <tr>
64     <td>pause</td>
65     <td>5000</td>
66     <td></td>
67 </tr>
68 -->
69 <tr>
70     <td>verifyText</td>
71     <td>//div[@class="commentary-comment commentary-inline"]</td>
72     <td>regexp:hello there from user${var}</td>
73 </tr>
74 <tr>
75     <td>clickAndWait</td>
76     <td>//div/div[position()="1" and @style="font-size: 80%;"]/a[position()="2" and @href="/search"]</td>
77     <td></td>
78 </tr>
79 <tr>
80     <td>type</td>
81     <td>q</td>
82     <td>user${var}</td>
83 </tr>
84 <tr>
85     <td>clickAndWait</td>
86     <td>//input[@type='submit' and @value='search']</td>
87     <td></td>
88 </tr>
89 <tr>
90         <td>verifyValue</td>
91         <td>q</td>
92         <td>user${var}</td>
93 </tr>
94 <tr>
95         <td>assertTextPresent</td>
96         <td>Query: user${var}</td>
97         <td></td>
98 </tr>
99 <tr>
100         <td>assertTextPresent</td>
101         <td>in Re: [socal-piggies] meeting Tues Apr 12th: confirmed</td>
102         <td></td>
103 </tr>
104 <tr>
105     <td>open</td>
106     <td>/message/20050409174524.GA4854@highenergymagic.org</td>
107     <td></td>
108 </tr>
109 <tr>
110     <td>assertTextPresent</td>
111     <td>hello there from user${var}</td>
112     <td></td>
113 </tr>
114 <tr>
115     <td>assertTextPresent</td>
116     <td>delete</td>
117     <td></td>
118 </tr>
119 <tr>
120     <td>click</td>
121     <td>link=delete</td>
122     <td></td>
123 </tr>
124 <tr>
125     <td>waitForCondition</td>
126     <td>
127     var allText = selenium.page().bodyText();
128     var unexpectedText = "hello there from user${var}"
129     allText.indexOf(unexpectedText) == -1;
130     </td>
131     <td>10000</td>
132 </tr>
133 <!--
134 <tr>
135     <td>pause</td>
136     <td>5000</td>
137     <td></td>
138 </tr>
139 -->
140 <tr>
141     <td>assertTextNotPresent</td>
142     <td>hello there from user${var}</td>
143     <td></td>
144 </tr>
145 <tr>
146     <td>assertTextNotPresent</td>
147     <td>delete</td>
148     <td></td>
149 </tr>
150 <tr>
151     <td>clickAndWait</td>
152     <td>//div/div[position()="1" and @style="font-size: 80%;"]/a[position()="2" and @href="/search"]</td>
153     <td></td>
154 </tr>
155 <tr>
156     <td>type</td>
157     <td>q</td>
158     <td>user${var}</td>
159 </tr>
160 <tr>
161     <td>clickAndWait</td>
162     <td>//input[@type='submit' and @value='search']</td>
163     <td></td>
164 </tr>
165 <tr>
166         <td>verifyValue</td>
167         <td>q</td>
168         <td>user${var}</td>
169 </tr>
170 <tr>
171         <td>assertTextPresent</td>
172         <td>Query: user${var}</td>
173         <td></td>
174 </tr>
175 <tr>
176         <td>assertTextPresent</td>
177         <td>no matches</td>
178         <td></td>
179 </tr>
180 </tbody></table>
181 </body>
182 </html>
Note: See TracBrowser for help on using the browser.