@@ -2,7 +2,7 @@ import { launchStudio, loadProjectAndRunSpec, assertClosingPanelWithoutChanges }
2
2
3
3
describe ( 'Cypress Studio' , ( ) => {
4
4
function incrementCounter ( initialCount : number ) {
5
- cy . waitForSpecToFinish ( )
5
+ cy . waitForSpecToFinish ( undefined , undefined , false )
6
6
7
7
cy . getAutIframe ( ) . within ( ( ) => {
8
8
cy . get ( 'p' ) . contains ( `Count is ${ initialCount } ` )
@@ -88,7 +88,7 @@ describe('studio functionality', () => {
88
88
it ( 'updates an existing test with assertions' , ( ) => {
89
89
launchStudio ( )
90
90
91
- cy . waitForSpecToFinish ( )
91
+ cy . waitForSpecToFinish ( undefined , undefined , false )
92
92
93
93
cy . getAutIframe ( ) . within ( ( ) => {
94
94
cy . get ( '#increment' ) . rightclick ( ) . then ( ( ) => {
@@ -403,7 +403,7 @@ describe('studio functionality', () => {
403
403
it ( 'shows assertions menu and submenu correctly' , ( ) => {
404
404
launchStudio ( )
405
405
406
- cy . waitForSpecToFinish ( )
406
+ cy . waitForSpecToFinish ( undefined , undefined , false )
407
407
408
408
cy . contains ( 'No commands were issued in this test.' ) . should ( 'not.exist' )
409
409
@@ -442,7 +442,7 @@ describe('studio functionality', () => {
442
442
win . location . href = win . location . href
443
443
} )
444
444
445
- cy . waitForSpecToFinish ( )
445
+ cy . waitForSpecToFinish ( undefined , undefined , false )
446
446
447
447
// after reloading we should still be in studio mode but the commands should be removed
448
448
// so the save button should be disabled
@@ -458,7 +458,7 @@ describe('studio functionality', () => {
458
458
459
459
cy . get ( 'button[aria-label="Rerun all tests"]' ) . click ( )
460
460
461
- cy . waitForSpecToFinish ( )
461
+ cy . waitForSpecToFinish ( undefined , undefined , false )
462
462
// after reloading we should still be in studio mode but the commands should be removed
463
463
// the save button should be disabled since the commands were removed
464
464
cy . findByTestId ( 'studio-save-button' ) . should ( 'be.disabled' )
@@ -524,7 +524,7 @@ describe('studio functionality', () => {
524
524
525
525
cy . findByTestId ( 'studio-save-button' ) . click ( )
526
526
527
- cy . waitForSpecToFinish ( )
527
+ cy . waitForSpecToFinish ( undefined , undefined , false )
528
528
529
529
// only the commands in the editor are written to the test block - ideally we should also pick up the changes from the file system
530
530
// TODO: https://github.com/cypress-io/cypress-services/issues/11085
@@ -651,7 +651,7 @@ describe('studio functionality', () => {
651
651
652
652
cy . findByTestId ( 'record-button-recording' ) . should ( 'be.visible' )
653
653
654
- cy . waitForSpecToFinish ( )
654
+ cy . waitForSpecToFinish ( undefined , undefined , false )
655
655
656
656
cy . getAutIframe ( ) . within ( ( ) => {
657
657
cy . get ( '#increment' ) . realClick ( )
@@ -692,4 +692,34 @@ describe('studio functionality', () => {
692
692
693
693
cy . location ( ) . its ( 'hash' ) . should ( 'contain' , 'testId=r3' ) . and ( 'contain' , 'studio=' )
694
694
} )
695
+
696
+ it ( 'removes the studio url parameters when closing studio existing test with the back button' , ( ) => {
697
+ launchStudio ( )
698
+
699
+ cy . location ( ) . its ( 'hash' ) . should ( 'contain' , 'testId=r3' ) . and ( 'contain' , 'studio=' )
700
+
701
+ cy . get ( '[data-cy="studio-back-button"]' ) . click ( )
702
+
703
+ cy . location ( ) . its ( 'hash' ) . and ( 'not.contain' , 'testId=' ) . and ( 'not.contain' , 'studio=' )
704
+ } )
705
+
706
+ it ( 'removes the studio url parameters when closing studio existing test with the studio header button' , ( ) => {
707
+ launchStudio ( )
708
+
709
+ cy . location ( ) . its ( 'hash' ) . should ( 'contain' , 'testId=r3' ) . and ( 'contain' , 'studio=' )
710
+
711
+ cy . findByTestId ( 'studio-header-studio-button' ) . click ( )
712
+
713
+ cy . location ( ) . its ( 'hash' ) . and ( 'not.contain' , 'testId=' ) . and ( 'not.contain' , 'studio=' )
714
+ } )
715
+
716
+ it ( 'removes the studio url parameters when closing studio new test' , ( ) => {
717
+ launchStudio ( { specName : 'spec-w-visit.cy.js' , createNewTest : true } )
718
+
719
+ cy . location ( ) . its ( 'hash' ) . should ( 'contain' , 'suiteId=r2' ) . and ( 'contain' , 'studio=' )
720
+
721
+ cy . findByTestId ( 'studio-header-studio-button' ) . click ( )
722
+
723
+ cy . location ( ) . its ( 'hash' ) . and ( 'not.contain' , 'suiteId=' ) . and ( 'not.contain' , 'studio=' )
724
+ } )
695
725
} )
0 commit comments