@@ -132,6 +132,17 @@ define(function (require, exports, module) {
132132 await waitsForLiveDevelopmentFileSwitch ( ) ;
133133 }
134134
135+ async function waitForLivePreviewToContainTitle ( title ) {
136+ await awaitsFor (
137+ function isLiveDevelopmentActive ( ) {
138+ const currentTitle = testWindow . $ ( "#panel-live-preview-title" ) . attr ( "title" ) ;
139+ return currentTitle . indexOf ( title ) !== - 1 ;
140+ } ,
141+ `Liuve prview page title to be ${ title } ` ,
142+ 20000
143+ ) ;
144+ }
145+
135146 it ( "should live preview settings work as expected" , async function ( ) {
136147 const testTempDir = await SpecRunnerUtils . getTempTestDirectory (
137148 "/spec/LiveDevelopment-MultiBrowser-test-files" , true ) ;
@@ -1007,11 +1018,12 @@ define(function (require, exports, module) {
10071018 expect ( testWindow . $ ( ".live-preview-status-overlay" ) . is ( ":visible" ) ) . toBeFalse ( ) ;
10081019
10091020 // now edit the settings
1021+ const serverURL = "http://localhost:8000" ;
10101022 testWindow . $ ( ".live-preview-settings" ) . click ( ) ;
10111023 await SpecRunnerUtils . waitForModalDialog ( ) ;
10121024 if ( ! testWindow . $ ( "#enableCustomServerChk" ) . is ( ":checked" ) ) {
10131025 testWindow . $ ( "#enableCustomServerChk" ) . click ( ) ;
1014- testWindow . $ ( "#livePreviewServerURL" ) . val ( "http://localhost:8000" ) ;
1026+ testWindow . $ ( "#livePreviewServerURL" ) . val ( serverURL ) ;
10151027 }
10161028 SpecRunnerUtils . clickDialogButton ( Dialogs . DIALOG_BTN_OK ) ;
10171029
@@ -1028,7 +1040,7 @@ define(function (require, exports, module) {
10281040 await SpecRunnerUtils . loadProjectInTestWindow ( testPath ) ;
10291041 await awaitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "simple1.html" ] ) ,
10301042 "open simple1.html" ) ;
1031- await waitsForLiveDevelopmentToOpen ( ) ;
1043+ await waitForLivePreviewToContainTitle ( serverURL ) ;
10321044 await awaits ( 100 ) ; // give some time to see if the banner comes up
10331045 expect ( testWindow . $ ( ".live-preview-settings" ) . is ( ":visible" ) ) . toBeFalse ( ) ;
10341046
0 commit comments