@@ -15,8 +15,8 @@ import com.intellij.ide.starter.models.TestCase
15
15
import com.intellij.ide.starter.project.LocalProjectInfo
16
16
import com.intellij.ide.starter.runner.CurrentTestMethod
17
17
import com.intellij.ide.starter.runner.Starter
18
+ import org.assertj.core.api.Assertions.assertThat
18
19
import org.junit.jupiter.api.AfterAll
19
- import org.junit.jupiter.api.Assertions.assertTrue
20
20
import org.junit.jupiter.api.BeforeEach
21
21
import org.junit.jupiter.api.Test
22
22
import org.kodein.di.DI
@@ -77,10 +77,13 @@ class QTestGenerationChatTest {
77
77
openFile(Paths .get(" testModule1" , " HappyPath.java" ).toString())
78
78
Thread .sleep(30000 )
79
79
val result = executePuppeteerScript(testMethodNotFoundErrorScript)
80
- assertTrue(result.contains(" new tab opened" ))
81
- assertTrue(result.contains(" Error message displayed correctly" ))
82
- assertTrue(result.contains(" Input field re-enabled after error" ))
83
- assertTrue(result.contains(" Feedback button found with correct text after error" ))
80
+ assertThat(result)
81
+ .contains(
82
+ " new tab opened" ,
83
+ " Error message displayed correctly" ,
84
+ " Input field re-enabled after error" ,
85
+ " Feedback button found with correct text after error"
86
+ )
84
87
}
85
88
}
86
89
@@ -111,13 +114,16 @@ class QTestGenerationChatTest {
111
114
openFile(Paths .get(" testModule1" , " HappyPath.java" ).toString())
112
115
Thread .sleep(30000 )
113
116
val result = executePuppeteerScript(testCancelButtonScript)
114
- assertTrue(result.contains(" new tab opened" ))
115
- assertTrue(result.contains(" Progress bar text displayed" ))
116
- assertTrue(result.contains(" Cancel button found" ))
117
- assertTrue(result.contains(" Cancel button clicked" ))
118
- assertTrue(result.contains(" Test generation cancelled successfully" ))
119
- assertTrue(result.contains(" Input field re-enabled after cancellation" ))
120
- assertTrue(result.contains(" Feedback button found with correct text" ))
117
+ assertThat(result)
118
+ .contains(
119
+ " new tab opened" ,
120
+ " Progress bar text displayed" ,
121
+ " Cancel button found" ,
122
+ " Cancel button clicked" ,
123
+ " Test generation cancelled successfully" ,
124
+ " Input field re-enabled after cancellation" ,
125
+ " Feedback button found with correct text"
126
+ )
121
127
}
122
128
}
123
129
@@ -148,10 +154,13 @@ class QTestGenerationChatTest {
148
154
openFile(Paths .get(" testModule1" , " HappyPath.java" ).toString())
149
155
Thread .sleep(30000 )
150
156
val result = executePuppeteerScript(testDocumentationErrorScript)
151
- assertTrue(result.contains(" new tab opened" ))
152
- assertTrue(result.contains(" Error message displayed correctly" ))
153
- assertTrue(result.contains(" Input field re-enabled after error" ))
154
- assertTrue(result.contains(" Feedback button found with correct text after error" ))
157
+ assertThat(result)
158
+ .contains(
159
+ " new tab opened" ,
160
+ " Error message displayed correctly" ,
161
+ " Input field re-enabled after error" ,
162
+ " Feedback button found with correct text after error"
163
+ )
155
164
}
156
165
}
157
166
@@ -182,10 +191,13 @@ class QTestGenerationChatTest {
182
191
openFile(Paths .get(" testModule1" , " HappyPath.java" ).toString())
183
192
Thread .sleep(30000 )
184
193
val result = executePuppeteerScript(testRemoveFunctionErrorScript)
185
- assertTrue(result.contains(" new tab opened" ))
186
- assertTrue(result.contains(" Error message displayed correctly" ))
187
- assertTrue(result.contains(" Input field re-enabled after error" ))
188
- assertTrue(result.contains(" Feedback button found with correct text after error" ))
194
+ assertThat(result)
195
+ .contains(
196
+ " new tab opened" ,
197
+ " Error message displayed correctly" ,
198
+ " Input field re-enabled after error" ,
199
+ " Feedback button found with correct text after error"
200
+ )
189
201
}
190
202
}
191
203
@@ -216,8 +228,9 @@ class QTestGenerationChatTest {
216
228
// required wait time for the system to be fully ready
217
229
Thread .sleep(30000 )
218
230
val result = executePuppeteerScript(testNoFilePathScript)
219
- assertTrue(result.contains(" new tab opened" ))
220
- assertTrue(result.contains(" a source file open right now that I can generate a test for" ))
231
+ assertThat(result)
232
+ .contains(" new tab opened" )
233
+ .contains(" a source file open right now that I can generate a test for" )
221
234
}
222
235
}
223
236
@@ -248,12 +261,14 @@ class QTestGenerationChatTest {
248
261
openFile(Paths .get(" testModule1" , " HappyPath.java" ).toString())
249
262
Thread .sleep(30000 )
250
263
val result = executePuppeteerScript(testHappyPathScript)
251
- assertTrue(result.contains(" new tab opened" ))
252
- assertTrue(result.contains(" View Diff opened" ))
253
- assertTrue(result.contains(" Result Accepted" ))
254
- assertTrue(result.contains(" Unit test generation completed." ))
255
- assertTrue(result.contains(" Input field re-enabled after acceptance" ))
256
- assertTrue(result.contains(" Feedback button found with correct text" ))
264
+
265
+ assertThat(result)
266
+ .contains(
267
+ " new tab opened" ,
268
+ " View Diff opened" ,
269
+ " Result Accepted" ,
270
+ " Unit test generation completed."
271
+ )
257
272
}
258
273
}
259
274
@@ -284,8 +299,12 @@ class QTestGenerationChatTest {
284
299
openFile(Paths .get(" testModule1" , " ErrorPath.java" ).toString())
285
300
Thread .sleep(30000 )
286
301
val result = executePuppeteerScript(expectedErrorPath)
287
- assertTrue(result.contains(" new tab opened" ))
288
- assertTrue(result.contains(" Test generation complete with expected error" ))
302
+
303
+ assertThat(result)
304
+ .contains(
305
+ " new tab opened" ,
306
+ " Test generation complete with expected error"
307
+ )
289
308
}
290
309
}
291
310
@@ -316,8 +335,12 @@ class QTestGenerationChatTest {
316
335
openFile(Paths .get(" testModule2" , " UnSupportedLanguage.kt" ).toString())
317
336
Thread .sleep(30000 )
318
337
val result = executePuppeteerScript(unsupportedLanguagePath)
319
- assertTrue(result.contains(" new tab opened" ))
320
- assertTrue(result.contains(" Test generation complete with expected error" ))
338
+
339
+ assertThat(result)
340
+ .contains(
341
+ " new tab opened" ,
342
+ " Test generation complete with expected error"
343
+ )
321
344
}
322
345
}
323
346
@@ -348,12 +371,15 @@ class QTestGenerationChatTest {
348
371
openFile(Paths .get(" testModule1" , " HappyPath.java" ).toString())
349
372
Thread .sleep(30000 )
350
373
val result = executePuppeteerScript(testRejectPathScript)
351
- assertTrue(result.contains(" new tab opened" ))
352
- assertTrue(result.contains(" View Diff opened" ))
353
- assertTrue(result.contains(" Result Reject" ))
354
- assertTrue(result.contains(" Unit test generation completed." ))
355
- assertTrue(result.contains(" Input field re-enabled after rejection" ))
356
- assertTrue(result.contains(" Feedback button found with correct text" ))
374
+ assertThat(result)
375
+ .contains(
376
+ " new tab opened" ,
377
+ " View Diff opened" ,
378
+ " Result Reject" ,
379
+ " Unit test generation completed." ,
380
+ " Input field re-enabled after rejection" ,
381
+ " Feedback button found with correct text"
382
+ )
357
383
}
358
384
}
359
385
@@ -384,9 +410,12 @@ class QTestGenerationChatTest {
384
410
openFile(Paths .get(" testModule1" , " HappyPath.java" ).toString())
385
411
Thread .sleep(30000 )
386
412
val result = executePuppeteerScript(testNLErrorPathScript)
387
- assertTrue(result.contains(" new tab opened" ))
388
- assertTrue(result.contains(" Command entered: /test /something/" ))
389
- assertTrue(result.contains(" Error message displayed correctly" ))
413
+ assertThat(result)
414
+ .contains(
415
+ " new tab opened" ,
416
+ " Command entered: /test /something/" ,
417
+ " Error message displayed correctly"
418
+ )
390
419
}
391
420
}
392
421
@@ -417,9 +446,12 @@ class QTestGenerationChatTest {
417
446
openFile(Paths .get(" testModule1" , " HappyPath.java" ).toString())
418
447
Thread .sleep(30000 )
419
448
val result = executePuppeteerScript(testProgressBarScript)
420
- assertTrue(result.contains(" new tab opened" ))
421
- assertTrue(result.contains(" Progress bar text displayed" ))
422
- assertTrue(result.contains(" Test generation completed successfully" ))
449
+ assertThat(result)
450
+ .contains(
451
+ " new tab opened" ,
452
+ " Progress bar text displayed" ,
453
+ " Test generation completed successfully"
454
+ )
423
455
}
424
456
}
425
457
0 commit comments