Kaynağa Gözat

Wait for idle after doing anything

Change-Id: I36a606e5bb33c3261bc0657335b3eef228e7c4bb
Reviewed-on: http://gerrit.dmdirc.com/788
Reviewed-by: Gregory Holmes <greg@dmdirc.com>
Automatic-Compile: Chris Smith <chris@dmdirc.com>
tags/0.6.3
Chris Smith 14 yıl önce
ebeveyn
işleme
be77c22c46

+ 35
- 2
test/com/dmdirc/addons/ui_swing/dialogs/actioneditor/ActionEditorDialogTest.java Dosyayı Görüntüle

@@ -113,12 +113,17 @@ public class ActionEditorDialogTest extends FestSwingJUnitTestCase {
113 113
 
114 114
         window.panel(new ClassFinder<ActionNamePanel>(ActionNamePanel.class, null)).
115 115
                 textBox().enterText("test1");
116
+        robot().waitForIdle();
117
+
116 118
         final JPanelFixture triggers = window.panel(
117 119
                 new ClassFinder<ActionTriggersPanel>(ActionTriggersPanel.class, null));
118 120
 
119 121
         triggers.comboBox().selectItem("Client closed");
122
+        robot().waitForIdle();
123
+        
120 124
         triggers.button(JButtonMatcher.withText("Add")).requireEnabled().
121 125
                 click();
126
+        robot().waitForIdle();
122 127
 
123 128
         window.panel(new ClassFinder<ActionConditionsPanel>(ActionConditionsPanel.class, null)).
124 129
                 button(JButtonMatcher.withText("Add")).requireDisabled();
@@ -134,11 +139,14 @@ public class ActionEditorDialogTest extends FestSwingJUnitTestCase {
134 139
 
135 140
         window.panel(new ClassFinder<ActionNamePanel>(ActionNamePanel.class, null)).
136 141
                 textBox().enterText("test1");
142
+        robot().waitForIdle();
137 143
 
138 144
         final int items = triggers.comboBox().target.getItemCount();
139 145
         triggers.comboBox().requireEnabled().selectItem("Channel message received");
140
-        triggers.button(JButtonMatcher.withText("Add")).requireEnabled().
141
-                click();
146
+        robot().waitForIdle();
147
+
148
+        triggers.button(JButtonMatcher.withText("Add")).requireEnabled().click();
149
+        robot().waitForIdle();
142 150
 
143 151
         final JLabelFixture label =
144 152
                 triggers.label(JLabelMatcher.withText("Channel message received"));
@@ -149,14 +157,18 @@ public class ActionEditorDialogTest extends FestSwingJUnitTestCase {
149 157
 
150 158
         window.panel(new ClassFinder<ActionNamePanel>(ActionNamePanel.class, null)).
151 159
                 textBox().deleteText();
160
+        robot().waitForIdle();
161
+
152 162
         triggers.button(new ClassFinder<ImageButton>(ImageButton.class, null)).
153 163
                 requireDisabled();
154 164
         triggers.comboBox().requireDisabled();
155 165
         window.panel(new ClassFinder<ActionNamePanel>(ActionNamePanel.class, null)).
156 166
                 textBox().enterText("test1");
167
+        robot().waitForIdle();
157 168
 
158 169
         triggers.button(new ClassFinder<ImageButton>(ImageButton.class, null)).
159 170
                 requireEnabled().click();
171
+        robot().waitForIdle();
160 172
 
161 173
         for (Component comp : triggers.panel(new ClassFinder<ActionTriggersListPanel>(ActionTriggersListPanel.class,
162 174
                 null)).target.getComponents()) {
@@ -173,12 +185,16 @@ public class ActionEditorDialogTest extends FestSwingJUnitTestCase {
173 185
 
174 186
         window.panel(new ClassFinder<ActionNamePanel>(ActionNamePanel.class, null)).
175 187
                 textBox().enterText("test1");
188
+        robot().waitForIdle();
189
+
176 190
         final JPanelFixture triggers = window.panel(
177 191
                 new ClassFinder<ActionTriggersPanel>(ActionTriggersPanel.class, null));
178 192
 
179 193
         triggers.comboBox().selectItem("Channel message received");
194
+        robot().waitForIdle();
180 195
         triggers.button(JButtonMatcher.withText("Add")).requireEnabled().
181 196
                 click();
197
+        robot().waitForIdle();
182 198
 
183 199
         window.radioButton(new JRadioButtonByTextMatcher("All of the conditions are true")).
184 200
                 requireEnabled().requireSelected();
@@ -194,9 +210,11 @@ public class ActionEditorDialogTest extends FestSwingJUnitTestCase {
194 210
 
195 211
         window.radioButton(new JRadioButtonByTextMatcher("The conditions match a custom rule")).
196 212
                 click().requireSelected();
213
+        robot().waitForIdle();
197 214
         window.panel(new ClassFinder<ActionConditionsTreePanel>(ActionConditionsTreePanel.class,
198 215
                 null)).textBox(new ClassFinder<JTextField>(JTextField.class,
199 216
                 null)).requireEnabled().enterText("invalid");
217
+        robot().waitForIdle();
200 218
 
201 219
         window.button(JButtonMatcher.withText("OK")).requireDisabled();
202 220
     }
@@ -207,16 +225,20 @@ public class ActionEditorDialogTest extends FestSwingJUnitTestCase {
207 225
 
208 226
         window.panel(new ClassFinder<ActionNamePanel>(ActionNamePanel.class, null)).
209 227
                 textBox().enterText("test1");
228
+        robot().waitForIdle();
210 229
         final JPanelFixture triggers = window.panel(
211 230
                 new ClassFinder<ActionTriggersPanel>(ActionTriggersPanel.class, null));
212 231
 
213 232
         triggers.comboBox().selectItem("Channel message received");
233
+        robot().waitForIdle();
214 234
         triggers.button(JButtonMatcher.withText("Add")).requireEnabled().
215 235
                 click();
236
+        robot().waitForIdle();
216 237
 
217 238
         window.panel(new ClassFinder<ActionConditionsPanel>(ActionConditionsPanel.class, null)).
218 239
                 button(JButtonMatcher.withText("Add")).requireEnabled().
219 240
                 click();
241
+        robot().waitForIdle();
220 242
         
221 243
         Pattern pattern = Pattern.compile(".+<body>(.+)</body>.+", Pattern.DOTALL);
222 244
         
@@ -228,6 +250,7 @@ public class ActionEditorDialogTest extends FestSwingJUnitTestCase {
228 250
 
229 251
         window.panel(new ClassFinder<ActionConditionEditorPanel>(ActionConditionEditorPanel.class,
230 252
                 null)).comboBox("argument").selectItem("message");
253
+        robot().waitForIdle();
231 254
         
232 255
         matcher = pattern.matcher(window.panel(new ClassFinder<ActionConditionDisplayPanel>(ActionConditionDisplayPanel.class,
233 256
                 null)).textBox(new ClassFinder<TextLabel>(TextLabel.class,
@@ -237,6 +260,7 @@ public class ActionEditorDialogTest extends FestSwingJUnitTestCase {
237 260
 
238 261
         window.panel(new ClassFinder<ActionConditionEditorPanel>(ActionConditionEditorPanel.class,
239 262
                 null)).comboBox("component").selectItem("content");
263
+        robot().waitForIdle();
240 264
         
241 265
         matcher = pattern.matcher(window.panel(new ClassFinder<ActionConditionDisplayPanel>(ActionConditionDisplayPanel.class,
242 266
                 null)).textBox(new ClassFinder<TextLabel>(TextLabel.class,
@@ -246,6 +270,7 @@ public class ActionEditorDialogTest extends FestSwingJUnitTestCase {
246 270
 
247 271
         window.panel(new ClassFinder<ActionConditionEditorPanel>(ActionConditionEditorPanel.class,
248 272
                 null)).comboBox("comparison").selectItem("contains");
273
+        robot().waitForIdle();
249 274
         
250 275
         matcher = pattern.matcher(window.panel(new ClassFinder<ActionConditionDisplayPanel>(ActionConditionDisplayPanel.class,
251 276
                 null)).textBox(new ClassFinder<TextLabel>(TextLabel.class,
@@ -255,6 +280,7 @@ public class ActionEditorDialogTest extends FestSwingJUnitTestCase {
255 280
 
256 281
         window.panel(new ClassFinder<ActionConditionEditorPanel>(ActionConditionEditorPanel.class,
257 282
                 null)).textBox().enterText("foo");
283
+        robot().waitForIdle();
258 284
         
259 285
         matcher = pattern.matcher(window.panel(new ClassFinder<ActionConditionDisplayPanel>(ActionConditionDisplayPanel.class,
260 286
                 null)).textBox(new ClassFinder<TextLabel>(TextLabel.class,
@@ -269,16 +295,20 @@ public class ActionEditorDialogTest extends FestSwingJUnitTestCase {
269 295
 
270 296
         window.panel(new ClassFinder<ActionNamePanel>(ActionNamePanel.class, null)).
271 297
                 textBox().enterText("test1");
298
+        robot().waitForIdle();
272 299
         final JPanelFixture triggers = window.panel(
273 300
                 new ClassFinder<ActionTriggersPanel>(ActionTriggersPanel.class, null));
274 301
 
275 302
         triggers.comboBox().selectItem("Channel message received");
303
+        robot().waitForIdle();
276 304
         triggers.button(JButtonMatcher.withText("Add")).requireEnabled().click();
305
+        robot().waitForIdle();
277 306
 
278 307
         window.button(JButtonMatcher.withText("OK")).requireEnabled();
279 308
 
280 309
         window.panel(new ClassFinder<ActionConditionsPanel>(ActionConditionsPanel.class, null)).
281 310
                 button(JButtonMatcher.withText("Add")).requireEnabled().click();
311
+        robot().waitForIdle();
282 312
 
283 313
         window.panel(new ClassFinder<ActionConditionEditorPanel>(ActionConditionEditorPanel.class,
284 314
                 null)).comboBox("argument").requireEnabled();
@@ -292,6 +322,7 @@ public class ActionEditorDialogTest extends FestSwingJUnitTestCase {
292 322
 
293 323
         window.panel(new ClassFinder<ActionConditionEditorPanel>(ActionConditionEditorPanel.class,
294 324
                 null)).comboBox("argument").selectItem("message");
325
+        robot().waitForIdle();
295 326
         window.panel(new ClassFinder<ActionConditionEditorPanel>(ActionConditionEditorPanel.class,
296 327
                 null)).comboBox("component").requireEnabled();
297 328
         window.panel(new ClassFinder<ActionConditionEditorPanel>(ActionConditionEditorPanel.class,
@@ -302,6 +333,7 @@ public class ActionEditorDialogTest extends FestSwingJUnitTestCase {
302 333
 
303 334
         window.panel(new ClassFinder<ActionConditionEditorPanel>(ActionConditionEditorPanel.class,
304 335
                 null)).comboBox("component").selectItem("content");
336
+        robot().waitForIdle();
305 337
         window.panel(new ClassFinder<ActionConditionEditorPanel>(ActionConditionEditorPanel.class,
306 338
                 null)).comboBox("comparison").requireEnabled();
307 339
         window.panel(new ClassFinder<ActionConditionEditorPanel>(ActionConditionEditorPanel.class,
@@ -310,6 +342,7 @@ public class ActionEditorDialogTest extends FestSwingJUnitTestCase {
310 342
 
311 343
         window.panel(new ClassFinder<ActionConditionEditorPanel>(ActionConditionEditorPanel.class,
312 344
                 null)).comboBox("comparison").selectItem("contains");
345
+        robot().waitForIdle();
313 346
         window.panel(new ClassFinder<ActionConditionEditorPanel>(ActionConditionEditorPanel.class,
314 347
                 null)).textBox().requireEnabled();
315 348
         window.button(JButtonMatcher.withText("OK")).requireEnabled();

Loading…
İptal
Kaydet