@@ -9,33 +9,34 @@ import {
99 expectOutputFileDownload ,
1010} from './utils/expect' ;
1111import { readFromCodeEditor } from './utils/editor' ;
12+ import { attachScreenshot } from './utils/page' ;
1213
1314test . describe ( 'Manual Scripts' , ( ) => {
14- test ( 'Execute CSV Generation With I/O' , async ( { page } ) => {
15+ test ( 'Execute CSV Generation With I/O' , async ( { page } , testInfo ) => {
1516 await page . goto ( '/acm' ) ;
1617 await page . getByRole ( 'button' , { name : 'Scripts' } ) . click ( ) ;
17- await page . screenshot ( { path : 'test-results/screenshots/005-scripts- list.png' } ) ;
18+ await attachScreenshot ( page , testInfo , 'Scripts list' ) ;
1819 await page . getByText ( 'example/ACME-203_output-csv' ) . click ( ) ;
19- await page . screenshot ( { path : 'test-results/screenshots/005-script- details.png' } ) ;
20+ await attachScreenshot ( page , testInfo , 'Script details' ) ;
2021 await page . getByRole ( 'button' , { name : 'Execute' } ) . click ( ) ;
2122
2223 await page . getByRole ( 'textbox' , { name : 'Users to' } ) . fill ( '5000' ) ;
2324 await page . getByRole ( 'textbox' , { name : 'First names' } ) . fill ( 'John\nJane\nJack\nAlice\nBob\nRobert' ) ;
2425 await page . getByRole ( 'textbox' , { name : 'Last names' } ) . fill ( 'Doe\nSmith\nBrown\nJohnson\nWhite\nJordan' ) ;
25- await page . screenshot ( { path : 'test-results/screenshots/005-execution- inputs- filled.png' } ) ;
26+ await attachScreenshot ( page , testInfo , 'Execution inputs filled' ) ;
2627
2728 await page . getByRole ( 'button' , { name : 'Start' } ) . click ( ) ;
2829 await expectExecutionProgressBarSucceeded ( page ) ;
29- await page . screenshot ( ) ;
30+ await attachScreenshot ( page , testInfo , 'Execution progress' ) ;
3031
3132 const output = await readFromCodeEditor ( page , 'Execution Output' ) ;
3233 expect ( output ) . toContain ( '[SUCCESS] Users CSV report generation ended successfully' ) ;
33- await page . screenshot ( { path : 'test-results/screenshots/005-execution- output.png' } ) ;
34+ await attachScreenshot ( page , testInfo , 'Execution output' ) ;
3435
3536 await page . getByRole ( 'tab' , { name : 'Details' } ) . click ( ) ;
3637
3738 await page . waitForTimeout ( 1000 ) ;
38- await page . screenshot ( ) ;
39+ await attachScreenshot ( page , testInfo , 'Execution details' ) ;
3940
4041 await expectExecutionDetails ( page ) ;
4142 await expectExecutionTimings ( page ) ;
@@ -59,19 +60,19 @@ test.describe('Manual Scripts', () => {
5960 value : 'Processed 5000 user(s)' ,
6061 } ,
6162 ] ) ;
62- await page . screenshot ( { path : 'test-results/screenshots/005-execution- outputs.png' } ) ;
63+ await attachScreenshot ( page , testInfo , 'Execution outputs' ) ;
6364
6465 await page . getByRole ( 'tab' , { name : 'Output' } ) . click ( ) ;
6566
6667 await page . getByRole ( 'button' , { name : 'Review' } ) . click ( ) ;
6768 await page . getByRole ( 'tab' , { name : 'Texts' } ) . click ( ) ;
6869 await expectOutputTexts ( page , [ 'Processed 5000 user(s)' ] ) ;
69- await page . screenshot ( { path : 'test-results/screenshots/005-output- review- texts.png' } ) ;
70+ await attachScreenshot ( page , testInfo , 'Output review texts' ) ;
7071 await page . getByTestId ( 'modal' ) . getByRole ( 'button' , { name : 'Close' } ) . click ( ) ;
7172
7273 await page . getByRole ( 'button' , { name : 'Review' } ) . click ( ) ;
7374 await page . getByRole ( 'tab' , { name : 'Files' } ) . click ( ) ;
74- await page . screenshot ( { path : 'test-results/screenshots/005-output- review- files.png' } ) ;
75+ await attachScreenshot ( page , testInfo , 'Output review files' ) ;
7576 await expectOutputFileDownload ( page , 'Download Archive' , / \. ( z i p ) $ / ) ;
7677
7778 await page . getByRole ( 'button' , { name : 'Review' } ) . click ( ) ;
0 commit comments