@@ -45,12 +45,12 @@ describe('runner/cypress sessions.ui.spec', {
45
45
passCount : 1 ,
46
46
} )
47
47
48
- validateSessionsInstrumentPanel ( [ 'blank_session ' ] )
48
+ validateSessionsInstrumentPanel ( [ 'user1 ' ] )
49
49
50
50
cy . get ( '.command-name-session' )
51
51
. within ( ( ) => {
52
52
cy . get ( '.command-expander' ) . first ( ) . click ( )
53
- cy . contains ( 'blank_session ' )
53
+ cy . contains ( 'user1 ' )
54
54
cy . contains ( 'created' )
55
55
56
56
validateSetupSessionGroup ( )
@@ -309,3 +309,63 @@ describe('runner/cypress sessions.ui.spec', {
309
309
cy . percySnapshot ( )
310
310
} )
311
311
} )
312
+
313
+ describe ( 'runner/cypress sessions.open_mode.spec' , ( ) => {
314
+ beforeEach ( ( ) => {
315
+ cy . scaffoldProject ( 'session-and-origin-e2e-specs' )
316
+ cy . openProject ( 'session-and-origin-e2e-specs' )
317
+ cy . startAppServer ( 'e2e' )
318
+ cy . visitApp ( )
319
+
320
+ cy . get ( '[data-cy-row="multiple_sessions.cy.js"]' ) . click ( )
321
+ cy . waitForSpecToFinish ( {
322
+ passCount : 1 ,
323
+ } )
324
+
325
+ cy . get ( '.command-name-session' ) . should ( 'contain' , 'user1' )
326
+ . find ( '.reporter-tag' ) . should ( 'contain' , 'created' )
327
+
328
+ cy . get ( '.command-name-session' ) . should ( 'contain' , 'user2' )
329
+ . find ( '.reporter-tag' ) . should ( 'contain' , 'created' )
330
+ } )
331
+
332
+ it ( 'persists spec sessions when clicking "rerun all tests" button' , ( ) => {
333
+ cy . get ( '.restart' ) . click ( )
334
+
335
+ cy . waitForSpecToFinish ( {
336
+ passCount : 1 ,
337
+ } )
338
+
339
+ cy . get ( '.command-name-session' ) . should ( 'contain' , 'user1' )
340
+ . find ( '.reporter-tag' ) . should ( 'contain' , 'restored' )
341
+
342
+ cy . get ( '.command-name-session' ) . should ( 'contain' , 'user2' )
343
+ . find ( '.reporter-tag' ) . should ( 'contain' , 'restored' )
344
+ } )
345
+
346
+ it ( 'persists spec sessions on refresh' , ( ) => {
347
+ cy . get ( 'body' ) . type ( 'r' )
348
+
349
+ cy . waitForSpecToFinish ( {
350
+ passCount : 1 ,
351
+ } )
352
+
353
+ cy . get ( '.command-name-session' ) . should ( 'contain' , 'user1' )
354
+ . find ( '.reporter-tag' ) . should ( 'contain' , 'restored' )
355
+
356
+ cy . get ( '.command-name-session' ) . should ( 'contain' , 'user2' )
357
+ . find ( '.reporter-tag' ) . should ( 'contain' , 'restored' )
358
+ } )
359
+
360
+ it ( 'does not persists spec sessions when selecting a different spec' , ( ) => {
361
+ cy . get ( 'body' ) . type ( 'f' )
362
+ cy . get ( 'div[title="new_session.cy.js"]' ) . click ( )
363
+
364
+ cy . waitForSpecToFinish ( {
365
+ passCount : 1 ,
366
+ } )
367
+
368
+ cy . get ( '.command-name-session' ) . should ( 'contain' , 'user1' )
369
+ . find ( '.reporter-tag' ) . should ( 'contain' , 'created' )
370
+ } )
371
+ } )
0 commit comments