@@ -51,13 +51,13 @@ class QTestGenerationChatTest {
51
51
}
52
52
53
53
@Test
54
- fun `can run a test from the chat ` () {
54
+ fun `test method not found error handling ` () {
55
55
val testCase = TestCase (
56
56
IdeProductProvider .IC ,
57
57
LocalProjectInfo (
58
- Paths .get(" tstData" , " qTestGenerationTestProject" )
58
+ Paths .get(" tstData" , " qTestGenerationTestProject/ " )
59
59
)
60
- ).withVersion (System .getProperty(" org.gradle.project.ideProfileName" ))
60
+ ).useRelease (System .getProperty(" org.gradle.project.ideProfileName" ))
61
61
62
62
// inject connection
63
63
useExistingConnectionForTest()
@@ -74,22 +74,24 @@ class QTestGenerationChatTest {
74
74
}.runIdeWithDriver()
75
75
.useDriverAndCloseIde {
76
76
waitForProjectOpen()
77
- // required wait time for the system to be fully ready
77
+ openFile( Paths .get( " testModule1 " , " HappyPath.java " ).toString())
78
78
Thread .sleep(30000 )
79
- val result = executePuppeteerScript(testNoFilePathScript )
79
+ val result = executePuppeteerScript(testMethodNotFoundErrorScript )
80
80
assertTrue(result.contains(" new tab opened" ))
81
- assertTrue(result.contains(" a source file open right now that I can generate a test for" ))
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" ))
82
84
}
83
85
}
84
86
85
87
@Test
86
- fun `test happy path from the chat ` () {
88
+ fun `test cancel button during test generation ` () {
87
89
val testCase = TestCase (
88
90
IdeProductProvider .IC ,
89
91
LocalProjectInfo (
90
92
Paths .get(" tstData" , " qTestGenerationTestProject/" )
91
93
)
92
- ).withVersion (System .getProperty(" org.gradle.project.ideProfileName" ))
94
+ ).useRelease (System .getProperty(" org.gradle.project.ideProfileName" ))
93
95
94
96
// inject connection
95
97
useExistingConnectionForTest()
@@ -108,24 +110,25 @@ class QTestGenerationChatTest {
108
110
waitForProjectOpen()
109
111
openFile(Paths .get(" testModule1" , " HappyPath.java" ).toString())
110
112
Thread .sleep(30000 )
111
- val result = executePuppeteerScript(testHappyPathScript )
113
+ val result = executePuppeteerScript(testCancelButtonScript )
112
114
assertTrue(result.contains(" new tab opened" ))
113
- assertTrue(result.contains(" View Diff opened" ))
114
- assertTrue(result.contains(" Result Accepted" ))
115
- assertTrue(result.contains(" Unit test generation completed." ))
116
- assertTrue(result.contains(" Input field re-enabled after acceptance" ))
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" ))
117
120
assertTrue(result.contains(" Feedback button found with correct text" ))
118
121
}
119
122
}
120
123
121
124
@Test
122
- fun `test expected error path from the chat ` () {
125
+ fun `test documentation generation error handling ` () {
123
126
val testCase = TestCase (
124
127
IdeProductProvider .IC ,
125
128
LocalProjectInfo (
126
129
Paths .get(" tstData" , " qTestGenerationTestProject/" )
127
130
)
128
- ).withVersion (System .getProperty(" org.gradle.project.ideProfileName" ))
131
+ ).useRelease (System .getProperty(" org.gradle.project.ideProfileName" ))
129
132
130
133
// inject connection
131
134
useExistingConnectionForTest()
@@ -142,22 +145,24 @@ class QTestGenerationChatTest {
142
145
}.runIdeWithDriver()
143
146
.useDriverAndCloseIde {
144
147
waitForProjectOpen()
145
- openFile(Paths .get(" testModule1" , " ErrorPath .java" ).toString())
148
+ openFile(Paths .get(" testModule1" , " HappyPath .java" ).toString())
146
149
Thread .sleep(30000 )
147
- val result = executePuppeteerScript(expectedErrorPath )
150
+ val result = executePuppeteerScript(testDocumentationErrorScript )
148
151
assertTrue(result.contains(" new tab opened" ))
149
- assertTrue(result.contains(" Test generation complete with expected error" ))
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" ))
150
155
}
151
156
}
152
157
153
158
@Test
154
- fun `test unsupported language error path from the chat ` () {
159
+ fun `test remove function error handling ` () {
155
160
val testCase = TestCase (
156
161
IdeProductProvider .IC ,
157
162
LocalProjectInfo (
158
163
Paths .get(" tstData" , " qTestGenerationTestProject/" )
159
164
)
160
- ).withVersion (System .getProperty(" org.gradle.project.ideProfileName" ))
165
+ ).useRelease (System .getProperty(" org.gradle.project.ideProfileName" ))
161
166
162
167
// inject connection
163
168
useExistingConnectionForTest()
@@ -174,22 +179,24 @@ class QTestGenerationChatTest {
174
179
}.runIdeWithDriver()
175
180
.useDriverAndCloseIde {
176
181
waitForProjectOpen()
177
- openFile(Paths .get(" testModule2 " , " UnSupportedLanguage.kt " ).toString())
182
+ openFile(Paths .get(" testModule1 " , " HappyPath.java " ).toString())
178
183
Thread .sleep(30000 )
179
- val result = executePuppeteerScript(unsupportedLanguagePath )
184
+ val result = executePuppeteerScript(testRemoveFunctionErrorScript )
180
185
assertTrue(result.contains(" new tab opened" ))
181
- assertTrue(result.contains(" Test generation complete with expected error" ))
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" ))
182
189
}
183
190
}
184
191
185
192
@Test
186
- fun `test reject path from the chat` () {
193
+ fun `can run a test from the chat` () {
187
194
val testCase = TestCase (
188
195
IdeProductProvider .IC ,
189
196
LocalProjectInfo (
190
- Paths .get(" tstData" , " qTestGenerationTestProject/ " )
197
+ Paths .get(" tstData" , " qTestGenerationTestProject" )
191
198
)
192
- ).useRelease (System .getProperty(" org.gradle.project.ideProfileName" ))
199
+ ).withVersion (System .getProperty(" org.gradle.project.ideProfileName" ))
193
200
194
201
// inject connection
195
202
useExistingConnectionForTest()
@@ -206,26 +213,22 @@ class QTestGenerationChatTest {
206
213
}.runIdeWithDriver()
207
214
.useDriverAndCloseIde {
208
215
waitForProjectOpen()
209
- openFile( Paths .get( " testModule1 " , " HappyPath.java " ).toString())
216
+ // required wait time for the system to be fully ready
210
217
Thread .sleep(30000 )
211
- val result = executePuppeteerScript(testRejectPathScript )
218
+ val result = executePuppeteerScript(testNoFilePathScript )
212
219
assertTrue(result.contains(" new tab opened" ))
213
- assertTrue(result.contains(" View Diff opened" ))
214
- assertTrue(result.contains(" Result Reject" ))
215
- assertTrue(result.contains(" Unit test generation completed." ))
216
- assertTrue(result.contains(" Input field re-enabled after rejection" ))
217
- assertTrue(result.contains(" Feedback button found with correct text" ))
220
+ assertTrue(result.contains(" a source file open right now that I can generate a test for" ))
218
221
}
219
222
}
220
223
221
224
@Test
222
- fun `test NL error from the chat` () {
225
+ fun `test happy path from the chat` () {
223
226
val testCase = TestCase (
224
227
IdeProductProvider .IC ,
225
228
LocalProjectInfo (
226
229
Paths .get(" tstData" , " qTestGenerationTestProject/" )
227
230
)
228
- ).useRelease (System .getProperty(" org.gradle.project.ideProfileName" ))
231
+ ).withVersion (System .getProperty(" org.gradle.project.ideProfileName" ))
229
232
230
233
// inject connection
231
234
useExistingConnectionForTest()
@@ -244,21 +247,24 @@ class QTestGenerationChatTest {
244
247
waitForProjectOpen()
245
248
openFile(Paths .get(" testModule1" , " HappyPath.java" ).toString())
246
249
Thread .sleep(30000 )
247
- val result = executePuppeteerScript(testNLErrorPathScript )
250
+ val result = executePuppeteerScript(testHappyPathScript )
248
251
assertTrue(result.contains(" new tab opened" ))
249
- assertTrue(result.contains(" Command entered: /test /something/" ))
250
- assertTrue(result.contains(" Error message displayed correctly" ))
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" ))
251
257
}
252
258
}
253
259
254
260
@Test
255
- fun `test progress bar during test generation ` () {
261
+ fun `test expected error path from the chat ` () {
256
262
val testCase = TestCase (
257
263
IdeProductProvider .IC ,
258
264
LocalProjectInfo (
259
265
Paths .get(" tstData" , " qTestGenerationTestProject/" )
260
266
)
261
- ).useRelease (System .getProperty(" org.gradle.project.ideProfileName" ))
267
+ ).withVersion (System .getProperty(" org.gradle.project.ideProfileName" ))
262
268
263
269
// inject connection
264
270
useExistingConnectionForTest()
@@ -275,23 +281,22 @@ class QTestGenerationChatTest {
275
281
}.runIdeWithDriver()
276
282
.useDriverAndCloseIde {
277
283
waitForProjectOpen()
278
- openFile(Paths .get(" testModule1" , " HappyPath .java" ).toString())
284
+ openFile(Paths .get(" testModule1" , " ErrorPath .java" ).toString())
279
285
Thread .sleep(30000 )
280
- val result = executePuppeteerScript(testProgressBarScript )
286
+ val result = executePuppeteerScript(expectedErrorPath )
281
287
assertTrue(result.contains(" new tab opened" ))
282
- assertTrue(result.contains(" Progress bar text displayed" ))
283
- assertTrue(result.contains(" Test generation completed successfully" ))
288
+ assertTrue(result.contains(" Test generation complete with expected error" ))
284
289
}
285
290
}
286
291
287
292
@Test
288
- fun `test cancel button during test generation ` () {
293
+ fun `test unsupported language error path from the chat ` () {
289
294
val testCase = TestCase (
290
295
IdeProductProvider .IC ,
291
296
LocalProjectInfo (
292
297
Paths .get(" tstData" , " qTestGenerationTestProject/" )
293
298
)
294
- ).useRelease (System .getProperty(" org.gradle.project.ideProfileName" ))
299
+ ).withVersion (System .getProperty(" org.gradle.project.ideProfileName" ))
295
300
296
301
// inject connection
297
302
useExistingConnectionForTest()
@@ -308,21 +313,16 @@ class QTestGenerationChatTest {
308
313
}.runIdeWithDriver()
309
314
.useDriverAndCloseIde {
310
315
waitForProjectOpen()
311
- openFile(Paths .get(" testModule1 " , " HappyPath.java " ).toString())
316
+ openFile(Paths .get(" testModule2 " , " UnSupportedLanguage.kt " ).toString())
312
317
Thread .sleep(30000 )
313
- val result = executePuppeteerScript(testCancelButtonScript )
318
+ val result = executePuppeteerScript(unsupportedLanguagePath )
314
319
assertTrue(result.contains(" new tab opened" ))
315
- assertTrue(result.contains(" Progress bar text displayed" ))
316
- assertTrue(result.contains(" Cancel button found" ))
317
- assertTrue(result.contains(" Cancel button clicked" ))
318
- assertTrue(result.contains(" Test generation cancelled successfully" ))
319
- assertTrue(result.contains(" Input field re-enabled after cancellation" ))
320
- assertTrue(result.contains(" Feedback button found with correct text" ))
320
+ assertTrue(result.contains(" Test generation complete with expected error" ))
321
321
}
322
322
}
323
323
324
324
@Test
325
- fun `test documentation generation error handling ` () {
325
+ fun `test reject path from the chat ` () {
326
326
val testCase = TestCase (
327
327
IdeProductProvider .IC ,
328
328
LocalProjectInfo (
@@ -347,16 +347,18 @@ class QTestGenerationChatTest {
347
347
waitForProjectOpen()
348
348
openFile(Paths .get(" testModule1" , " HappyPath.java" ).toString())
349
349
Thread .sleep(30000 )
350
- val result = executePuppeteerScript(testDocumentationErrorScript )
350
+ val result = executePuppeteerScript(testRejectPathScript )
351
351
assertTrue(result.contains(" new tab opened" ))
352
- assertTrue(result.contains(" Error message displayed correctly" ))
353
- assertTrue(result.contains(" Input field re-enabled after error" ))
354
- assertTrue(result.contains(" Feedback button found with correct text after error" ))
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" ))
355
357
}
356
358
}
357
359
358
360
@Test
359
- fun `test remove function error handling ` () {
361
+ fun `test NL error from the chat ` () {
360
362
val testCase = TestCase (
361
363
IdeProductProvider .IC ,
362
364
LocalProjectInfo (
@@ -381,16 +383,15 @@ class QTestGenerationChatTest {
381
383
waitForProjectOpen()
382
384
openFile(Paths .get(" testModule1" , " HappyPath.java" ).toString())
383
385
Thread .sleep(30000 )
384
- val result = executePuppeteerScript(testRemoveFunctionErrorScript )
386
+ val result = executePuppeteerScript(testNLErrorPathScript )
385
387
assertTrue(result.contains(" new tab opened" ))
388
+ assertTrue(result.contains(" Command entered: /test /something/" ))
386
389
assertTrue(result.contains(" Error message displayed correctly" ))
387
- assertTrue(result.contains(" Input field re-enabled after error" ))
388
- assertTrue(result.contains(" Feedback button found with correct text after error" ))
389
390
}
390
391
}
391
392
392
393
@Test
393
- fun `test method not found error handling ` () {
394
+ fun `test progress bar during test generation ` () {
394
395
val testCase = TestCase (
395
396
IdeProductProvider .IC ,
396
397
LocalProjectInfo (
@@ -415,11 +416,10 @@ class QTestGenerationChatTest {
415
416
waitForProjectOpen()
416
417
openFile(Paths .get(" testModule1" , " HappyPath.java" ).toString())
417
418
Thread .sleep(30000 )
418
- val result = executePuppeteerScript(testMethodNotFoundErrorScript )
419
+ val result = executePuppeteerScript(testProgressBarScript )
419
420
assertTrue(result.contains(" new tab opened" ))
420
- assertTrue(result.contains(" Error message displayed correctly" ))
421
- assertTrue(result.contains(" Input field re-enabled after error" ))
422
- assertTrue(result.contains(" Feedback button found with correct text after error" ))
421
+ assertTrue(result.contains(" Progress bar text displayed" ))
422
+ assertTrue(result.contains(" Test generation completed successfully" ))
423
423
}
424
424
}
425
425
0 commit comments