@@ -34,6 +34,7 @@ const CheckboxGroup = Checkbox.Group,
3434 format : "jest" ,
3535 loading : false ,
3636 allure : false ,
37+ cleanup : true ,
3738 error : ""
3839 } ;
3940
@@ -58,7 +59,7 @@ export class ExportProjectModal extends AbstractTestRunnerModal {
5859 environment : PropTypes . any
5960 }
6061
61- state = DEFAULT_STATE ;
62+ state = { ... DEFAULT_STATE } ;
6263
6364 constructor ( props ) {
6465 super ( props ) ;
@@ -73,6 +74,12 @@ export class ExportProjectModal extends AbstractTestRunnerModal {
7374 } ) ;
7475 }
7576
77+ onChangeCleanUp = ( e ) => {
78+ this . setState ( {
79+ cleanup : e . target . checked
80+ } ) ;
81+ }
82+
7683 onChange = ( checkedList ) => {
7784 const { files } = this . props ;
7885 this . setState ( {
@@ -172,8 +179,12 @@ export class ExportProjectModal extends AbstractTestRunnerModal {
172179 sharedTargets : project . targets ,
173180 env : envDto ,
174181 projectOptions : browserOptions ,
175- suiteOptions : { allure : this . state . allure } ,
176- exportOptions : { }
182+ suiteOptions : {
183+ allure : this . state . allure
184+ } ,
185+ exportOptions : {
186+ cleanup : this . state . cleanup
187+ }
177188 } ) ;
178189 message . info ( `Project exported in ${ selectedDirectory } ` ) ;
179190 break ;
@@ -219,7 +230,7 @@ export class ExportProjectModal extends AbstractTestRunnerModal {
219230 // Do not update until visible
220231 shouldComponentUpdate ( nextProps ) {
221232 if ( this . props . isVisible !== nextProps . isVisible ) {
222- this . setState ( DEFAULT_STATE ) ;
233+ nextProps . isVisible || this . setState ( DEFAULT_STATE ) ;
223234 return true ;
224235 }
225236 if ( ! nextProps . isVisible ) {
@@ -293,7 +304,7 @@ export class ExportProjectModal extends AbstractTestRunnerModal {
293304 style = { { width : 348 } }
294305 placeholder = "Select an output format"
295306 onChange = { this . onChangeFormat }
296- defaultValue = "jest"
307+ value = { format }
297308 >
298309 < Option value = "jest" key = "jest" > Jest/Puppeteer project (CI-friendly)</ Option >
299310 < Option value = "text" key = "text" > test specification</ Option >
@@ -316,10 +327,14 @@ export class ExportProjectModal extends AbstractTestRunnerModal {
316327 id = "inExportProjectModal"
317328 label = "Select a directory to export" />
318329
319- { format === "jest" && < div className = "allure-test-report- checkbox" >
320- < Checkbox onChange = { this . onChangeAllure } > generate
330+ < div className = "export-extra- checkbox-group " >
331+ { format === "jest" && < Checkbox onChange = { this . onChangeAllure } > generate
321332 { " " } < a onClick = { this . onExtClick } href = "http://allure.qatools.ru/" > Allure Test Report</ a >
322- </ Checkbox > </ div > }
333+ </ Checkbox > }
334+ < Checkbox defaultChecked = { this . state . cleanup } onChange = { this . onChangeCleanUp } >
335+ clean up output folder
336+ </ Checkbox >
337+ </ div >
323338
324339 < If exp = { files . length } >
325340 < p > Please select suites to export:</ p >
0 commit comments