@@ -78,6 +78,51 @@ function renameSupport (lang: 'js' | 'ts' | 'coffee' = 'js') {
7878 } , { lang } )
7979}
8080
81+ describe ( 'global mode' , ( ) => {
82+ it ( 'migrates 2 projects in global mode' , ( ) => {
83+ cy . openGlobalMode ( )
84+ cy . addProject ( 'migration-e2e-export-default' )
85+ cy . addProject ( 'migration-e2e-custom-integration-with-projectId' )
86+ cy . visitLaunchpad ( )
87+
88+ cy . withCtx ( ( ctx , o ) => {
89+ o . sinon . stub ( ctx . actions . migration , 'locallyInstalledCypressVersion' ) . returns ( '10.0.0' )
90+ } )
91+
92+ cy . contains ( 'migration-e2e-export-default' ) . click ( )
93+ // rename integration->e2e
94+ cy . get ( renameAutoStep ) . should ( 'exist' )
95+ cy . get ( renameManualStep ) . should ( 'not.exist' )
96+
97+ // cypress/support/index.ts -> cypress/support/e2e.ts
98+ cy . get ( renameSupportStep ) . should ( 'exist' )
99+ // no component specs
100+ cy . get ( setupComponentStep ) . should ( 'not.exist' )
101+
102+ cy . get ( configFileStep ) . should ( 'exist' )
103+
104+ runAutoRename ( )
105+ renameSupport ( 'ts' )
106+ migrateAndVerifyConfig ( 'cypress.config.ts' )
107+ checkOutcome ( )
108+
109+ cy . contains ( 'Projects' ) . click ( )
110+ cy . contains ( 'migration-e2e-custom-integration-with-projectId' ) . click ( )
111+ // default testFiles but custom integration - can rename automatically
112+ cy . get ( renameAutoStep ) . should ( 'not.exist' )
113+ // no CT
114+ cy . get ( renameManualStep ) . should ( 'not.exist' )
115+ // supportFile is false - cannot migrate
116+ cy . get ( renameSupportStep ) . should ( 'exist' )
117+ cy . get ( setupComponentStep ) . should ( 'not.exist' )
118+ cy . get ( configFileStep ) . should ( 'exist' )
119+
120+ renameSupport ( )
121+ migrateAndVerifyConfig ( )
122+ checkOutcome ( )
123+ } )
124+ } )
125+
81126describe ( 'Opening unmigrated project' , ( ) => {
82127 it ( 'legacy project with --e2e' , ( ) => {
83128 cy . scaffoldProject ( 'migration' )
0 commit comments